Can you help me fix these errors?
#1

pawn Код:
if(strcmp(usage, "create", true) == 0)  //error 035: argument type mismatch (argument 1)

if(sscanf(usage, "zd", apb, slot)) //error 035: argument type mismatch (argument 1)

format(apb, sizeof(apb), "%s", apb); // error 035: argument type mismatch (argument 1)

else if(strcmp(usage, "details", true) == 0) // argument type mismatch (argument 1)
           
if(sscanf(usage, "d", slot)) // error 035: argument type mismatch (argument 1)
pawn Код:
command(apb, playerid, params[])
{
    new string[128], usage;
    if(sscanf(params, "z", 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, apb;
                if(sscanf(usage, "zd", 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;
}
FULL CODE

ERRORS:
Quote:

C:\Users\USER\Downloads\NSRP\gamemodes\VortexRolep lay.pwn(1415 : error 035: argument type mismatch (argument 1)
C:\Users\USER\Downloads\NSRP\gamemodes\VortexRolep lay.pwn(14161) : error 035: argument type mismatch (argument 1)
C:\Users\USER\Downloads\NSRP\gamemodes\VortexRolep lay.pwn(14169) : error 035: argument type mismatch (argument 1)
C:\Users\USER\Downloads\NSRP\gamemodes\VortexRolep lay.pwn(14169) : error 035: argument type mismatch (argument 1)
C:\Users\USER\Downloads\NSRP\gamemodes\VortexRolep lay.pwn(14172) : error 035: argument type mismatch (argument 1)
C:\Users\USER\Downloads\NSRP\gamemodes\VortexRolep lay.pwn(14175) : error 035: argument type mismatch (argument 1)
C:\Users\USER\Downloads\NSRP\gamemodes\VortexRolep lay.pwn(14183) : error 017: undefined symbol "apb"
C:\Users\USER\Downloads\NSRP\gamemodes\VortexRolep lay.pwn(30886) : warning 203: symbol is never used: "Plates"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


7 Errors.

Reply
#2

Could you comment each line with an error just add a // onto the end of then please.
Reply
#3

Updated, pleasee.
Reply
#4

pawn Код:
command(apb, playerid, params[])
{
    new string[128], usage[128];
    if(sscanf(params, "s[128]", 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, apb;
                if(sscanf(usage, "zd", apb, slot))
                {
                    SendClientMessage(playerid, GREY, "USAGE: /apb create [apb] [slot]");
                    return 1;
                }
                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
#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


Forum Jump:


Users browsing this thread: 3 Guest(s)