HELP!!!
#1

how to do players spawn at the hospital after his death
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerPos(playerid,X,Y,Z);
    return 1;
}
Reply
#3

pawn Код:
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;
}
Reply
#4

I'd rather do something else:
pawn Код:
//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;
}
Reply
#5

Quote:
Originally Posted by antonio112
Посмотреть сообщение
I'd rather do something else:
But this would only set them to the hospital if they get shot by someone else.
Reply
#6

Rather make an "JustLogged" variable, to check if the player has just logged in. Players should probably not spawn at the hospital once they spawn without dying.
Reply
#7

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
But this would only set them to the hospital if they get shot by someone else.
Yea ... but without that, you'd spawn at hospital after you just logged in. He probably uses it for a RP gamemode and could have other variables aswell. Anyhow, it was just an example. Like Cameltoe said, he should use a variable instead of my example.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)