17.03.2012, 08:44
Quote:
|
Hello
I want to do that if the player dies it's will send him to the hospital sometimes it's work and sometimes it's not if i kill other player he will just spawn at the spawn point if the player falling from the air and dies he spawns at the hospital WTF? how to do that?which code you need? |
Add this on top of your script
pawn Код:
new playerDeath[MAX_PLAYERS];
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
playerDeath[playerid] = 1; // This is saying that the player died.
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
if(playerDeath[playerid] == 1) // This is checking if the player had died previously
{
SetPlayerPos(playerid, X, Y, Z); // Replace X, Y, and Z With the Hospital Co-ords.
playerDeath[playerid] = 0; // This is saying the player is not dead.
return 1;
}
return 1;
}
Sorry if I explained it wrong, it's just hard for me to explain.


