03.05.2014, 04:07
my server have no /rules command.. and i don't know how to make once.. can you give me some that i can copy? i don't like textdraw's because i don't know how to use it, dialogs will be thank you!
// 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.
}
forward KickPublic(playerid);
public KickPublic(playerid) { Kick(playerid); }
stock KickWithMessage(playerid, color, message[])
{
SendClientMessage(playerid, color, message);
SetTimerEx("KickPublic", 1000, 0, "d", playerid); //Delay of 1 second before kicking the player so he recieves the message
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/help", true))
{
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");
return 1;
}
return 0;
}
C:\Users\Louis Alcosaba\Desktop\LSCNR\gamemodes\1.2.pwn(1722) : error 029: invalid expression, assumed zero C:\Users\Louis Alcosaba\Desktop\LSCNR\gamemodes\1.2.pwn(1722) : error 004: function "zcmd_OnPlayerCommandText" is not implemented C:\Users\Louis Alcosaba\Desktop\LSCNR\gamemodes\1.2.pwn(1723) : warning 217: loose indentation C:\Users\Louis Alcosaba\Desktop\LSCNR\gamemodes\1.2.pwn(1724) : error 017: undefined symbol "cmdtext" C:\Users\Louis Alcosaba\Desktop\LSCNR\gamemodes\1.2.pwn(1735) : warning 225: unreachable code C:\Users\Louis Alcosaba\Desktop\LSCNR\gamemodes\1.2.pwn(1735) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/help", true)) { 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"); return 1; } return 0; }