Tazer not Working
#1

i dont know why its not working
pawn Код:
if(strcmp(cmd, "/tazer", true) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 ||  PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pMember] == 7)
            {
                new x_job[128];
                x_job = strtok(cmdtext, idx);
                if(!strlen(x_job))
                {
                    SendClientMessage(playerid, COLOR_GREY, "USAGE: /tazer [get/putaway]");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(TazerHolster[playerid] == 1)
                {
                    if(PlayerInfo[playerid][pGun2] == 24) PlayerHadDeagle[playerid] = 1;
                    GivePlayerGun(playerid, 23);
                    PlayerHasTazer[playerid] = 1;
                    TazerHolster[playerid] = 0;
                    format(string, sizeof(string), "* %s unholsters their tazer.", PlayerName(playerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else if(TazerHolster[playerid] == 0)
                {
                    if(PlayerHasTazer[playerid] == 0) return SendClientMessage(playerid,COLOR_GREY,"You don't have a tazer out!");
                    TakeWeapon(playerid, 23);
                    if(PlayerHadDeagle[playerid] == 1) GivePlayerGun(playerid, 24);
                    PlayerHasTazer[playerid] = 0;
                    PlayerHadDeagle[playerid] = 0;
                    TazerHolster[playerid] = 1;
                    format(string, sizeof(string), "* %s holsters their tazer back.", PlayerName(playerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not a member of the LSPD / SASD / SABI / DoC / SS !");
            }
        }
        return 1;
    }
pawn Код:
if(Keys & KEY_FIRE)
    {
        if(GetPlayerWeapon(playerid) == 23 && PlayerHasTazer[playerid] == 1)
        {
            for(new i; i<MAX_PLAYERS; i++)
            {
                if(IsPlayerAimingAtPlayer(playerid, i))
                {
                    if(i == playerid) return 1;
                    if(GetDistanceBetweenPlayers(playerid, i) < 8)
                    {
                        if(PlayerCuffed[i]) return 1;
                        if(IsACop(i)) return SendClientMessage(playerid, COLOR_GREY, "   Cannot Tazer Cops / SABI / SASD !");
                        if(IsPlayerInAnyVehicle(i)) return SendClientMessage(playerid, COLOR_GREY, "   Get the suspect out of the vehicle !");
                        if(TazerTime[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "   Please wait while your tazer recharges!");
                        new string[128];
                        TogglePlayerControllable(i, 0);
                        format(string, sizeof(string), "* You were Tazed by %s.", PlayerName(playerid));
                        SendClientMessage(i, COLOR_LIGHTBLUE, string);
                        if(PlayerInfo[i][pMask] == 1)
                        {
                            format(string, sizeof(string), "* Suspect tazed for 8 seconds.");
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            format(string, sizeof(string), "* %s fires their tazer, which connects to the suspect.", PlayerName(playerid));
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        }
                        else
                        {
                            format(string, sizeof(string), "* %s tazed for 8 seconds .",PlayerName(i));
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            format(string, sizeof(string), "* %s fires their tazer, which connects to %s, .", PlayerName(playerid),PlayerName(i));
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        }
                        SetTimerEx("TazerTimer", 8000, false, "i", playerid);
                        TazerTime[playerid] = 1;
                        GameTextForPlayer(i, "~r~Tazed", 2500, 3);
                        PlayerCuffed[i] = 1;
                        PlayerCuffedTime[i] = 8;
                        ApplyAnimation(i, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, " You are too far away from the suspect !");
                        return 1;
                    }
                }
            }
        }
     }
    return 1;
Reply
#2

When i shoot someone nothing happens, he only lose hp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)