PDA

View Full Version : have 0 hp, health bar blinking, but i cant die (respawn)


Saddin
12/04/2016, 02:11 PM
When i die sometimes (have 0 hp) health bar is blinking (showing/not showing) and i can walk, jump... do whatever. Im dead but i can do anything.

But when i jump from bigger height i make that death animation and respawn normally. It happens sometimes, but sometimes i continue to move even if i have 0 hp.

image:

http://i.imgur.com/Wpn1Tzq.png

NaS
12/04/2016, 02:22 PM
That can be reproduced when you set a player's health to anything above 0 while in death animation or when you die by fire.
Check if you set the health anywhere when possibly dead, maybe in OnPlayerTakeDamage or similar?

But there may be other causes too, which I don't know about.

Godey
12/04/2016, 02:25 PM
According to this topic: http://forum.sa-mp.com/showthread.php?t=206343
@wups says use:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate== PLAYER_STATE_WASTED) return 1;
}Why not try it? :)

Saddin
12/04/2016, 02:33 PM
Here is OnPlayerTakeDamage... i only put when hitman headshot you with sniper, and check for when you are admin on duty and if someone is shooting at you, he will get 999.. health...


public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(AdminDuty[playerid] == 1){SetPlayerHealth(playerid, 9999);}//DUTY HP REGENERATE
if(PlayerInfo[issuerid][pMember] == 6){if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9){SetPlayerHealth(playerid, 0.0); SetPlayerArmour(playerid, 0.0);}}//HITMAN HS SYSTEM
}
return 1;
}


I dont know what is this glitch


@Godey, i just put this line: if(newstate== PLAYER_STATE_WASTED) return 1;

and it might work?

Godey
12/04/2016, 02:36 PM
I haven't tested it, so I'm not saying it will work 100%
According to that, it will. So why not just try? :)

NaS
12/04/2016, 02:38 PM
Here is OnPlayerTakeDamage... i only put when hitman headshot you with sniper, and check for when you are admin on duty and if someone is shooting at you, he will get 999.. health...


public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(AdminDuty[playerid] == 1){SetPlayerHealth(playerid, 9999);}//DUTY HP REGENERATE
if(PlayerInfo[issuerid][pMember] == 6){if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9){SetPlayerHealth(playerid, 0.0); SetPlayerArmour(playerid, 0.0);}}//HITMAN HS SYSTEM
}
return 1;
}


I dont know what is this glitch


@Godey, i just put this line: if(newstate== PLAYER_STATE_WASTED) return 1;

and it might work?

Did any of the above conditions meet when you encountered the bug?

I mean, were you on admin duty while someone else killed you? In case you suicided OnPlayerTakeDamage did not cause it.

Godey's suggestion is a good idea though, if you have any code in OnPlayerKeyState that could be executed when dying you should add the line he suggested at the beginning of the callback.

Saddin
12/04/2016, 02:55 PM
I went now onduty as admin, and /kill myself and it set me like this, death with 0hp but can walk (alive)

when i kill somebody else on duty, he die normally

when i kill myself for example /kill i can walk, when i turn off duty, i respawn normally, now i will try removing this onplayertakedamage.. with adminduty this stuff and test it