Taser/Beanbag system problem
#1

I had a full-working taser system, and that always worked.
So i made a beanbag system, i just copied the taser system and changed all the values to beanbag values instead, and defined them and all the other stuff that the taser has.

The problem is, only one of them works, first the taser system worked, but beanbag didn't, where the taser system was above the beanbag system under OnPlayerShootPlayer.
I tried switching them around, so the beanbag system is above, but then the beanbag system works, but the taser doesn't.
So i'm quite confused as to why this is, here's the OnPlayerShootPlayer taser/beanbag scripting:

pawn Код:
if(IsAPDFBIHGGOV(Shooter))
    {
        if(Beanbag[Shooter])
        {
            if(GetPlayerWeapon(Shooter) == 25)
            {
                if(!IsPlayerBeanbagged(Target) && !IsPlayerCuffed(Target) && !IsPlayerTied(Target))
                {
                    new Float:HP, Float:Armor;
                    GetPlayerHealth(Target, HP);
                    GetPlayerArmour(Target, Armor);
                    SetPlayerHealth(Target, HealthLost+HP);
                    SetPlayerArmour(Target, ArmourLost+Armor);
                    if(!IsPlayerNearPlayer(Shooter, Target, 12)) return SendClientMessage(Shooter, COLOR_GREY, "The target was too far away for the beanbag to hit.");
                    // Got Beanbagged
                    format(string, sizeof(string), "* %s was hit by a beanbag round and falls to the ground in pain.", RPN(Target));
                    SendNearbyMessage(Shooter, 12, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                    GameTextForPlayer(Target, "~r~Beanbagged", 3500, 3);
                    // Custom Freeze
                    ApplyAnimation(Target,"PED","KO_shot_stom",4.0,0,1,1,1,0);
                    TogglePlayerControllable(Target, 0);
                    // Beanbagged Detecting
                    TogglePlayerBeanbagged(Target, 1);
                    // Beanbag Timeout
                    BeanbagTimeout[Target] = 11;
                    BeanbagCountDown[Target] = SetTimerEx("BeanbagTimer", 1500, true, "d", Target);
                }

            }
        }
    }
    return 1;
    if(IsAPDFBIHGGOV(Shooter))
    {
        if(Tazer[Shooter])
        {
            if(GetPlayerWeapon(Shooter) == 23)
            {
                if(!IsPlayerTazed(Target) && !IsPlayerCuffed(Target) && !IsPlayerTied(Target))
                {
                    new Float:HP, Float:Armor;
                    GetPlayerHealth(Target, HP);
                    GetPlayerArmour(Target, Armor);
                    SetPlayerHealth(Target, HealthLost+HP);
                    SetPlayerArmour(Target, ArmourLost+Armor);
                    if(!IsPlayerNearPlayer(Shooter, Target, 12)) return SendClientMessage(Shooter, COLOR_GREY, "The target was too far away for the taser to hit.");
                    // Got Tazed
                    format(string, sizeof(string), "* %s was hit by a taser and gets electrocuted.", RPN(Target));
                    SendNearbyMessage(Shooter, 30, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                    GameTextForPlayer(Target, "~r~Tased", 3500, 3);
                    // Custom Freeze
                    ApplyAnimation(Target,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
                    TogglePlayerControllable(Target, 0);
                    // Tazed Detecting
                    TogglePlayerTazed(Target, 1);
                    // Tazer Timeout
                    TazeTimeout[Target] = 11;
                    TazeCountDown[Target] = SetTimerEx("TazeTimer", 3000, true, "d", Target);
                }

            }
        }
    }
    return 1;
}
There's a sniper system just above the beanbag one though, but that works fine.
And yes, i've called the values "Tazer" instead of taser, i know, that's because i was too lazy to change them when i changed the name to Taser.
And yes, i've made commands for them, and defined them, so i really have no idea what's causing this.
Reply


Messages In This Thread
Taser/Beanbag system problem - by CalvinC - 26.11.2014, 15:34
Re: Taser/Beanbag system problem - by AlphaPac - 26.11.2014, 16:11
Re: Taser/Beanbag system problem - by CalvinC - 26.11.2014, 17:02
Re: Taser/Beanbag system problem - by Kelzano - 26.11.2014, 17:23
Re: Taser/Beanbag system problem - by CalvinC - 26.11.2014, 20:06

Forum Jump:


Users browsing this thread: 1 Guest(s)