SA-MP Forums Archive
Problem with Deathsystem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with Deathsystem (/showthread.php?tid=100590)



Problem with Deathsystem - Stas92 - 05.10.2009

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


Re: Problem with Deathsystem - Beaver07 - 05.10.2009

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


Re: Problem with Deathsystem - Stas92 - 05.10.2009

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


Re: Problem with Deathsystem - Jofi - 05.10.2009

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

SetPlayerWorldBounds...

?


Re: Problem with Deathsystem - Stas92 - 05.10.2009

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