SA-MP Forums Archive
Help plz - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help plz (/showthread.php?tid=328249)



Help plz - 3RoR - 24.03.2012

y make a Hospital system now when y die y not spawn in the hospital(y Set to spawn on Hospital) it's spawn again in civil but the script is running the player is not moving in the civil spawn when he die wtf is ?


Re: Help plz - Vladamir - 24.03.2012

Quote:
Originally Posted by 3RoR
Посмотреть сообщение
y make a Hospital system now when y die y not spawn in the hospital(y Set to spawn on Hospital) it's spawn again in civil but the script is running the player is not moving in the civil spawn when he die wtf is ?
You really need to start including more detailed information and a copy of the script you are running but are having troubles with. We cannot read your mind, nor can we pull code from thin air to fix your problem!


Re: Help plz - Unte99 - 24.03.2012

Quote:
Originally Posted by 3RoR
Посмотреть сообщение
y make a Hospital system now when y die y not spawn in the hospital(y Set to spawn on Hospital) it's spawn again in civil but the script is running the player is not moving in the civil spawn when he die wtf is ?
You have an errror in your language code. We can not understand you.


Re: Help plz - 3RoR - 24.03.2012

why when a player dies, not going to hospital ?
y Set setPlayerpos(...);
when he die the script is running but he ain't going to the pose :@


Re: Help plz - JJB562 - 24.03.2012

Try using this:

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.