I going to change tazer system to /tazer
#1

Please help me change tazer system.
This system is in Mouse scroll wheel, but i gonna change it to /tazer.. someone help me please

This is all "tazer" features.. please help

pawn Код:
forward UnTaze(playerid);
new tazed[MAX_PLAYERS];

    if(newkeys & KEY_LOOK_BEHIND && IsPlayerENF(playerid) && !IsPlayerInAnyVehicle(playerid) && PlayerTemp[playerid][isevent] == 0)
    {
        if(GetPVarInt(playerid, "Tazer") == 1)
        {
            //GivePlayerWeapon(playerid, 24, GetPVarInt(playerid, "Tazer"));
            SetPVarInt(playerid, "Tazer", 0);
            RemovePlayerAttachedObject(playerid, 0);
            Action(playerid, "puts his taser back into his belt.");
            return 1;
        }

        SetPVarInt(playerid, "Tazer", 1);
        SetPlayerAttachedObject(playerid, 0, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0);
        //GivePlayerWeapon(playerid, 23, 10);
        Action(playerid, "takes his taser out of his belt.");
        return 1;
    }

    if(newkeys & KEY_FIRE && newkeys & KEY_HANDBRAKE)
    {
        if(!IsPlayerInAnyVehicle(playerid) && GetPlayerWeapon(playerid) == 41)
        {
            new Float:fp[4];
            PlayerLoop(q)
            {
                if(q == playerid) continue;
                GetPlayerPos(q, fp[0], fp[1], fp[2]);
                if(IsPlayerAimingAt(playerid, fp[0], fp[1], fp[2], 0.9) && GetDistanceBetweenPlayers(playerid, q) < 4 && tazed[q] == 0)
                {
                    RedScreen(q, minrand(5,15));
                    return 1;
                }
            }
        }
        if(!IsPlayerInAnyVehicle(playerid) && GetPVarInt(playerid, "Tazer") == 1 && IsPlayerENF(playerid) && !RecentlyShot[playerid] || !IsPlayerInAnyVehicle(playerid) && GetPlayerWeapon(playerid) == 23 && PlayerInfo[playerid][power] >= 11)
        {
            RecentlyShot[playerid] = 1;
            SetTimerEx("AntiSpam", 1000, false, "d", playerid);
            new Float:fp[4];
            PlayerLoop(q)
            {
                if(q == playerid) continue;
                GetPlayerPos(q, fp[0], fp[1], fp[2]);
                if(IsPlayerAimingAt(playerid, fp[0], fp[1], fp[2], 0.9) && GetDistanceBetweenPlayers(playerid, q) < 5 && tazed[q] == 0 && !IsPlayerInAnyVehicle(q))
                {
                    ApplyAnimation(playerid,"KNIFE","knife_3",4.1,0,1,1,0,0,1);
                    new tazemsg[ 128 ], wat[MAX_PLAYER_NAME];
                    if(PlayerTemp[q][hname]==1) myStrcpy(wat,"Stranger"); else myStrcpy(wat,RPName(q));
                    if(PlayerInfo[playerid][playerteam]==COPS) format(tazemsg,sizeof(tazemsg),"[SAPD] %s has been tazed by %s",wat,RPName(playerid));
                    else if(PlayerInfo[playerid][playerteam]==SASF) format(tazemsg,sizeof(tazemsg),"[SASF] %s has been tazed by %s",wat,RPName(playerid));
                    else format(tazemsg,sizeof(tazemsg),"[FBI] %s has been tazed by %s",wat,RPName(playerid));
                    NearMessage(playerid,tazemsg,COLOR_ME);
                    tazed[ q ] = 1;
                    TogglePlayerControllable(q,false);
                    SetTimerEx("UnTaze",20000,0,"i",q);
                    SetPlayerDrunkLevel(q, GetPlayerDrunkLevel(playerid)+4300);
                    ApplyAnimation(q,"CRACK", "crckdeth2", 4.1, 0, 0, 0, 1, 1); // irl crack!
                    new string[ 128 ];
                    format(string, sizeof(string), "6{TAZE} %s[%d] has been tazed by %s[%d]",PlayerName(q),q, PlayerName(playerid), playerid);
                    iEcho(string);
                    return 1;
                }
            }
        }
        return 1;
    }


tazed[playerid] = 0;
    if(IsPlayerConnected(playerid))
    {
        if(GetPVarInt(playerid, "Tazer") && GetPlayerWeapon(playerid))
        {
            SendClientInfo(playerid, "You cannot hold a weapon while having the taser in your hand.");
            SetPlayerArmedWeapon(playerid, 0);
            return 1;
        }
        if(IsPlayerInAnyVehicle(playerid))
        {
            for(new i; i < sizeof(Spikes); i++)
            {
                if(IsPlayerInRangeOfPoint(playerid, 5.0, Spikes[i][sX], Spikes[i][sY], Spikes[i][sZ]) && Spikes[i][sX] != 0)
                {
                    new tires, panels, doors, lights;
                    GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
                    tires = encode_tires(1,1,1,1); // damage all tires
                    UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
                }
            }
        }
    }
    return 1;


SetPVarInt(playerid, "Tazer", 0);
public UnTaze(playerid)
{
    if(cuffed[ playerid ]==0 && tazed[ playerid ] == 1)
    {
        TogglePlayerControllable(playerid, true);
        tazed[ playerid ]=0;
    }
}
Reply
#2

Here ya go ;P

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/tazer", cmdtext))PlayerTemp[playerid][isevent] == 0)
    {
        if(GetPVarInt(playerid, "Tazer") == 1)
        {
            //GivePlayerWeapon(playerid, 24, GetPVarInt(playerid, "Tazer"));
            SetPVarInt(playerid, "Tazer", 0);
            RemovePlayerAttachedObject(playerid, 0);
            Action(playerid, "puts his taser back into his belt.");
            return 1;
        }

        SetPVarInt(playerid, "Tazer", 1);
        SetPlayerAttachedObject(playerid, 0, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0);
        //GivePlayerWeapon(playerid, 23, 10);
        Action(playerid, "takes his taser out of his belt.");
        return 1;
    }
Reply
#3

only it?

but i'm use zcmd .
Reply
#4

If im correct yes.
Reply
#5

If I understood you right, you wish to change the CMD itself..?
Than we don't need that code, give us the command.

Like, CMD:tazed(playerid, params[]) (In case you're using zcmd), search for that line.
Reply
#6

Quote:
Originally Posted by CesarLT
Посмотреть сообщение
If I understood you right, you wish to change the CMD itself..?
Than we don't need that code, give us the command.

Like, CMD:tazed(playerid, params[]) (In case you're using zcmd), search for that line.
He wanted to change the function from mouse wheel press to /tazer command
Reply
#7

Quote:
Originally Posted by Voxel
Посмотреть сообщение
He wanted to change the function from mouse wheel press to /tazer command
Yeah, I figured that out after I posted lol.
Reply
#8

i dont have that command, that why i need someone to change it..
Reply
#9

Код:
COMMAND:tazer(playerid, params[])
{
    if(GetPVarInt(playerid, "Tazer") == 1)
    {
        SetPVarInt(playerid, "Tazer", 0);
        RemovePlayerAttachedObject(playerid, 0);
        Action(playerid, "puts his taser back into his belt.");
        return 1;
    }
	SetPVarInt(playerid, "Tazer", 1);
    SetPlayerAttachedObject(playerid, 0, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0);
    Action(playerid, "takes his taser out of his belt.");
    return 1;
}
Reply
#10

How can i change the attachobject to silenced gun?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)