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


Messages In This Thread
Players do not die. - by Blowfish - 28.06.2011, 13:58
Re: Players do not die. - by playbox12 - 28.06.2011, 14:29
AW: Players do not die. - by Blowfish - 28.06.2011, 14:35
Re: Players do not die. - by GunFight - 28.06.2011, 14:39
AW: Players do not die. - by Blowfish - 28.06.2011, 14:45
Re: Players do not die. - by GunFight - 28.06.2011, 14:49
AW: Players do not die. - by Blowfish - 28.06.2011, 22:18
Re: Players do not die. - by bartje01 - 28.06.2011, 23:09
AW: Players do not die. - by Blowfish - 28.06.2011, 23:13

Forum Jump:


Users browsing this thread: 1 Guest(s)