Problem with Deathsystem
#1

Hey Guys,

I want to make my player goes to the hospital after the death. Sometimes he gets the CJ skin and respawn on the pos. where he dies and sometimes there comes a text: Stay within the worldbounderies.

Can sb. help me to debug that?

http://pastebin.com/f14c27282

Edit: Problem since update to 0.3
Reply
#2

i havent looked at your code properly but the answer is quite simple

Код:
new Death[MAX_PLAYERS]; // Top of the script

public OnPlayerConnect(playerid)
{

Death[playerid] = 0; // make sure the death id is 0 on connect
}

public OnPlayerDeath(playerid)
{

Death[playerid] = 1; // set the player's id to dead
}

public OnPlayerSpawn(playerid)
{

if (Death[playerid] == 1)
{
  // spawn them at the hospital
  Death[playerid] = 0; // reset the value for the next death
}
}
hope this helps
Reply
#3

Yes, I have it allready this way ... but there is that bug, which I descripted in first post.
Reply
#4

Quote:
Originally Posted by Stas92
Stay within the worldbounderies.
Maybe you have

SetPlayerWorldBounds...

?
Reply
#5

No. And don't know why that error comes.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)