SA-MP Forums Archive
Annoying issue with 'expected token' - 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: Annoying issue with 'expected token' (/showthread.php?tid=502835)



Annoying issue with 'expected token' - printer - 26.03.2014

pawn Код:
new edt = Editing[playerid];
                new rankedt = RankEditing[playerid];
                if(!strlen(inputtext))
                    return ShowPlayerDialog(playerid, DIALOG_F_EDITNAME,DIALOG_STYLE_INPUT,"{00c982}FACTION EDIT","{b7ba00}New rank name {ff0000}{You need to actually fill it out!):","Set","Cancel");
                format(FactionRank[edt][rankedt], sizeof(FactionRank[edt][rankedt]),"%s",inputtext);
Errors show:
pawn Код:
rp.pwn(1993) : error 001: expected token: "]", but found "-identifier-"
rp.pwn(1993) : warning 215: expression has no effect
rp.pwn(1993) : error 001: expected token: ";", but found "]"
rp.pwn(1993) : error 029: invalid expression, assumed zero
rp.pwn(1993) : fatal error 107: too many error messages on one line
Line 1993 is the format line.


Re: Annoying issue with 'expected token' - Blademaster680 - 26.03.2014

Can you send us the whole code please...
For eg. if it is a command include the "CMD:****" part


Re: Annoying issue with 'expected token' - printer - 26.03.2014

pawn Код:
case DIALOG_F_P_RANK:
        {
            if(response)
            {
                new edt = Editing[playerid];
                new rankedt = RankEditing[playerid];
                if(!strlen(inputtext))
                    return ShowPlayerDialog(playerid, DIALOG_F_EDITNAME,DIALOG_STYLE_INPUT,"{00c982}FACTION EDIT","{b7ba00}New rank name {ff0000}{You need to actually fill it out!):","Set","Cancel");
                format(FactionRank[edt][rankedt], sizeof(FactionRank[edt][rankedt]),"%s",inputtext);
                SaveFaction(Editing[playerid]);
            }
            else
                ShowPlayerDialog(playerid, DIALOG_F_EDIT, DIALOG_STYLE_LIST, "{00c982}FACTION EDIT", "Faction name\nFaction Type\nFaction default skin\nFaction ranks\nFaction leader rank\nFaction duty position", "Continue", "Cancel");
        }



Re: Annoying issue with 'expected token' - Konstantinos - 26.03.2014

pawn Код:
sizeof(FactionRank[edt][rankedt])
You cannot do that. Use the size directly if it's meant to be a string of course.


Re: Annoying issue with 'expected token' - printer - 26.03.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
sizeof(FactionRank[edt][rankedt])
You cannot do that. Use the size directly if it's meant to be a string of course.
Thanks!