BREAKING NEWS

Welcome to File Townz | A TOWN Where you find all Files !

Search

Monday, 12 September 2016

How to make simple Headshot system

How to make simple 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




Share this:

Post a Comment

 
Copyright © 2014 Filetownz. Designed by OddThemes | Distributed By Gooyaabi Templates