SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 04/10/2014, 08:54 AM   #1
FloxX
Big Clucker
 
Join Date: Aug 2014
Posts: 54
Reputation: 1
Post Headshot System!

Hello Everybody i want to show you code for Headshot system

Lets startt!!!!

One shot to the head to kill with sniper rifle
Code:
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
Code:
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 - http://wiki.sa-mp.com/wiki/Body_Parts
Weaponid - http://wiki.sa-mp.com/wiki/Weapons



Find me
https://www.********.com/Vahnntech
Thank before ...
FloxX is offline   Reply With Quote
Old 04/10/2014, 08:59 AM   #2
Rudy_
High-roller
 
Rudy_'s Avatar
 
Join Date: Nov 2011
Location: Pakistan
Posts: 1,357
Reputation: 230
Default Re: Headshot System!

lol.....
Best tutorial every
__________________
And now my Watch has Ended.


[Tutorial]
[TuT]How to create a car shooting Neon

[Filterscript]
Neon Vehicle Laser


__________________________________________________
Rudy_ is offline   Reply With Quote
Old 04/10/2014, 09:09 AM   #3
highstreetsrp
Banned
 
Join Date: Apr 2014
Posts: 114
Reputation: 12
Default Re: Headshot System!

Seems Good +rep
highstreetsrp is offline   Reply With Quote
Old 04/10/2014, 09:13 AM   #4
YanLanger
Banned
 
Join Date: Sep 2013
Location: Idk.. forgot
Posts: 552
Reputation: 22
Default Re: Headshot System!

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.
YanLanger is offline   Reply With Quote
Old 07/10/2014, 08:42 AM   #5
lcp9
Little Clucker
 
Join Date: Feb 2013
Posts: 29
Reputation: 1
Default AW: Headshot System!

Best Tutorial i have ever seen
lcp9 is offline   Reply With Quote
Old 07/10/2014, 08:47 AM   #6
ReD_DeVi
Banned
 
Join Date: Aug 2012
Location: In Bed Room
Posts: 519
Reputation: 34
Default Re: Headshot System!

Best tutorial
ReD_DeVi is offline   Reply With Quote
Old 07/10/2014, 08:52 AM   #7
trapstar2020
Huge Clucker
 
trapstar2020's Avatar
 
Join Date: Oct 2010
Location: Pawno.exe
Posts: 384
Reputation: 17
Default Re: Headshot System!

Quote:
Originally Posted by FloxX View Post
Hello Everybody i want to show you code for Headshot system

Lets startt!!!!

One shot to the head to kill with sniper rifle
Code:
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
Code:
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 - http://wiki.sa-mp.com/wiki/Body_Parts
Weaponid - http://wiki.sa-mp.com/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
__________________
PM For help with anything
trapstar2020 is offline   Reply With Quote
Old 12/11/2014, 05:15 AM   #8
Sparke
Banned
 
Join Date: Sep 2014
Location: USA
Posts: 107
Reputation: 23
Default Re: Headshot System!

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

lemme explain;

pawn Code:
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
Sparke is offline   Reply With Quote
Old 12/11/2014, 05:16 AM   #9
Glossy42O
High-roller
 
Join Date: Oct 2014
Location: in my house
Posts: 1,733
Reputation: 231
Default Re: Headshot System!

Best tutorial i ever saw in my whole life

Even kalcor can't explain better...
Glossy42O is offline   Reply With Quote
Old 12/11/2014, 05:18 AM   #10
Sparke
Banned
 
Join Date: Sep 2014
Location: USA
Posts: 107
Reputation: 23
Default Re: Headshot System!

Quote:
Originally Posted by Stuun View Post
Best tutorial i ever saw in my whole life

Even kalcor can't explain better...
Word
Sparke is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Easy System Headshot lucotaku1 Filterscripts 12 17/10/2014 12:13 PM
HeadShot system NeyMar96 Scripting Help 1 18/09/2011 05:07 PM
HeadShot system NeyMar96 Scripting Help 5 29/08/2011 08:59 PM
HeadShot system NeyMar96 Help Archive 1 07/08/2011 01:17 AM


All times are GMT. The time now is 06:08 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.