Something went wrong. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Something went wrong. (
/showthread.php?tid=424652)
Something went wrong. -
LeeXian99 - 23.03.2013
ShowPlayerDialog, ID 5.
pawn Код:
if (strcmp(cmdtext, "/rules", true) == 0)
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "Rules", "1. CLEO and hacks are not allowed.\n2. Advertising is not allowed!\n3. No impersonating.\n 4. Don't ask for free stuff, earn it.\n5. Never ask to be a mod or administrator.\n6. Don't shout out the hackers, /report!\n7.Do not flame or insult players.\n8. Do not use caps or spam in chat, you'll be muted.\n9.Do not abuse bug, report it in our site\n10. No carjacking\n{00ff00}Do you agree to the rules?", "Yes", "No");
return 1;
}
Full OnDialogResponse
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case 1:
{
SendClientMessage(playerid, 0xFFFFFFAA, "You've read the /cmds.");
return 1;
}
case 2:
{
SendClientMessage(playerid, 0xFFFFFFAA, "You've read the /teles.");
return 1;
}
case 3:
{
SendClientMessage(playerid, 0xFFFFFFAA, "You've read the /updates.");
return 1;
}
case 4:
{
SendClientMessage(playerid, 0xFFFFFFAA, "Make sure you visit our website! racerevolution.cu.cc.");
return 1;
}
case 5:
{
{
SendClientMessage(playerid, 0xFFFFFFAA, "Thanks for accepting our server rules, have fun!");
}
if(!response)
{
SendClientMessage(playerid, 0xFF000000, "You must accept our server rules to play on!");
new name[MAX_PLAYER_NAME+1], string[128];
format(string, sizeof(string), "[/RULES]: %s has been kicked for not accepting the rules.", name);
SendClientMessageToAll(0xFF000000, string);
Kick(playerid);
}
return 1;
}
}
}
return 1;
}
When I clicked on the "No", it doesn't work. :/
Re: Something went wrong. -
[ABK]Antonio - 23.03.2013
Try this out
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 1: SendClientMessage(playerid, 0xFFFFFFAA, "You've read the /cmds.");
case 2: SendClientMessage(playerid, 0xFFFFFFAA, "You've read the /teles.");
case 3: SendClientMessage(playerid, 0xFFFFFFAA, "You've read the /updates.");
case 4: SendClientMessage(playerid, 0xFFFFFFAA, "Make sure you visit our website! racerevolution.cu.cc.");
case 5:
{
if(!response)
{
SendClientMessage(playerid, 0xFF000000, "You must accept our server rules to play on!");
new name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[/RULES]: %s has been kicked for not accepting the rules.", name);
SendClientMessageToAll(0xFF000000, string);
Kick(playerid);
}
else SendClientMessage(playerid, 0xFFFFFFAA, "Thanks for accepting our server rules, have fun!");
}
}
return 1;
}
Re: Something went wrong. -
LeeXian99 - 23.03.2013
Thanks, it works.
+REP