How do i make a player spawn at hospital after death
#1

Ive been trying to figure this out for awhile, i have a RP server and in it every time a player dies they eather spawn where they died or where they where on the last login. So if anyone can help me out i would really appreciate it. Thanks
Reply
#2

Make a global variable
pawn Код:
new playerDied[MAX_PLAYERS]
Then in under
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
put this:
pawn Код:
playerDied[playerid] = 1;
Then lastly under
pawn Код:
public OnPlayerSpawn(playerid)
put this:
pawn Код:
if(playerDied[playerid])
{
    SetPlayerPos(playerid, hospitalX, hospitalY, hospitalZ); //replace with actual coordinates
}
Cheers
Reply
#3

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Make a global variable
pawn Код:
new playerDied[MAX_PLAYERS]
Then in under
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
put this:
pawn Код:
playerDied[playerid] = 1;
Then lastly under
pawn Код:
public OnPlayerSpawn(playerid)
put this:
pawn Код:
if(playerDied[playerid])
{
    SetPlayerPos(playerid, hospitalX, hospitalY, hospitalZ); //replace with actual coordinates
}
ive had this problem in the past, my pawno always crashes when i try to compile with these lines
Reply
#4

Make sure you don't have duplicates of the publics
Reply
#5

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Make sure you don't have duplicates of the publics
i checked. there is no duplicates.
Reply
#6

i really gotta get this to work, its a major problem since its in a rp server
Reply
#7

Quote:
Originally Posted by Ben_Hatfield
Посмотреть сообщение
ive had this problem in the past, my pawno always crashes when i try to compile with these lines
You probly have messed up brackets
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)