error 035: argument type mismatch (argument 3)
#1

some people said that i will use strcat so i used it, but it give's me warning i tried to fix it, but i cant

Error
pawn Код:
(10291) : error 035: argument type mismatch (argument 3)
(10292) : error 035: argument type mismatch (argument 3)
(10293) : error 035: argument type mismatch (argument 3)
(10295) : error 035: argument type mismatch (argument 3)
Line
pawn Код:
10292: strcat(string,"Army: %s", ArmyString);
10293: strcat(string, "CIA: %s", CIAString);
10294: strcat(string, "Regular Player: %s", RegularString);
10296: strcat(string, "Jailtime: %d", JailTimeString);
Command
pawn Код:
dcmd_stats(playerid,params[])
{
    #pragma unused params
    new string[256], JailTimeString[256], ArmyString[256], CIAString[256], RegularString[256];

    if(CanUseArmy[playerid] == 1337)
    {
        format(ArmyString, sizeof(ArmyString), "Yes");
    }
    else
    {
        format(ArmyString, sizeof(ArmyString), "No");
    }

    if(CanUseCIA[playerid] == 1337)
    {
        format(CIAString, sizeof(CIAString), "Yes");
    }
    else
    {
        format(CIAString, sizeof(CIAString), "No");
    }

    if(IsRegularPlayer[playerid] == 1337)
    {
        format(RegularString, sizeof(RegularString), "Yes");
    }
    else
    {
        format(RegularString, sizeof(RegularString), "No");
    }

    if(JailTime[playerid] >= 1)
    {
        format(JailTimeString, sizeof(JailTimeString), "%d", JailTime[playerid]);
    }*
    else
    {
    //Do Nothing
    }
    strcat(string,"Army: %s", ArmyString);
    strcat(string, "CIA: %s", CIAString);
    strcat(string, "Regular Player: %s", RegularString);
    strcat(string, "Admin Level:%d", AdminLevel[playerid]);
    strcat(string, "Jailtime: %d", JailTimeString);
    strcat(string, "Wanted Level: %d", GetPlayerWantedLevel(playerid));
    strcat(string, "C4 Packs: %d", HasC4[playerid]);
    strcat(string, "Ropes: %d", HasRope[playerid]);
    strcat(string, "Cash: $%d", GetPlayerMoney(playerid));
    strcat(string, "BankCash: $%d", BankCash[playerid]);
    strcat(string, "Rob Level: %d", RobSkill[playerid]);
    strcat(string, "Terrorist Level: %d", TerroristSkill[playerid]);
    strcat(string, "Heroin Injections: %d", HasHeroin[playerid]);
    strcat(string, "Weed Grams: %d", HasWeed[playerid]);
    ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_MSGBOX, "Status", string, "Close", "");
    return 1;
}
Reply
#2

are you trying to textdraw?
Reply
#3

no.. im trying to use dialog.
Reply
#4

Waiting for about an hour still no one replies. but im still trying to fix this, can anyone help?
Reply
#5

You need to use format, strcat just adds two strings together

pawn Код:
dcmd_stats(playerid, unused[]) {
    #pragma unused unused

    static const
        NoYes[][] = { "No", "Yes" },
        form[] = "\
            Army: %s\n\
            CIA: %s\n\
            Regular Player: %s\n\
            Admin Level: %d\n\
            Jailtime: %d\n\
            Wanted Level: %d\n\
            C4 Packs: %d\n\
            Ropes: %d\n\
            Cash: $%d\n\
            BankCash: $%d\n\
            Rob Level: %d\n\
            Terrorist Level: %d\n\
            Heroin Injections: %d\n\
            Weed Grams: %d"

    ;
    new
        string[512]
    ;
    format(string, sizeof string, form
        , NoYes[(CanUseArmy[playerid] == 1337)]
        , NoYes[(CanUseCIA[playerid] == 1337)]
        , NoYes[(IsRegularPlayer[playerid] == 1337)]
        , AdminLevel[playerid]
        , JailTime[playerid]
        , GetPlayerWantedLevel(playerid)
        , HasC4[playerid]
        , HasRope[playerid]
        , GetPlayerMoney(playerid)
        , BankCash[playerid]
        , RobSkill[playerid]
        , TerroristSkill[playerid]
        , HasHeroin[playerid]
        , HasWeed[playerid]
    );
    return ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_MSGBOX, "Status", string, "Close", "");
}
Reply
#6

Respected Nero_3D! Thanks Alot, + Rep!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)