Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SetCameraBehindPlayer(playerid);// Zombie stats
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPlayerHealth(playerid, 100);
SetSpawnInfo(playerid, 0, 162, 2143.5872,-1166.8904,23.9922, 9, 0, 0, 0, 0, 0, 0);
SetPlayerArmour(playerid, 50);
SetPlayerTeam(playerid, 2);
SendClientMessage(playerid, COL_GREY, "You became a zombie, kill a human to turn human again");
SpawnPlayer(playerid);//
SetCameraBehindPlayer(killerid); // Killer stats
SetPlayerVirtualWorld(killerid, 0);
SetPlayerInterior(killerid, 0);
SetPlayerHealth(killerid, 55);
SetPlayerArmour(killerid, 0);
SetPlayerSkin(killerid, 98);
SetPlayerTeam(killerid, 1);
SetPlayerPos(killerid,738.8650,-1418.0709,13.5234);
SendClientMessage(killerid, COL_GREY, "You became human again");//
return 1;
}
Didin't notice that you added it under OnPlayerDeath. As the guy below said, add it under OnPlayerSpawn. Make a bool to check if he spawned and died and check under OnPlayerSpawn if he did die or not.
When you die, the spawn function is trigerred automatically even if you include that SpanwPlayer line and resets your settings you define in playerdeath. If you dont want to add those lines with weapons and etc under onplayerspawn (for reason i can't imagine), activate a non-repeating timer as soon the player dies which will eventually give the weapons-settings.