make Filterscript only cops
#1

I do not know how this scrip can only use the police
Код:
#include <a_samp>

// Filterscript Settings

#define TAZE_WEAPON 23 // The weapon the tazer needs to be attached to.
#define TAZE_TIMER 8000 // The time needed to be spent until the criminal automatically gets up.
#define TAZE_SPARK 18717 // The objectid of the spark (It's recommended you don't change this...)
#define TAZE_DESTROY 1050 // The time needed to be spent until the spark dissappears.
#define TAZE_LOSEHP 0 // Set to 1 if you want the victim to lose health when shot. Set 0 or any
                                          // other value if you want the victim not to lose health.

//

new Tazer[MAX_PLAYERS];
new Spark[MAX_PLAYERS];
new Tazed[MAX_PLAYERS];

forward DestroySpark(playerid);
forward TazedRemove(playerid);

public OnFilterScriptInit()
{
        print("\n--------------------------------------");
        print(" Reachless' Tazer System v0.3");
        print("--------------------------------------\n");
        return 1;
}

public OnPlayerConnect(playerid)
{
        Tazed[playerid] = 0;
        Tazer[playerid] = 0;
        return 1;
}

public DestroySpark(playerid)
{
        DestroyObject(Spark[playerid]);
        return 1;
}

public TazedRemove(playerid)
{
        TogglePlayerControllable(playerid, 1);
        ClearAnimations(playerid);
        Tazed[playerid] = 0;
        return 1;
}

public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
        if(Tazer[playerid] == 1 && GetPlayerWeapon(playerid) == TAZE_WEAPON)
        {
            new Float:health,losehp;
            GetPlayerHealth(damagedid,health);
            losehp = TAZE_LOSEHP;
            if(Tazed[damagedid] == 1) return 1;
            new Float:x, Float:y, Float:z;
            GetPlayerPos(damagedid, x, y, z);
            ClearAnimations(damagedid);
            ApplyAnimation(damagedid,"PED","KO_skid_front",4.1,0,1,1,1,0);
            Spark[damagedid] = CreateObject(TAZE_SPARK, x, y, z-3, 0, 0, 0);
            SetTimerEx("DestroySpark", TAZE_DESTROY, 0, "i", damagedid);
            SetTimerEx("TazedRemove", TAZE_TIMER, 0, "i", damagedid);
            //TogglePlayerControllable(damagedid, 0);
            Tazed[damagedid] = 1;
            if(losehp) {} else SetPlayerHealth(damagedid, health+amount);
        }
        return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp("/on", cmdtext, true, 6) == 0)
        {
            GivePlayerWeapon(playerid, TAZE_WEAPON, 100);
            return 1;
        }
        if (strcmp("/off", cmdtext, true, 6) == 0)
        {
                new string[256];
                new sendername[MAX_PLAYER_NAME];
                GetPlayerName(playerid, sendername, sizeof(sendername));
                if(Tazer[playerid] == 0)
                {
                        if(GetPlayerWeapon(playerid) == TAZE_WEAPON) {} else return SendClientMessage(playerid, 0xFFFFFFFF, "{DC0C0C}Tazer: {FFFFFF}You need to attach the tazer to a Silenced Pistol.");
                        Tazer[playerid] = 1;
                        format(string, sizeof(string), "{DC0C0C}Tazer: {FFFFFF}Da Bat Chuc Nang Phong Dien, %s.", sendername);
                        SendClientMessage(playerid, 0xFFFFFFFF, string);
                        return 1;
                }
                else if(Tazer[playerid] == 1)
                {
                    Tazer[playerid] = 0;
                    format(string, sizeof(string), "{DC0C0C}Tazer: {FFFFFF}Da Tat Chuc Nang Phong Dien, %s.", sendername);
                    SendClientMessage(playerid, 0xFFFFFFFF, string);
                    return 1;
                }
                else Tazer[playerid] = 0;
                return 1;
        }
        return 0;
}
Reply
#2

You have to add:

if(PlayerInfo[playerid][pMember] == x)//x-organization number

This means, If player who use that command is in organization x (If police organization is 1 then change x to 1)
Reply
#3

Quote:
Originally Posted by kodiak
Посмотреть сообщение
You have to add:

if(PlayerInfo[playerid][pMember] == x)//x-organization number

This means, If player who use that command is in organization x (If police organization is 1 then change x to 1)
you can help me fix scrip use only for cops? . I'm newbie script help me
Reply
#4

Tell me, what gamemode you edit?
Reply
#5

tell what you need of ?
Reply
#6

i need help , how to make make Filterscript only police . thank u for help
Reply
#7

You need a function to verify the data from gamemode.

try CallRemoteFunction with a function like GetPlayerCop ( playerid ) and this function will return with Cop rank.. and if -1 or 0 is civilian.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)