// Define the dialog ID so we can handle responses
#define DIALOG_RULES 1
// In some command
ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, \"Server Rules\", \"- No Cheating\\n- No Spamming\\n- Respect Admins\\n\\nDo you agree to these rules?\", \"Yes\", \"No\");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_RULES)
{
if(response) // If they clicked \'Yes\' or pressed enter
{
SendClientMessage(playerid, COLOR_GREEN, \"Thank you for agreeing to the server rules!\");
}
else // Pressed ESC or clicked cancel
{
KickWithMessage(playerid, COLOR_RED, \"You MUST agree to the server rules to play here.\");
//For info & code of this function please refer to the bottom of this article.
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
Hivatalos wikipéda példájából másoltam ki, neked.