SA-MP Forums Archive
Server Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server Problem (/showthread.php?tid=473280)



Server Problem - AryanV - 02.11.2013

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;
}




Re : Server Problem - samp_boy - 02.11.2013

your server still lagging without Host ?


Re: Server Problem - AryanV - 02.11.2013

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


Re: Server Problem - Konstantinos - 02.11.2013

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.