SA-MP Forums Archive
warning 202: number of arguments does not match definition - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: warning 202: number of arguments does not match definition (/showthread.php?tid=610547)



warning 202: number of arguments does not match definition - MayaEU - 25.06.2016

What is wrong with this?

pawn Код:
ShowPlayerDialog( playerid, BUYTOYS, DIALOG_STYLE_MSGBOX, "Toy Accessories", ""COL_WHITE"Welcome to "COL_LIGHTBLUE"%s"COL_WHITE". You can buy accessories here.\n\nClick continue to see our range.",BizzInfo[HouseEntered[playerid]][bMessage],"Continue", "Cancel" );



Re: warning 202: number of arguments does not match definition - Konstantinos - 25.06.2016

ShowPlayerDialog does not accepting arguments to format the text. So format a string and use that as "info".


Re: warning 202: number of arguments does not match definition - MayaEU - 25.06.2016

Oooh yea ofcourse.. "faceplam"

so this one would work?
pawn Код:
new string[128], titlestring[128];
        format(string,sizeof(string),""COL_WHITE"Welcome to "COL_LIGHTBLUE"%s"COL_WHITE". You can buy accessories here.\n\nClick continue to see our range.",BizzInfo[HouseEntered[playerid]][bMessage]);
        format(titlestring,sizeof(titlestring),"Toy Accessories");
        ShowPlayerDialog(playerid,BUYTOYS,DIALOG_STYLE_MSGBOX,titlestring,string,"Continue","Cancel");



Re: warning 202: number of arguments does not match definition - oMa37 - 25.06.2016

You don't need to make a format for the title, since you didn't make any string in it just put it in the title.
PHP код:
        new string[128];
        
format(string,sizeof(string),""COL_WHITE"Welcome to "COL_LIGHTBLUE"%s"COL_WHITE". You can buy accessories here.\n\nClick continue to see our range.",BizzInfo[HouseEntered[playerid]][bMessage]);
        
ShowPlayerDialog(playerid,BUYTOYS,DIALOG_STYLE_MSGBOX,"Toy Accessories",string,"Continue","Cancel"); 



Re: warning 202: number of arguments does not match definition - MayaEU - 25.06.2016

Oh, thank you


Re: warning 202: number of arguments does not match definition - MayaEU - 25.06.2016

For some reason it just says "server unknown command"

pawn Код:
if (strcmp("/buytoys", cmdtext, true, 10) == 0)
    {
        if(!IsAtClothesShop(playerid))
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not in a clothes shop.");
            return 1;
        }
        format(string,sizeof(string),""COL_WHITE"Welcome to "COL_LIGHTBLUE"%s"COL_WHITE". You can buy accessories here.\n\nClick continue to see our range.",BizzInfo[HouseEntered[playerid]][bMessage]);
        ShowPlayerDialog(playerid,BUYTOYS,DIALOG_STYLE_MSGBOX,"Toy Accessories",string,"Continue","Cancel");
        return 1;
    }



Re: warning 202: number of arguments does not match definition - Konstantinos - 25.06.2016

BizzInfo[HouseEntered[playerid]][bMessage]

The value of HouseEntered[playerid] is out of bounds. You need to make sure that a player HAS entered (set to an appropriate value) a house before formatting.


Re: warning 202: number of arguments does not match definition - MayaEU - 25.06.2016

its fixed now