11.01.2013, 10:36
Thanks! I had a look at the code and I saw this:
I'm not able to test it to a local host because I will never be desynced, but it happens when I lag in servers with a lot of people. So, it basically unfreeze a player, set his position 2 meters higher and clear the animations will make the player be synced again? If it does, nice.
Note; the lenght of the command "/sync" is 5, not 10.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/sync", cmdtext, true, 10) == 0)
{
new Float:X;
new Float:Y;
new Float:Z;
TogglePlayerControllable(playerid,1);
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z+2);
ClearAnimations(playerid);
PlayerPlaySound(playerid, 1137, X, Y, Z);
SendClientMessage(playerid,0x00FFFFFF,"You are synced.");
return 1;
}
return 0;
}
Note; the lenght of the command "/sync" is 5, not 10.