PDA

View Full Version : Dialog


KinderClans
05/09/2018, 03:44 PM
What's wrong with this dialog:

CMD:testing(playerid)
{
ShowPlayerDialog(playerid, DIALOG_CMDS, DIALOG_STYLE_TABLIST_HEADERS, "Server Commands",

"Command\tFunction\n\

/cmds\tShows a list of server commands\n\",
/rules\tShow server rules\n\",

"Close", "");
return 1;
}

error 075: input line too long (after substitutions)
error 029: invalid expression, assumed zero
error 017: undefined symbol "tShows"
error 017: undefined symbol "a"
fatal error 107: too many error messages on one line

ShihabSoft
05/09/2018, 04:03 PM
CMD:testing(playerid)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_TABLIST_HEADERS, "Server Commands",

"Command\tFunction\n/cmds\tShows a list of server commands\n,/rules\tShow server rules\n",

"Close", "");
return 1;
}

Pawno doesn't support escaping newlines like that

KinderClans
05/09/2018, 05:21 PM
Thank you it works. Now i have a problem with this:

CMD:players(playerid, params[])
{
static List[1500];

new zone[MAX_ZONE_NAME];

List = "Player\tID\tZone";

for(new i,g = GetPlayerPoolSize(); i < g+1; i++)
if(IsPlayerConnected(i))

GetPlayer2DZone(i, zone, MAX_ZONE_NAME);

format(List, sizeof(List), "%s\n%s\t%i\t%s", List, ReturnName(i, 0), i, zone);

if(strlen(List) > 0) ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_TABLIST_HEADERS, "Online Players:", List, "Close", "");
return 1;
}

error 017: undefined symbol "i"

at the format line.

NaS
05/09/2018, 05:27 PM
Thank you it works. Now i have a problem with this:

CMD:players(playerid, params[])
{
static List[1500];

new zone[MAX_ZONE_NAME];

List = "Player\tID\tZone";

for(new i,g = GetPlayerPoolSize(); i < g+1; i++)
if(IsPlayerConnected(i))

GetPlayer2DZone(i, zone, MAX_ZONE_NAME);

format(List, sizeof(List), "%s\n%s\t%i\t%s", List, ReturnName(i, 0), i, zone);

if(strlen(List) > 0) ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_TABLIST_HEADERS, "Online Players:", List, "Close", "");
return 1;
}

error 017: undefined symbol "i"

at the format line.

Use brackets. Only GetPlayer2DZone is now a compound block with if() and for().

That's why scripting like that should be considered bad practice. You loose track of what belongs together.