OnPlayerDeath
#1

I have some questions about OnPlayerDeath

If I SetPlayerPos under OnPlayerDeath, it just shows a picture from this place and player dies there, then it respawns to some different place. How I can make SetPlayerpos after player is dead and set his pos?
Reply
#2

OnPlayerSpawn?
Reply
#3

Quote:
Originally Posted by Jakku
I have some questions about OnPlayerDeath

If I SetPlayerPos under OnPlayerDeath, it just shows a picture from this place and player dies there, then it respawns to some different place. How I can make SetPlayerpos after player is dead and set his pos?
Joining the question - when player die he spawn at hospital how to do this ?
Reply
#4


Top of script

Код:
new Died[MAX_PLAYERS];
OnPlayerConnect

Код:
Died[playerid] = 0;
OnPlayerDeath

Код:
Died[playerid] 1;
OnPlayerSpawn

Код:
if(Died[playerid] == 1)
{
SetPlayerInterior(playerid,0);//incase died in an interior
SetPlayerPos(playerid,/*Hospital Co-ord*/);
Died[playerid] = 0;
//anything else like medical bill goes here
return 1;
}
Reply
#5

Quote:
Originally Posted by pagie1111
Top of script

Код:
new Died[MAX_PLAYERS];
OnPlayerConnect

Код:
Died[playerid] = 0;
OnPlayerDeath

Код:
Died[playerid] 1;
OnPlayerSpawn

Код:
if(Died[playerid] == 1)
{
SetPlayerInterior(playerid,0);//incase died in an interior
SetPlayerPos(playerid,/*Hospital Co-ord*/);
Died[playerid] = 0;
//anything else like medical bill goes here
return 1;
}
Oh yeah, thanks. I though onplayerspawn only works when player comes and selects the skin
Reply
#6

No offense, but its better to use as less vars/functions as posible..

why dont you check if the players health is 0 ? (0 equals to death..)
Reply
#7

Quote:
Originally Posted by Geekzor
Quote:
Originally Posted by Jakku
I have some questions about OnPlayerDeath

If I SetPlayerPos under OnPlayerDeath, it just shows a picture from this place and player dies there, then it respawns to some different place. How I can make SetPlayerpos after player is dead and set his pos?
Joining the question - when player die he spawn at hospital how to do this ?
Yes
Reply
#8

Quote:
Originally Posted by PKRanger
No offense, but its better to use as less vars/functions as posible..

why dont you check if the players health is 0 ? (0 equals to death..)
Because their health won't be 0 when they spawn, and he's checking whether they died at that point.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)