dimanche 17 juillet 2016

Cmd not working properly

Hello, this command worked perfectly untill i added the text "There's nothing close enough to grab."

what is wrong, i dont see anything..

Code:

        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;
    }

Let's block ads! (Why?)



Cmd not working properly

Aucun commentaire:

Enregistrer un commentaire