Cmd not working properly
#1

Hello, this command worked perfectly untill i added the text "There's nothing close enough to grab."
now i can only pickup the first weapon that is dropped to the ground
what is wrong, i dont see anything..

pawn Код:
if(strcmp(cmd, "/pickgun", true) == 0 || strcmp(cmd, "/pick", true) == 0)
    {
        if(MedicBill[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_GREY, " You have no access to grab items at your health.");
            return 1;
        }
        if(IsPlayerInAnyVehicle(playerid)){ SendClientMessage(playerid, COLOR_GRAD1, "You can't grab anything right now.");return 1;}
        for(new i = 0; i < sizeof(DropInfo); i++)
        {
            if (PlayerToPoint(0.6,playerid,DropInfo[i][dx],DropInfo[i][dy],DropInfo[i][dz])) // 0.6
            {
                if(GetPlayerVirtualWorld(playerid) == DropInfo[i][dWorld])
                {
                    if(DropInfo[i][dType] == 1) // Weapons
                    {
                        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
                        SetTimerEx("gunpick", 3000, 0, "i", playerid);
                        format(string, sizeof(string), "You kneel down to pick up a weapon.");
                        SendClientMessage(playerid, COLOR_GREY, string);
                        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
                        format(string,sizeof(string),"* %s kneels down to pick up something on the ground.",MaskOnOff(playerid));
                        ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        return 1;
                    }
                    if(DropInfo[i][dType] == 2) // Crack
                    {
                        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
                        SetTimerEx("crackpick", 3000, 0, "i", playerid);
                        format(string, sizeof(string), "You kneel down to pick up some crack.");
                        SendClientMessage(playerid, COLOR_GREY, string);
                        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
                        format(string,sizeof(string),"* %s kneels down to pick up something on the ground.",MaskOnOff(playerid));
                        ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        return 1;
                    }
                    if(DropInfo[i][dType] == 3) // Pot
                    {
                        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
                        SetTimerEx("potpick", 3000, 0, "i", playerid);
                        format(string, sizeof(string), "You kneel down to pick up some pot.");
                        SendClientMessage(playerid, COLOR_GREY, string);
                        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
                        format(string,sizeof(string),"* %s kneels down to pick up something on the ground.",MaskOnOff(playerid));
                        ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        return 1;
                    }
                    if(DropInfo[i][dType] == 4) // Mats A
                    {
                        ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
                        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
                        format(string,sizeof(string),"* %s picks up %d A materials.",MaskOnOff(playerid),DropInfo[i][dAmount]);
                        ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        PlayerInfo[playerid][pMats] += DropInfo[i][dAmount][0];
                        DropInfo[i][dAmount][0] = 0;
                        DropInfo[i][dType] = 0;
                        DestroyObject(DropObject[i]);
                        return 1;
                    }
                    if(DropInfo[i][dType] == 5) // Mats B
                    {
                        ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
                        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
                        format(string,sizeof(string),"* %s picks up %d B materials.",MaskOnOff(playerid),DropInfo[i][dAmount]);
                        ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        PlayerInfo[playerid][pMatsb] += DropInfo[i][dAmount][0];
                        DropInfo[i][dAmount][0] = 0;
                        DropInfo[i][dType] = 0;
                        DestroyObject(DropObject[i]);
                        return 1;
                    }
                    if(DropInfo[i][dType] == 6) // Mats C
                    {
                        ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
                        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
                        format(string,sizeof(string),"* %s picks up %d C materials.",MaskOnOff(playerid),DropInfo[i][dAmount]);
                        ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        PlayerInfo[playerid][pMatsc] += DropInfo[i][dAmount][0];
                        DropInfo[i][dAmount][0] = 0;
                        DropInfo[i][dType] = 0;
                        DestroyObject(DropObject[i]);
                        return 1;
                    }
                    if(DropInfo[i][dType] == 7) //Money
                    {
                        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
                        SetTimerEx("moneypick", 3000, 0, "i", playerid);
                        format(string, sizeof(string), "You kneel down to pick up some money.");
                        SendClientMessage(playerid, COLOR_GREY, string);
                        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
                        format(string,sizeof(string),"* %s kneels down to pick up something on the ground.",MaskOnOff(playerid));
                        ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        return 1;
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "There's nothing close enough to grab.");
                return 1;
            }
        }
        return 1;
    }
Reply


Messages In This Thread
Cmd not working properly - by MayaEU - 17.07.2016, 15:10
Re: Cmd not working properly - by JXF - 17.07.2016, 21:44
Re: Cmd not working properly - by Stinged - 17.07.2016, 21:52
Re: Cmd not working properly - by MayaEU - 18.07.2016, 09:05
Re: Cmd not working properly - by MayaEU - 18.07.2016, 10:25
Re: Cmd not working properly - by MayaEU - 18.07.2016, 12:30
Re: Cmd not working properly - by MayaEU - 18.07.2016, 13:27
Re: Cmd not working properly - by GangstaSunny - 18.07.2016, 13:44
Re: Cmd not working properly - by MayaEU - 18.07.2016, 14:52

Forum Jump:


Users browsing this thread: 2 Guest(s)