hospital tele.
#1

if player die how can i make him teleport to the hospital?
Reply
#2

Код:
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;
}
Hope this helped,
Reply
#3

zrelly, players can avoid it by pressing f4, but you can prevent it
pawn Код:
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;
    }
}
Reply
#4

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)