Need some help with an include
#1

Hi i have this include https://sampforum.blast.hk/showthread.php?tid=403713 and i got told to add this is my gamemode for it to work
pawn Код:
public OnPlayerHeadshot(issuerid,playerid,weaponid)
{
    if(GetPlayerWeapon(playerid) == 34) // 34 is the sniper ID
    {
        SetPlayerHealth(issuerid, 0.0);
        printf(" player %d has been shot by player %d" , playerid, issuerid);
    }
    if(GetPlayerWeapon(playerid) == 23) // 23 is the silenced ID
    {
        SetPlayerHealth(issuerid, 0.0);
        printf(" player %d has been shot by player %d" , playerid, issuerid);
    }
    return 1;
}
But when i try the headshot with sniper or Silenced it dosnt set health to 0.0 What am i doing wrong?
Reply
#2

Debug it. Is it being called?
Reply
#3

no i see now that its not being called. I dont see the print in the console
Reply
#4

Then the problem is with the include. Post in the include's topic.
Reply
#5

As MP2 said, it might be an include bug. However paste this and watch if the callback is working.

pawn Код:
public OnPlayerHeadshot(issuerid,playerid,weaponid)
{
    new temp_gun = GetPlayerWeapon(playerid);
    if(temp_gun == 34 || temp_gun == 23) // 34 is the sniper ID
    {
        SetPlayerHealth(issuerid, 0.0);
        printf(" player %d has been shot by player %d" , playerid, issuerid);
    }
    print(" Callback OnPlayerHeadshot has been called 2");
    return 1;
}
Reply
#6

Nothing is being called
Reply
#7

It might be sniper aiming, which has some coordinate problems while aiming.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)