this doesn't look good to me. you don't need to update the hull every two frames:
Code:
while(1) {
			wait(1); //needed for c_updatehull
			c_updatehull(my,0); //updates the collsision hull
			enet_send_pos(enet_ent_globpointer(my),-1);
			wait(1);
		}



try this instead:
Code:
function move_ball()
{
	wait(1); //needed for c_updatehull
	c_updatehull(my,0); //updates the collsision hull
	VECTOR ball_dist; //needed for the movement
	VECTOR save_pos; //stores the entity.pos (needed to find out if the position has changed)
	VECTOR temp; //a temporary vector
	var save_pan = 0; //stores the entity.pan (needed to find out if the pan has changed)
	me.flags |= SHADOW;



	while(enet_ent_globpointer(my) == -1) {wait(1);} //wait until the entity gets a global pointer
	if(enet_get_connection() !=2)
	{
		//only do physics on the server:
		// Now let's set the ball's physical properties. 
		phent_settype(me,PH_RIGID,PH_SPHERE);
		phent_setmass(me,1,PH_SPHERE);
		phent_setfriction(me,90);
		phent_setelasticity(me,75,100);
		phent_setdamping(me,30,5);
		// We add a small speed to give it a little sidewards kick. 
		//		phent_addvelcentral(me,vector(10,10,0));

		// A ball game would be no fun without gravity.
		ph_setgravity(vector(0,0,-500));
		//only do the events on the server:
		me.emask |= (ENABLE_FRICTION | ENABLE_PUSH | ENABLE_IMPACT);
		me.push = 1;
		me.event = bounce_event;
		var timePassed = 0;
		while(1) {
			timePassed += time_frame;
			if(timePassed >= 2) {		//only send 8 times a second.
				timePassed = 0;
				enet_send_pos(enet_ent_globpointer(my),-1);
			}
			wait(1);
		}
	}
	else
	{
		while(my) {
			//do movement prediction in here
			wait(1);
		}
	}
}



This may not work. For smooth movent, you should add the movement prediction in the client's part of the ball function. You were sending the position once a frame, which may work on a LAN game and for testing purposes, but it'll produce way too much traffic when you play an internet game or when you have more people join. Instead of sending the position directly, you should also put it into skills and send those, then you can easily (more or less) work from those skills on the clients, to predict where the ball will go next.

Also, receive_ballkick(var sender,STRING* msg) must be a server event that the client triggers on the server. I can't see here whether it is or not.

Hope this helps...

Last edited by Germanunkol; 08/27/09 15:53.

~"I never let school interfere with my education"~
-Mark Twain