Need Help :D
#6

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Save his position in OnPlayerDeath, e.g. in an global array for every player. In OnPlayerSpawn you can set the pos again then with the values you stored - maybe with another check, if he should only spawn there, if he is healed or so.

pawn Код:
On the top with the other variables:
new Float:deathpos[MAX_PLAYERS][3];

In OnPlayerDeath:
GetPlayerPos(playerid, deathpos[playerid][0], deathpos[playerid][1], deathpos[playerid][2]);

in OnPlayerSpawn:
SetPlayerPos(playerid, deathpos[playerid][0], deathpos[playerid][1], deathpos[playerid][2]);
That's going to set your x,y, and z coordinates to 0 when you spawn after connecting to the server.

pawn Код:
new IsPlayerDead[MAX_PLAYERS]; //On top of script
pawn Код:
OnplayerDeath(playerid, killerid, reason)
{
    IsPlayerDead = 1;
    return 1;
}
pawn Код:
OnPlayerSpawn(playerid)
{
    if(IsPlayerDead[playerid] == 1)
    {
        //Do stuff here
    }
    return 1;
}
Reply


Messages In This Thread
Need Help :D - by sekol - 26.08.2010, 10:34
Re: Need Help :D - by Hiddos - 26.08.2010, 10:40
Re: Need Help :D - by LifeStyle - 26.08.2010, 10:42
Re: Need Help :D - by sekol - 26.08.2010, 10:43
Re: Need Help :D - by Mauzen - 26.08.2010, 10:43
Re: Need Help :D - by Adil - 26.08.2010, 14:15

Forum Jump:


Users browsing this thread: 1 Guest(s)