Can you help me fix these errors?
#5

Spooky, there are still a few errors in your code.
pawn Код:
command(apb, playerid, params[])
{
    new string[128], usage[10], apb[100];
    if(sscanf(params, "s[10]", usage))
    {
        SendClientMessage(playerid, GREY, "USAGE: /apb [usage]");
        SendClientMessage(playerid, GREY, "USAGES: create, details");
    }
    else
    {
        if(Groups[Player[playerid][Group]][CommandTypes] == 1)
        {
            if(strcmp(usage, "create", true) == 0)
            {
                new slot;
                if(sscanf(usage, "s[100]d", apb, slot))
                {
                    SendClientMessage(playerid, GREY, "USAGE: /apb create [apb] [slot]");
                }
                else
                {
                    format(string, sizeof(string), "Officer %s just submitted an APB! (/apb details %d)", GetName(playerid), slot);
                    GroupMessage(playerid, RED, string);
                    format(apb, sizeof(apb), "%s", apb);
                }
            }
            else if(strcmp(usage, "details", true) == 0)
            {
                new slot;
                if(sscanf(usage, "d", slot))
                {
                    SendClientMessage(playerid, GREY, "USAGE: /apb details [slot]");
                }
                else
                {
                    format(string, sizeof(string), "|__________APB %d__________|", slot);
                    SendClientMessage(playerid, RED, string);
                    format(string, sizeof(string), "APB: %s", apb);
                    SendClientMessage(playerid, RED, string);
                }
            }
            else
            {
                SendClientMessage(playerid, GREEN, "Wrong APB usage");
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Can you help me fix these errors? - by Malcor - 14.01.2012, 03:43
Re: Can you help me fix these errors? - by Snowman12 - 14.01.2012, 03:47
Re: Can you help me fix these errors? - by Malcor - 14.01.2012, 04:12
Re: Can you help me fix these errors? - by Spooky - 14.01.2012, 05:01
Re: Can you help me fix these errors? - by Mean - 14.01.2012, 08:35

Forum Jump:


Users browsing this thread: 2 Guest(s)