11.01.2012, 11:42
How i can spawn someone to hospital when died? because if someone die spawn at spawnpoint :/
new died[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
died[playerid] = 1;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(died[playerid] == 1)
{
//Spawn at hospital
died[playerid] = 0;
}
return 1;
}
SetPVarInt(playerid, "Dead", 1);
if(GetPVarInt(playerid, "Dead")) {
SetPlayerPos(playerid, fX, fY, fZ); // Position of the hospital.
DeletePVar(playerid, "Dead");
}