Very frustrating OnPlayerDeath bug
#1

Ok, so first, this bug's not happening always, but is pissing me off as hell. When i die it won't call the "OnPlayerDeath" function. More exactly, let's say i'm falling from Killiad or from some high building. When i touch the ground, i wont't see me dying, just the others will. I will se myself up and i'll can move, but can't do anything else like enter a car or something.

If someone have clues about what i am talking post here please. Thanks in advance.
Reply
#2

Show us what is under OnPlayerDeath, its not bugged, it has something to do with your code or if this isnt your localhost server then you might were lagging or bugged.

I hope that I helped you!.
Reply
#3

I'm 100% sure that it is not from my "OnPlayerDeath" because i used to have this bug from the very first time i started scripting. I mean, the callback was empty, just "return 1;" and sometimes it would still do that.

I read on the forum and it seems that fixes.inc may cause this bug. So i commented out the "FIX_ONPLAYERDEATH" part (all of it) and the bug is still there. It just don't even call the function because if i put SCM(plid, -1, "blabla"); it won't show me that. I checked my whole .pwn and i still couldn't find something that could cause this bug... OnPlayerGiveDamage and OnPlayerTakeDamage are also empty just return 1.
I don't think that this might be a host problem because it appears on localhost and on another 2 hosted locations too.
Reply
#4

You might be using an include that hooks OnPlayerDeath. Check each of your includes.
Reply
#5

Those are my includes:
pawn Код:
#include <a_samp> // This contains "OnPlayerDeath"
#include <fixes> // Commented the whole "OnPlayerDeath" from here
#include <a_mysql>
#include <foreach>
#include <zcmd>
#include <a_npc> //This contains "OnPlayerDeath"
//#include <uf>
#include <utils>
#include <k_functions>
#include <sscanf2>
#include <streamer>
#include <numbers>
#include <string>
#include <OPMC>
#include <A_BanSys>
#include <timerfix>
#include <playerpause>
Sometimes it calls the function but u just stay there and not shows you that you died...
Reply
#6

Ok. I improvised something by doing:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
      ApplyAnimation(playerid,"PED","KO_skid_front",4.0,0,1,1,1,0);
      SetTimerEx("killplayer", 3000, false, "d", playerid);
      return 1;
}

public killplayer(playerid)
{
    SetPlayerHealth(playerid, 100.0);
    return 1;
}
I observed that if i modify my health positively after that bug happens, it directly respawns me.
But still i'm not very pleased because it won't function by default, without my help .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)