SA-MP Forums Archive
Need some help with an include - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need some help with an include (/showthread.php?tid=421208)



Need some help with an include - Don_Cage - 08.03.2013

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?


Re: Need some help with an include - MP2 - 08.03.2013

Debug it. Is it being called?


Re: Need some help with an include - Don_Cage - 08.03.2013

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


Re: Need some help with an include - MP2 - 08.03.2013

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


Re: Need some help with an include - TheArcher - 08.03.2013

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;
}



Re: Need some help with an include - Don_Cage - 08.03.2013

Nothing is being called


Re: Need some help with an include - TheArcher - 09.03.2013

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