[HELP] Please! Command Spec (Save my arms, money and my position.)?
#5

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:
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
}
Might want to also get interior and virtual world. Store them like BeforeSpectate and reapply them when the player spawns
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)