SA-MP Forums Archive
All players unsynced? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: All players unsynced? (/showthread.php?tid=198379)



All players unsynced? - [UF]Ultimate - 11.12.2010

Okay so I dont know what is going on, recently in my server the players have become unsynced randomly, and the bug does not fix until I do a full restart (not just gmx, but go into the serverffs panel and hit stop, then start). After I did that it happened again, what is happening is players just appear to be standing in one spot but their not, we can still talk to each other but none of us are moving. If I move on my screen, no one else sees me moving, and vice-versa too.

Does anyone know why this is?

EDIT: Even our NPC just stopped driving and appeared out of his car

EDIT AGAIN: It happened when I added a 268 object map (STREAMED THOUGH) could that be causing it? It is streamed with distance 500.0 but they are all within 500 XYZ of eachother


Re: All players unsynced? - The_Moddler - 11.12.2010

Show your OnPlayerUpdate.


Re: All players unsynced? - dengli - 12.12.2010

i don't find this problem,maybe cause by your gamemode


Re: All players unsynced? - Sayaron - 12.12.2010

This problem is from your side as it havent happend with me. Maybe the players got high ping, the host is bad or having trouble, or its caused by the GM. Anyway, this problem only applies for you


Re: All players unsynced? - Steven82 - 12.12.2010

It's the host 'Serverffs"


Re: All players unsynced? - [UF]Ultimate - 12.12.2010

My on player update might be causing it, as it just happened when I added this:
Код:
public OnPlayerUpdate(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid, 600, 2436.52734375, -3265.2568359375, 1.2389065027237))
	{
	    new Name[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, Name, sizeof(Name));
	    if(strcmp(Name, "[UF]Ultimate", false)) SetPlayerArmedWeapon(playerid, 0);
	}
}



Re: All players unsynced? - [UF]Ultimate - 12.12.2010

Quote:
Originally Posted by Steven82
Посмотреть сообщение
It's the host 'Serverffs"
No its not
Quote:
Originally Posted by Sayaron
Посмотреть сообщение
This problem is from your side as it havent happend with me. Maybe the players got high ping, the host is bad or having trouble, or its caused by the GM. Anyway, this problem only applies for you
That would cause lag, and it affects everyone on my server not just me, it never happened until I added the OnPlayerUpdate line above, and the huge map


Re: All players unsynced? - CodeRae - 12.12.2010

Quote:
Originally Posted by [UF]Ultimate
Посмотреть сообщение
My on player update might be causing it, as it just happened when I added this:
Код:
public OnPlayerUpdate(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid, 600, 2436.52734375, -3265.2568359375, 1.2389065027237))
	{
	    new Name[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, Name, sizeof(Name));
	    if(strcmp(Name, "[UF]Ultimate", false)) SetPlayerArmedWeapon(playerid, 0);
	}
}
This code will be repeated hundreds of times a second per player within that radius, which will cause alot of lag. Try adding a check to see if the player is already unarmed.

Код:
public OnPlayerUpdate(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid, 600, 2436.52734375, -3265.2568359375, 1.2389065027237))
	{
		if(GetPlayerWeapon(playerid) != 0)
		{
			new Name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, Name, sizeof(Name));
			if(strcmp(Name, "[UF]Ultimate", false)) SetPlayerArmedWeapon(playerid, 0);
		}
	}
}



Re: All players unsynced? - Memoryz - 12.12.2010

You need to add return 1; in your onplayerupdate.


Re: All players unsynced? - DVDK - 12.12.2010

Код:
new PlayerUpdate[MAX_PLAYERS];
public OnPlayerUpdate(playerid)
{
        PlayerUpdate[playerid] ++;
        if(PlayerUpdate[playerid] >= 15)
        {
		PlayerUpdate[playerid] = 0;
		if(IsPlayerInRangeOfPoint(playerid, 600, 2436.52734375, -3265.2568359375, 1.2389065027237))
		{
			new Name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, Name, sizeof(Name));
			if(strcmp(Name, "[UF]Ultimate", false)) SetPlayerArmedWeapon(playerid, 0);
		}
	}
	return 1;
}