SA-MP Forums Archive
[Tutorial] Headshot System! - 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Headshot System! (/showthread.php?tid=540342)

Pages: 1 2


Headshot System! - FloxX - 04.10.2014

Hello Everybody i want to show you code for Headshot system

Lets startt!!!!

One shot to the head to kill with sniper rifle
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        // One shot to the head to kill with sniper rifle
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
One Shot to the head to kill with all weapon
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount)
{
    if(issuerid != INVALID_PLAYER_ID )
    {
        // One Shot to the head to kill with all weapon
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
Question?
What Is Bodyparts ??
What Is Weaponid ??

Answer!!!!
Bodyparts - https://sampwiki.blast.hk/wiki/Body_Parts
Weaponid - https://sampwiki.blast.hk/wiki/Weapons



Find me
https://www.********.com/Vahnntech
Thank before ...


Re: Headshot System! - Rudy_ - 04.10.2014

lol.....
Best tutorial every


Re: Headshot System! - highstreetsrp - 04.10.2014

Seems Good +rep


Re: Headshot System! - YanLanger - 04.10.2014

Not explained at all.

1. Explain what does it does what does it mean when do i use it where i put it when i put it. etc..

Anyways edit it.


AW: Headshot System! - lcp9 - 07.10.2014

Best Tutorial i have ever seen


Re: Headshot System! - ReD_DeVi - 07.10.2014

Best tutorial


Re: Headshot System! - trapstar2020 - 07.10.2014

Quote:
Originally Posted by FloxX
Посмотреть сообщение
Hello Everybody i want to show you code for Headshot system

Lets startt!!!!

One shot to the head to kill with sniper rifle
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        // One shot to the head to kill with sniper rifle
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
One Shot to the head to kill with all weapon
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount)
{
    if(issuerid != INVALID_PLAYER_ID )
    {
        // One Shot to the head to kill with all weapon
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
Question?
What Is Bodyparts ??
What Is Weaponid ??

Answer!!!!
Bodyparts - https://sampwiki.blast.hk/wiki/Body_Parts
Weaponid - https://sampwiki.blast.hk/wiki/Weapons



Find me
https://www.********.com/Vahnntech
Thank before ...
So umm...... you made a tutorial about something you don't know about.... Waw! BTW u used two different callbacks but that's none of my business.... Wait you got questions you not suppose to have questions in tutorial that's what the scripting section is for isn't it :O....

please remove this Abomination


Re: Headshot System! - Sparke - 12.11.2014

This isnt very helpful and it's rip'd from SA-MP Wiki

lemme explain;

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) // Your simple call back for whenever a player takes damage
{ // Opening bracket
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) // This is getting the weapon id (For this case it's Weapon id 34) and it's getting the bodypart which is ID 9 (The head)
    {
        SetPlayerHealth(playerid, 0.0); // This just sets the players health down to 0
    }
    return 1;
} // Closing bracket



Re: Headshot System! - Glossy42O - 12.11.2014

Best tutorial i ever saw in my whole life

Even kalcor can't explain better...


Re: Headshot System! - Sparke - 12.11.2014

Quote:
Originally Posted by Stuun
Посмотреть сообщение
Best tutorial i ever saw in my whole life

Even kalcor can't explain better...
Word


Re: Headshot System! - Adarsh007 - 14.11.2014

Its Simple and Easy I was Looking for it but I am Facing a Error Undefined symbol bodypart.
I have Latest Includes and SAMP Version but still its shows me Error Even I have Latest Pawno.
https://sampforum.blast.hk/showthread.php?pid=3256305#pid3256305


Re: Headshot System! - Jakwob - 18.11.2014

nice tut thanks it helped me alot


Re: Headshot System! - Pravin - 20.11.2014

Quote:
Originally Posted by Adarsh007
View Post
Its Simple and Easy I was Looking for it but I am Facing a Error Undefined symbol bodypart.
I have Latest Includes and SAMP Version but still its shows me Error Even I have Latest Pawno.
https://sampforum.blast.hk/showthread.php?pid=3256305#pid3256305
You should pass the bodypart parameter in the function.


Re: Headshot System! - Arastair - 20.11.2014

Headshot, kinda interesting


Re: Headshot System! - Toxik - 20.11.2014

Easy Tut and good
5/5


Re: Headshot System! - LeXuZ - 20.11.2014

Seems good


Re: Headshot System! - Beckett - 20.11.2014

Thank you for this magnificent tutorial.


Re: Headshot System! - fahlevy - 21.12.2014

very nice ,tested . worked


Re: Headshot System! - Abagail - 22.12.2014

not a tutorial and stolen from the wiki


Re: Headshot System! - Cyber123 - 22.12.2014

Good system