SA-MP Forums Archive
Spawn HP bug - 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)
+--- Thread: Spawn HP bug (/showthread.php?tid=370890)



Spawn HP bug - KubiPL - 21.08.2012

Hello,

I have bug in my GM and i didn't know where is it.
When player spawn, he die.

I set the HP to 100 and same.

In callback login: HP = 100.
In callback OnPlayerSpawn: HP = 0.

What is wrong?


Re: Spawn HP bug - Akira297 - 21.08.2012

You've it set to kill the player on

OnPlayerSpawn -

Make it OnplayerSpawn HP =100 lol, replace the "0" and make it "100"



Re: Spawn HP bug - Lordzy - 21.08.2012

There might be like this on your spawn
pawn Код:
public OnPlayerSpawn(playerid)
{
   SetPlayerHealth(playerid,0);//Player's health sets to 0,so the player dies.
   return 1;
}
Change it to this :
pawn Код:
public OnPlayerSpawn(playerid)
{
   SetPlayerHealth(playerid,100.00);//Player's health becomes full here.
   return 1;
}



Re: Spawn HP bug - KubiPL - 21.08.2012

OnPlayerSpawn:

GivePlayerHealthEx(playerid, PlayerInfo[playerid][health], true);

PlayerInfo[playerid][health] is 100. And it give 0.

Any idea?