Help with a /rules dialog
#1

I wanna make a /rules command but i dont know how to make this work can someone help me?
pawn Код:
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;
}
Reply
#2

Easy as pie.

pawn Код:
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;
}
Anybody know how to make a pie?
Reply
#3

Then you get a error that the input type is too long
Reply
#4

Quote:
Originally Posted by thimo
Посмотреть сообщение
Then you get a error that the input type is too long
Then do it like this

pawn Код:
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" );
Reply
#5

Dude better give a GOOD example of a BIG list dialog :S
Reply
#6

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
Then do it like this

pawn Код:
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" );
He already gave you
Reply
#7

On top of ur script:
pawn Код:
new RulesD [ 1024 ];
OnGameModeInit/OnFilterScriptInit:
pawn Код:
SetUpMyText();
Rules cmd:
pawn Код:
COMMAND:rules(playerid, params[])
{
    ShowPlayerDialog(playerid, 555555, DIALOG_STYLE_MSGBOX,"Rules",RulesD, "OK", "Cancel");
    return 1;
}
Somewhere in ur script
pawn Код:
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;
)
Edit: that's for big dialog
Reply
#8

COMMAND:rules(playerid, params[])
{
ShowPlayerDialog(playerid, 555555, DIALOG_STYLE_MSGBOX,"Rules",RulesD, "OK", "Cancel");
return 1;
}
Should the dialog ID be RulesD?""
Reply
#9

Quote:
Originally Posted by thimo
Посмотреть сообщение
COMMAND:rules(playerid, params[])
{
ShowPlayerDialog(playerid, 555555, DIALOG_STYLE_MSGBOX,"Rules",RulesD, "OK", "Cancel");
return 1;
}
Should the dialog ID be RulesD?""
No need if you do not want to add dialog response ID.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)