28.06.2011, 13:58
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:
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
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 }
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