Posts: 6,129
Threads: 36
Joined: Jan 2009
I think, you can use GetPlayerPos() in the OnPlayerDeath callback, once you've done that, log if they've died in a variable/float (for example) and then set their position:
pawn Код:
new Float: PlayerPosX[ MAX_PLAYERS ], Float: PlayerPosY[ MAX_PLAYERS ], Float: PlayerPosZ[ MAX_PLAYERS ];
public OnPlayerDeath( playerid, killerid, reason )
{
GetPlayerPos( playerid, PlayerPosX[ playerid ], PlayerPosY[ playerid ], PlayerPosZ[ playerid ] );
return 1;
}
public OnPlayerSpawn( playerid )
{
SetPlayerPos( playerid, PlayerPosX[ playerid ], PlayerPosY[ playerid ], PlayerPosZ[ playerid ] );
return 1;
}
This may not work.
Posts: 654
Threads: 20
Joined: Jul 2009
Reputation:
0
Personally I would use OnPlayerStateChange for this. That way it can be handled within one callback. Although I'm not certain if OnPlayerStateChange would get called before OnPlayerSpawn. Spawn positions from AddPlayerClass function calls are stored client side.