[Tutorial] Headshot System!
#1

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 ...
Reply
#2

lol.....
Best tutorial every
Reply
#3

Seems Good +rep
Reply
#4

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.
Reply
#5

Best Tutorial i have ever seen
Reply
#6

Best tutorial
Reply
#7

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
Reply
#8

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
Reply
#9

Best tutorial i ever saw in my whole life

Even kalcor can't explain better...
Reply
#10

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

Even kalcor can't explain better...
Word
Reply
#11

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
Reply
#12

nice tut thanks it helped me alot
Reply
#13

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.
Reply
#14

Headshot, kinda interesting
Reply
#15

Easy Tut and good
5/5
Reply
#16

Seems good
Reply
#17

Thank you for this magnificent tutorial.
Reply
#18

very nice ,tested . worked
Reply
#19

not a tutorial and stolen from the wiki
Reply
#20

Good system
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)