SA-MP Forums Archive
Wierd Lag - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Wierd Lag (/showthread.php?tid=521064)



Wierd Lag - Zigonja - 21.06.2014

Im experiencing wierd lag with my server, just to give you an example of two commands

Код:
CMD:left(playerid)
{
	if(!(PlayerInfo[playerid][pAdmin] >= 4)) return SendClientMessage(playerid, COLOR_ORANGE, "** You're not premited");
	if(!IsPlayerConnected(playerid)) return 1;
    GetPlayerPos(playerid, slx, sly, slz);

	if(GetPlayerState(playerid) == 2)
	{
        SetVehiclePos(GetPlayerVehicleID(playerid),slx,sly-2,slz);
	}
	else
	{
        SetPlayerPos(playerid, slx,sly-2, slz);
	}
	SendClientMessage(playerid, COLOR_ORANGE, "** You have been moved left.");
    return 1;
}

CMD:right(playerid)
{
	if(!(PlayerInfo[playerid][pAdmin] >= 4)) return SendClientMessage(playerid, COLOR_ORANGE, "** You're not premited");
	if(!IsPlayerConnected(playerid)) return 1;
    GetPlayerPos(playerid, slx, sly, slz);

	if(GetPlayerState(playerid) == 2)
	{
        SetVehiclePos(GetPlayerVehicleID(playerid),slx,sly+2,slz);
	}
	else
	{
        SetPlayerPos(playerid, slx,sly+2, slz);
	}
	SendClientMessage(playerid, COLOR_ORANGE, "** You have been moved right.");
    return 1;
}
They're the same, but the /right takes 0.1 seconds to excecute and /left takes more than 5 seconds to work, anyone has any idea why?