02.09.2013, 03:33
if player die how can i make him teleport to the hospital?
public OnPlayerDeath(playerid, killerid, reason) { SetPlayerPos(playerid, 1552.5980,-1676.2185,16.1953,76.0868); //He will spawn at LSPD but you can change the cords to the Hospital return 1; }
new playerDied[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
...
playerDied[playerid] = 0;
...
}
public OnPlayerDeath(playerd, killerid, reason)
{
...
playerDied[playerid] = 1;
...
}
public OnPlayerSpawn(playerid)
{
...
if(playerDied[playerid])
{
SetPlayerPos(playerid, ...);
SendClientMessage(playerid, 0xFF3333, "Welcome to the Hospital!");
playerDied[playerid] = 0;
}
}