Command not closed correctly.
#1

pawn Код:
COMMAND:factionstor(playerid, params[])
{
    new string[128],sendername[MAX_PLAYER_NAME];
    if(IsPlayerInRangeOfPoint(playerid,5.0,2152.6980,-2270.7324,13.3088))
    {
        if(GetPVarInt(playerid, "Member") >= 8)
        {
            if(GetPlayerVirtualWorld(playerid) == GetPVarInt(playerid, "Member"))
            {
                if(FactionInfo[GetPVarInt(playerid, "Member")][fDrugs] >= 1 && FactionInfo[GetPVarInt(playerid, "Member")][fWep] >= 1)
                {
                    ShowPlayerDialog(playerid,141,DIALOG_STYLE_LIST,"Factory - Choice","Weaponary\nNarcotics","Choose", "Exit");
                }
                else
                {
                    new gunname[20], string2[256];
                    switch(FactionInfo[GetPVarInt(playerid, "Member")][fWep])
                    {
                        case 1:
                        {
                            for(new h = 0; h < sizeof(FactoryMenu); h++)
                            {
                                GetWeaponName(FactoryMenu[h][0], gunname, sizeof(gunname));
                                if(FactoryMenu[h][0] == 100) gunname="Kevlar";
                                if(h == 0)
                                {
                                    format(string2, 256, "%s - $%d", gunname, FactoryMenu[h][1]);
                                }
                                else
                                {
                                    format(string2, 256, "%s\n%s - $%d", string2, gunname, FactoryMenu[h][1]);
                                }
                            }
                            ShowPlayerDialog(playerid,106,DIALOG_STYLE_LIST,"Factory - Create Weapon",string2,"Create", "Exit");
                        }
                        case 2:
                        {
                            if(GetPVarInt(playerid, "Rank") != 6) return true;
                            for(new h = 0; h < sizeof(FactoryMenuEx); h++)
                            {
                                GetWeaponName(FactoryMenuEx[h][0], gunname, sizeof(gunname));
                                if(FactoryMenuEx[h][0] == 100) gunname="Kevlar";
                                if(h == 0)
                                {
                                    format(string2, 256, "%s - $%d", gunname, FactoryMenuEx[h][1]);
                                }
                                else
                                {
                                    format(string2, 256, "%s\n%s - $%d", string2, gunname, FactoryMenuEx[h][1]);
                                }
                            }
                            ShowPlayerDialog(playerid,134,DIALOG_STYLE_LIST,"Factory - Create Weapon",string2,"Create", "Exit");
                        }
                    }
                if(FactionInfo[GetPVarInt(playerid, "Member")][fDrugs] >= 1) ShowPlayerDialog(playerid,116,DIALOG_STYLE_LIST,"Factory - Drugs","Purchase Seeds $100\nPurchase Cocaine (INFO)\nCombine Crack (INFO)","Create", "Exit");
                return 1;
                }
            }
        }
    }
Whats exactly wrong here? I can't find it anywherre, its like the barracks aren't closed correctly, due I know the command aren't closing is because it gives me a error in a command which doesn't have any error at all, so when I remove /factionstor then the other one will work, so can anyone here help out?
Reply
#2

Well, the first brace right under COMMAND doesn't seem to match up with anything, so add one more at the very end.
Reply
#3

Command doesn't give errors now but doesn't show up IG.
Reply
#4

pawn Код:
COMMAND:factionstor(playerid, params[])
{
    new string[128],sendername[MAX_PLAYER_NAME];
    if(IsPlayerInRangeOfPoint(playerid,5.0,2152.6980,-2270.7324,13.3088))
    {
        if(GetPVarInt(playerid, "Member") >= 8)
        {
            if(GetPlayerVirtualWorld(playerid) == GetPVarInt(playerid, "Member"))
            {
                if(FactionInfo[GetPVarInt(playerid, "Member")][fDrugs] >= 1 && FactionInfo[GetPVarInt(playerid, "Member")][fWep] >= 1)
                {
                    ShowPlayerDialog(playerid,141,DIALOG_STYLE_LIST,"Factory - Choice","Weaponary\nNarcotics","Choose", "Exit");
                }
                else
                {
                    new gunname[20], string2[256];
                    switch(FactionInfo[GetPVarInt(playerid, "Member")][fWep])
                    {
                        case 1:
                        {
                            for(new h = 0; h < sizeof(FactoryMenu); h++)
                            {
                                GetWeaponName(FactoryMenu[h][0], gunname, sizeof(gunname));
                                if(FactoryMenu[h][0] == 100) gunname="Kevlar";
                                if(h == 0)
                                {
                                    format(string2, 256, "%s - $%d", gunname, FactoryMenu[h][1]);
                                }
                                else
                                {
                                    format(string2, 256, "%s\n%s - $%d", string2, gunname, FactoryMenu[h][1]);
                                }
                            }
                            ShowPlayerDialog(playerid,106,DIALOG_STYLE_LIST,"Factory - Create Weapon",string2,"Create", "Exit");
                        }
                        case 2:
                        {
                            if(GetPVarInt(playerid, "Rank") != 6) return true;
                            for(new h = 0; h < sizeof(FactoryMenuEx); h++)
                            {
                                GetWeaponName(FactoryMenuEx[h][0], gunname, sizeof(gunname));
                                if(FactoryMenuEx[h][0] == 100) gunname="Kevlar";
                                if(h == 0)
                                {
                                    format(string2, 256, "%s - $%d", gunname, FactoryMenuEx[h][1]);
                                }
                                else
                                {
                                    format(string2, 256, "%s\n%s - $%d", string2, gunname, FactoryMenuEx[h][1]);
                                }
                            }
                            ShowPlayerDialog(playerid,134,DIALOG_STYLE_LIST,"Factory - Create Weapon",string2,"Create", "Exit");
                        }
                    }
                }
                if(FactionInfo[GetPVarInt(playerid, "Member")][fDrugs] >= 1)
                {
                    ShowPlayerDialog(playerid,116,DIALOG_STYLE_LIST,"Factory - Drugs","Purchase Seeds $100\nPurchase Cocaine (INFO)\nCombine Crack (INFO)","Create", "Exit");
                }      
                return 1;
            }
        }
    }
Try this
Reply
#5

pawn Код:
COMMAND:factionstor(playerid, params[])
{
    new string[128],sendername[MAX_PLAYER_NAME];

    if(!IsPlayerInRangeOfPoint(playerid,5.0,2152.6980,-2270.7324,13.3088)) return 1;

    if(GetPVarInt(playerid, "Member") < 8) return 1;

    if(GetPlayerVirtualWorld(playerid) =! GetPVarInt(playerid, "Member")) return 1;

    if(FactionInfo[GetPVarInt(playerid, "Member")][fDrugs] >= 1 && FactionInfo[GetPVarInt(playerid, "Member")][fWep] >= 1)
    {
        ShowPlayerDialog(playerid,141,DIALOG_STYLE_LIST,"Factory - Choice","Weaponary\nNarcotics","Choose", "Exit");
        return 1;
    }

    new gunname[20], string2[256];
    switch(FactionInfo[GetPVarInt(playerid, "Member")][fWep])
    {
        case 1:
        {
            for(new h = 0; h < sizeof(FactoryMenu); h++)
            {
                GetWeaponName(FactoryMenu[h][0], gunname, sizeof(gunname));
                if(FactoryMenu[h][0] == 100) gunname="Kevlar";

                format(string2, 256, "%s\n%s - $%d", string2, gunname, FactoryMenu[h][1]);
            }

            ShowPlayerDialog(playerid,106,DIALOG_STYLE_LIST,"Factory - Create Weapon",string2,"Create", "Exit");
        }
        case 2:
        {
            if(GetPVarInt(playerid, "Rank") != 6) return 1;

            for(new h = 0; h < sizeof(FactoryMenuEx); h++)
            {
                GetWeaponName(FactoryMenuEx[h][0], gunname, sizeof(gunname));
                if(FactoryMenuEx[h][0] == 100) gunname="Kevlar";

                format(string2, 256, "%s\n%s - $%d", string2, gunname, FactoryMenuEx[h][1]);
            }

            ShowPlayerDialog(playerid,134,DIALOG_STYLE_LIST,"Factory - Create Weapon",string2,"Create", "Exit");
        }
    }

    if(FactionInfo[GetPVarInt(playerid, "Member")][fDrugs] >= 1)
    {
        ShowPlayerDialog(playerid,116,DIALOG_STYLE_LIST,"Factory - Drugs","Purchase Seeds $100\nPurchase Cocaine (INFO)\nCombine Crack (INFO)","Create", "Exit");
        return 1;
    }

    return 1;
}
A little bit more readable (shorter as well) and a few optimizations.
Reply
#6

I'll test it tommorow guys, thanks for the help.

I'll rep if it works ofcourse!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)