SA-MP Forums Archive
How to SYNC a player? - 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: How to SYNC a player? (/showthread.php?tid=556659)



How to SYNC a player? - Neufox - 11.01.2015

Simple question, how can I synchronize a player, like if a teammate knifes a teammate, then how can I sync the player back?


Re: How to SYNC a player? - fatlirmorina - 11.01.2015

Depends on what GM you've done, with teams or w/e .
SetPlayerTeam(playerid, 0);


Re: How to SYNC a player? - Neufox - 11.01.2015

Quote:
Originally Posted by fatlirmorina
Посмотреть сообщение
Depends on what GM you've done, with teams or w/e .
SetPlayerTeam(playerid, 0);
I am only talking about syncing a player, Refreshing a player!!


Re: How to SYNC a player? - Threshold - 11.01.2015

Your best chance would be to stream them out, then stream them in again. Try changing their virtual worlds and then changing it back.

pawn Код:
new oldworld = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, oldworld + 1);
SetPlayerVirtualWorld(playerid, oldworld);
I'm not sure if a timer is required here, but chances are that you may need to set a timer for 1-2 seconds before setting the player's world to its original.


Re: How to SYNC a player? - Neufox - 11.01.2015

Quote:
Originally Posted by Threshold
Посмотреть сообщение
Your best chance would be to stream them out, then stream them in again. Try changing their virtual worlds and then changing it back.

pawn Код:
new oldworld = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, oldworld + 1);
SetPlayerVirtualWorld(playerid, oldworld);
I'm not sure if a timer is required here, but chances are that you may need to set a timer for 1-2 seconds before setting the player's world to its original.
Will that work when a player is knifed and lying down on ground(samp bug) and can't stand. If i use your code will it make the player to normal state!


Re: How to SYNC a player? - Threshold - 11.01.2015

I'm pretty sure, yes. Although you might need to add a timer, I'm not sure.