COMMAND:rules(playerid, params[])
{
ShowPlayerDialog(playerid, , DIALOG_STYLE_LIST, "Rules", "OK", "Cancel");
#pragma unused params // params isn't used here
// Setup local variables
new CmdList2[2000];
// Show all available player-commands
format(CmdList2, sizeof(CmdList2), "/detach\n\tDetaches your trailer\n");
format(CmdList2, sizeof(CmdList2), "/flip\n\tFlips your vehicle back on his wheels\n");
format(CmdList2, sizeof(CmdList2), "/kill\n\tKills yourself\n");
format(CmdList2, sizeof(CmdList2), "/reclass\n\tChoose another class\n");
format(CmdList2, sizeof(CmdList2), "/work\n\tStart a job\n");
format(CmdList2, sizeof(CmdList2), "/rescue\n\tLet's you respawn at a spawn-location\n");
format(CmdList2, sizeof(CmdList2), "/admins\n\tShows all online admins\n");
format(CmdList2, sizeof(CmdList2), "/cmds\n\tShows this list of commands\n");
// Show all the commands in a dialog
// Let the server know that this was a valid command
return 1;
}
CMD:rules( p, pa[ ] )
{
ShowPlayerDialog( p, 9000, DIALOG_STYLE_MSGBOX, "Server Rules", "/detach\n\tDetaches your trailer\n\
/flip\n\tFlips your vehicle back on his wheels\n\
/kill\n\tKills yourself\n\
/reclass\n\tChoose another class\n\
/work\n\tStart a job\n\
/rescue\n\tLet's you respawn at a spawn-location\n\
/admins\n\tShows all online admins\n\
/cmds\n\tShows this list of commands", "Ok" , "");
return 1;
}
new String[ 512 ],
Str1[ ] = "Half of text here",
Str2[ ] = "The other half the here";
format( String, sizeof String, "%s%s", Str1, Str2 );
ShowPlayerDialog( playerid, dialogid, " Title ", String, "button 1", "button 2" );
Then do it like this
pawn Код:
|
new RulesD [ 1024 ];
SetUpMyText();
COMMAND:rules(playerid, params[])
{
ShowPlayerDialog(playerid, 555555, DIALOG_STYLE_MSGBOX,"Rules",RulesD, "OK", "Cancel");
return 1;
}
SetUpMyText()
{
RulesD = "/detach\n\tDetaches your trailer\n";
strcat(RulesD, "/flip\n\tFlips your vehicle back on his wheels\n");
strcat(RulesD, "/kill\n\tKills yourself\n");
strcat(RulesD, "/reclass\n\tChoose another class\n");
strcat(RulesD, "/work\n\tStart a job\n");
strcat(RulesD, "/rescue\n\tLet's you respawn at a spawn-location\n");
strcat(RulesD, "/admins\n\tShows all online admins\n");
strcat(RulesD, "/cmds\n\tShows this list of commands\n");
return 1;
)
COMMAND:rules(playerid, params[])
{ ShowPlayerDialog(playerid, 555555, DIALOG_STYLE_MSGBOX,"Rules",RulesD, "OK", "Cancel"); return 1; } Should the dialog ID be RulesD?"" |