12.06.2011, 20:04
pawn Код:
//On top
new AntiSpawnKillProtected[MAX_PLAYERS];
forward AntiSpawnKillOff(playerid);
//Under OnPlayerSpawn
AntiSpawnKillProtected[playerid] = 1;
SetTimer("AntiSpawnKillOff", 10000, false);
// Under OnPlayerUpdate
if(AntiSpawnKillProtected[playerid] == 1)
{
SetPlayerHealth(playerid, 1000);
}
//Somewhere in script (outside a callback)
AntiSpawnKillOff(playerid)
{
SetPlayerHealth(playerid, 100);
AntiSpawnKillProtected[playerid] = 0;
SendClientMessage(playerid, -1, "Anti spawn kill is now off!");
return true;
}