Players do not die.
#1

Hi,

when I try to kill people on my server with SetPlayerHealth(playerid, 0.0);
they do not necessarily die. Sometimes this even happens when they're
getting shot or are falling off a building or something.
To other players and to the server they seem to be death, but the affected
players can still walk around and are invisible to others. Their health bar
seems to be completely empty.

I can only think of the OnPlayerDeath callback as a possible reason for
this odd behavior so here it is:

Код:
473 public OnPlayerDeath (playerid, killerid, reason) {
474     // Remove all stuff
475     DeletePVar(playerid, "drugs");
476     DeletePVar(playerid, "mats");
477     DeletePVar(playerid, "menuopened");
478     DeletePVar(playerid, "inhouse");
479 
480     // Kill timers
481     KillTimer(GetPVarInt(playerid, "powercar"));
482     KillTimer(GetPVarInt(playerid, "househealtimer"));
483 
484 
485     // Save pos for hospital spawn
486     new Float:pposx, Float:pposy, Float: pposz;
487     GetPlayerPos(playerid, pposx, pposy, pposz);
488 
489     SetPVarFloat(playerid, "deathposx", pposx);
490     SetPVarFloat(playerid, "deathposy", pposy);
491     SetPVarFloat(playerid, "deathposz", pposz);
492 
493     SetPVarInt(playerid, "lastdeath", timestamp());
494 
495     SetPVarInt(playerid, "spawninhospital", 1);
496 
497     if(killerid != INVALID_PLAYER_ID && GetPVarInt(playerid, "team") != 4 && !GetPVarInt(playerid, "police_duty")) {
498         AddWanted(killerid, "Mord", 4, -1);
499     }
500 
501     return 1;
502 }
I would really appreciate if someone could tell me what I did wrong
here or whether it's a well known bug and under which circumstances
it appears and how I can prevent it from happening.

Thanks,
Blowfish
Reply
#2

Try SetPlayerHealth(playerid, -1); instead of 0. That should work if I understand your problem correctly.
Reply
#3

Yeah, I think you got me right, but I already tried that and it does not help.
Thanks anyway.
Reply
#4

it happens sometimes or always that ppl not die?
Reply
#5

It only happens sometimes.
Reply
#6

Try: Restart your server but without a command like /gmx or /restart. Nobody should be in your server kick all. (Now try to kill someone...ppl should die). Then restart your server with a command if u have one and a player should be online while restarting (Now try to kill someone... he/she wont die)

If its like i said then its "the death bug"... I know that from old times there is no solution for it till now
Reply
#7

Well... Following your orders made your prediction come true. That seems really strange o.O
So to work around the bug I will always need to restart the server without gmx?
That sucks, but thanks a lot, dude.
Reply
#8

Listen. You might use filterscripts or something. How I did this:
First use gmx.
Then quickly close your server and put it on.
This will restart your server fully without kicking them
Reply
#9

That's what I used to do. If you read GunFight's explanation carefully
you would have noticed that this seems to be the reason for the bug.
At least it occurs after restarting the server with gmx and killing the
process it after that and quickly starting it again.

Thanks anyway
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)