Spawn after death
#3

Quote:
Originally Posted by Chris_Morrison
Посмотреть сообщение
Hello
I want to do that if the player dies it's will send him to the hospital
sometimes it's work and sometimes it's not
if i kill other player he will just spawn at the spawn point
if the player falling from the air and dies he spawns at the hospital WTF?
how to do that?which code you need?
I made a script for you:

Add this on top of your script

pawn Код:
new playerDeath[MAX_PLAYERS];
Now let's get onto the main work

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    playerDeath[playerid] = 1; // This is saying that the player died.
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(playerDeath[playerid] == 1) // This is checking if the player had died previously
    {
        SetPlayerPos(playerid, X, Y, Z); // Replace X, Y, and Z With the Hospital Co-ords.
        playerDeath[playerid] = 0; // This is saying the player is not dead.
        return 1;
    }
    return 1;
}
Hopefully this helped you.
Sorry if I explained it wrong, it's just hard for me to explain.
Reply


Messages In This Thread
Spawn after death - by Chris_Morrison - 17.03.2012, 07:56
Re: Spawn after death - by GNGification - 17.03.2012, 08:40
Re: Spawn after death - by JJB562 - 17.03.2012, 08:44
Re: Spawn after death - by ReneG - 17.03.2012, 10:14
Re: Spawn after death - by Chris_Morrison - 17.03.2012, 13:37
Re: Spawn after death - by Chris_Morrison - 17.03.2012, 18:04
Re: Spawn after death - by Chris_Morrison - 18.03.2012, 13:54

Forum Jump:


Users browsing this thread: 1 Guest(s)