03.11.2015, 09:14
Make a new variable or something like
when the player dies set it to true
and do something like?
PHP код:
new bool:JustDied[MAX_PLAYERS];
PHP код:
JustDied[playerid] = true;
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
JustDied[playerid] = true;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(JustDied[playerid] == true)
{
/*
Just remove SetPlayerSkin and insert your code for them to select a skin.
*/
SetPlayerPos(playerid, 254.5229, -1367.1545, 53.1094);
SetPlayerFacingAngle(playerid, 297.0670);
SetPlayerSkin(playerid, 51); // Biker Skin?
SetPlayerTeam(playerid, pBikers);
JustDied[playerid] = false;
}
return 1;
}