OnPlayerDeath bug?
#1

Hey guys, usually when I encounter a problem I am able to search and find the answer. However, I have searched for a while on how to fix this and none of the search results have helped me My problem is that when a player is killed, he appears to remain alive or "stuck" on very low health. The player appears dead to the players around them but their body will be stuck on the ground. The following video demonstrates my problem.

[url=http://www.youtube.com/watch?v=FWpxUeEUjTQ]

Here's my OnPlayerDeath if that helps.

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
       SendDeathMessage(killerid, playerid, reason);
       return 1;
}
So what exactly is causing this problem? I'm grateful for any help and advice offered, thanks
Reply
#2

You sure it's not a filterscript? Also, debug it and see if the players health is actually 0.
Reply
#3

Do you use something that edits the weapon damage ? Cause I saw it on our server with the same bug.
Reply
#4

Are you saying a filterscript could be causing the issue? I did some tests without having any filterscripts loaded and I still have this problem. I'm sorry but could you explain further what you mean by this?
Quote:

Also, debug it and see if the players health is actually 0.

Quote:
Originally Posted by KnooL
Do you use something that edits the weapon damage ? Cause I saw it on our server with the same bug.
As far as I know, nope.
Reply
#5

Quote:
Originally Posted by Jason321
Are you saying a filterscript could be causing the issue? I did some tests without having any filterscripts loaded and I still have this problem. I'm sorry but could you explain further what you mean by this?
Quote:

Also, debug it and see if the players health is actually 0.

Quote:
Originally Posted by KnooL
Do you use something that edits the weapon damage ? Cause I saw it on our server with the same bug.
As far as I know, nope.
pawn Код:
Float:Health
GetPlayerHealth(playerid,health);
printf("[ID:%d] has %d health left on death",playerid,health);
I don't know if this works, I'm not a pro scripter though
Reply
#6

Quote:
Originally Posted by KnooL
pawn Код:
Float:Health
GetPlayerHealth(playerid,health);
printf("[ID:%d] has %d health left on death",playerid,health);
I don't know if this works, I'm not a pro scripter though
health is a float value, so you should use %f, not %d

pawn Код:
new
    Float:health;
GetPlayerHealth(playerid, health);
printf("[ID:%i] has %f health left on death", playerid, health);
Reply
#7

Quote:
Originally Posted by Jason321
Are you saying a filterscript could be causing the issue? I did some tests without having any filterscripts loaded and I still have this problem. I'm sorry but could you explain further what you mean by this?
Quote:

Also, debug it and see if the players health is actually 0.

Quote:
Originally Posted by KnooL
Do you use something that edits the weapon damage ? Cause I saw it on our server with the same bug.
As far as I know, nope.
pawn Код:
public OnGameModeInit()
{
  SetTimer("HealthCheck", 1000, true);
}

forward HealthCheck();

public HealthCheck()
{
  new Float:Health;
  for(new i; i<MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
     
      GetPlayerHealth(i, Health);
      printf("ID: %d Health: %f", i, Health);
    }
  }
  return 1;
}
That would be good for debugging the players health, just check the console.
Reply
#8

why not on playerdeath?
Reply
#9

Quote:
Originally Posted by KnooL
why not on playerdeath?
Because the player may not even be dead?
Reply
#10

Hey, thanks for all the comments and help guys, appreciate it so far. This is what the log tells me when the glitch occurs.

[16:39:30] ID: 1 Health: 1.000000
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)