Server Problem
#1

My Server acutally lags after i fully scripted it..If i am moving then in other players screen it comes that i am standing at at one place and vice versa.....A Scripter told me to replace callback return 0 to 1 and i do so but then also it lags

the callback code is:
Quote:

public OnPlayerUpdate(playerid)
{
if(!IsPlayerConnected(playerid)) return 0;
// No weapons in interiors
if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
SetPlayerArmedWeapon(playerid,0); // fists
return 0; // no syncing until they change their weapon
}
return 1;
}

Reply
#2

your server still lagging without Host ?
Reply
#3

Yes My Server Is Not Hosted...But Its Lagging but when i enter a vehicle then player can see me moving otherwise In Players Screen I appear to be Standing
Reply
#4

OnPlayerUpdate won't be called if the player is not online so the first check is totally pointless.

Returning 0 into that callback, it makes that player not updated to the rest of the players (standing in one place with the hourglass above their head). It will do that as long as the interior and the weapon are not 0.

The lag is not caused by that callback, but may be the use of many timers or something else.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)