SA-MP Forums Archive
[FilterScript] Hey... - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Hey... (/showthread.php?tid=381015)



Hey... - yarin0600 - 27.09.2012

Help me , I got filterscript of headshoot mod , Cna I choose one gun only can use in that on that mod ?



Код:
#include <a_samp>

/*-------------------------
HeadShot System by Peppe
The faster implementation of a headshot system in SA:MP.
This script requires the new version of SA:MP 0.3b.

www.pawnoitalia.forumfree.it
www.atlantisgaming.it
-------------------------*/

#define TIMER_INTERVAL 150

new
    maxPlayers;

public OnFilterScriptInit()
{
    maxPlayers = GetMaxPlayers();
    SetTimer("CheckHeadShot", TIMER_INTERVAL, 1);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPVarInt(playerid, "Headshotted") == 1)
    {
        SetPVarInt(playerid, "Headshotted", 0);
        GameTextForPlayer(playerid, "~r~Headshotted", 3000, 3);
        GameTextForPlayer(killerid, "~r~Headshott", 3000, 3);
    }
    return 1;
}

forward CheckHeadShot();
public CheckHeadShot()
{
    new
        index;
    for(new playerid; playerid < maxPlayers; playerid++)
    {
        if(IsPlayerConnected(playerid))
        {
	    index = GetPlayerAnimationIndex(playerid);
	    if(index == 1173 || index == 1175 || index == 1177 || index == 1178)
	    {
                SetPVarInt(playerid, "Headshotted", 1);
                SetPlayerHealth(playerid, 0);
            }
        }
    }
    return 1;
}



Re: Hey... - MechaTech - 28.09.2012

This is on the wrong section. Go here to ask for help.


Re: Hey... - sheders - 08.08.2013

...bad title and wrong section.