07.04.2010, 18:18
Well, I was told the other day that leaving spectate will reset your player weapons and heal your player.
Also, OnPlayerSpawn will be called.
Check OnPlayerSpawn for money code, it might be resetting it there.
Lose your position? Of course, it will respawn the player.
This would work:
Might want to also get interior and virtual world. Store them like BeforeSpectate and reapply them when the player spawns
Also, OnPlayerSpawn will be called.
Check OnPlayerSpawn for money code, it might be resetting it there.
Lose your position? Of course, it will respawn the player.
This would work:
pawn Код:
new BeforeSpectate[MAX_PLAYERS][3];
pawn Код:
//above TogglePlayerSpectating(playerid,true);
GetPlayerPos(playerid, BeforeSpectate[playerid][0],BeforeSpectate[playerid][1],BeforeSpectate[playerid][2]);
pawn Код:
OnPlayerSpawn(playerid)
{
if(BeforeSpectate[playerid][0]!=0.0)
{
GetPlayerPos(playerid, BeforeSpectate[playerid][0],BeforeSpectate[playerid][1],BeforeSpectate[playerid][2]);
BeforeSpectate[playerid][0]=0.0,BeforeSpectate[playerid][1]=0.0,,BeforeSpectate[playerid][2]=0.0;
return 1;
}
//rest of code
}