26.09.2011, 17:18
how to do players spawn at the hospital after his death
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid,X,Y,Z);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid, X, Y, Z);
//X Y Z are the coordinates, which you have to look for. Just go to the hospital and type /save.
//Then go to My Documents/GTA San Andreas Userfiles/SAMP/savedpositions.txt and copy the XYZ of the last line.
return 1;
}
//On top of your script
new Killed[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
{
Killerd[playerid] = 1;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(Killed[playerid] == 1)
{
SetPlayerPos(playerid, X, Y, Z);
Killed[playerid] = 0;
}
return 1;
}