SA-MP Forums Archive
error 001: 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: error 001: expected token: "{" (/showthread.php?tid=581673)



error 001: expected token: "{" - alexanderjb918 - 14.07.2015

Код:
C:\Users\ii\Desktop\roleplay.pwn(29307) : error 001: expected token: "{", but found "-identifier-"
Код:
Dialog:Origin(playerid, response, listitem, inputtext[])
{
	if (response)
	{
	    new str[64];

	    if (isnull(inputtext) || strlen(inputtext) > 32) {
	        Dialog_Show(playerid, Origin, DIALOG_STYLE_INPUT, "Origin", "Please enter the geographical origin of your character below:", "Submit", "Cancel");
		}
		else for (new i = 0, len = strlen(inputtext); i != len; i ++) {
		    if ((inputtext[i] >= 'A' && inputtext[i] <= 'Z') || (inputtext[i] >= 'a' && inputtext[i] <= 'z') || (inputtext[i] >= '0' && inputtext[i] <= '9') || (inputtext[i] == ' ') || (inputtext[i] == ',') || (inputtext[i] == '.'))
				continue;

			else return Dialog_Show(playerid, Origin, DIALOG_STYLE_INPUT, "Origin", "Error: Only letters and numbers are accepted in the origin.\n\nPlease enter the geographical origin of your character below:", "Submit", "Cancel");
		}
		format(PlayerData[playerid][pOrigin], 32, inputtext);
        switch (PlayerData[playerid][pGender])
       	ShowModelSelectionMenu(playerid, "Select Skin", MODEL_SELECTION_SKIN, g_aMaleSkins, sizeof(g_aMaleSkins), -16.0, 0.0, -55.0);
		ShowModelSelectionMenu(playerid, "Select Skin", MODEL_SELECTION_SKIN, g_aFemaleSkins, sizeof(g_aFemaleSkins), -16.0, 0.0, -55.0);
  		format(str, sizeof(str), "~r~Origin:~w~ %s", inputtext);
  		PlayerTextDrawSetString(playerid, PlayerData[playerid][pTextdraws][17], str);
	}
	return 1;
}



Re: error 001: expected token: "{" - TonyVk - 14.07.2015

which line?


Re: error 001: expected token: "{" - iTakelot - 14.07.2015

indicate the line of the error ...


Re: error 001: expected token: "{" - Macluawn - 14.07.2015

Код:
format(PlayerData[playerid][pOrigin], 32, inputtext);
switch (PlayerData[playerid][pGender])
ShowModelSelectionMenu(playerid, "Select Skin", MODEL_SELECTION_SKIN, g_aMaleSkins, sizeof(g_aMaleSkins), -16.0, 0.0, -55.0);
The highlighted line makes no sense in that context.
You can read more about how to use switch in the documentation. https://sampwiki.blast.hk/wiki/Switch#switch