RULES Dialog - 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: RULES Dialog (
/showthread.php?tid=367572)
RULES Dialog -
[HS]Syko - 10.08.2012
Well guys, I scripted a Rules Dialog.
But OnDialogResponse doesnt work for me.
I wanted to make like:
If player response = SendClientMessage "Thanks for accepting the rules"
If player response == 0 SendClientMessgae "You declined the rules, kicked!"
Kick(playerid)
(This is just an example!)
Can someone make this possible for version 3.0e?
Код:
public OnPlayerConnect(playerid)
{
ShowPlayerDialog(playerid, KickBox, DIALOG_STYLE_MSGBOX, "{000080}Server Rules", "{FF0000}Rule 1: No Hacking\n\n{FF0000}Rule 2: No Imature Behavioure\n\n{FF0000}Rule 3: No Racism\n\n{FF0000}Rule 4: Respect all players\n\n{FF0000}Rule 5: Do not be abusive to Admins or KICK/BAN\n\n{FF0000}Rule 6: Have Fun!\n\n{D9FF00}Decline our rules you will be KICKED!", "Accept", "Decline");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == KickBox)
{
if(response)
{
SendClientMessage(playerid,COLOR_YELLOW, "You Accepted our rules Have fun!");
}
else
{
SendClientMessage(playerid,COLOR_RED, "You Declined and have been kicked Goodbye!");
Kick(playerid);
}
return 1;
}
return 0;
}
This is what I used.
Re: RULES Dialog -
CentyPoo - 10.08.2012
Dialogs work in 0.3e...post your code for your dialog response so we can help you.
Re: RULES Dialog -
[HS]Syko - 10.08.2012
I edited. Take a look.
Re: RULES Dialog -
[MM]RoXoR[FS] - 10.08.2012
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case KickBox :
{
if(!response)
{
SendClientMessage(playerid,COLOR_RED, "You Declined and have been kicked Goodbye!");
Kick(playerid);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_YELLOW, "You Accepted our rules Have fun!");
return 1;
}
}
}
return 0;
}
Re: RULES Dialog -
[HS]Syko - 10.08.2012
It's not seding the SendClientMessage and not kicking... Don't know why. If someone knows, please post here.
Re: RULES Dialog -
markjaysonpinoy - 10.08.2012
Here's my code:
It works 100% for me.
pawn Код:
// on top of script#define C_Rules 20//under OnPlayerConnect strcat(string,
"1. Do not hack or abuse bugs.\n");
strcat(string,
"2. Do not advertise other servers\n");
strcat(string,
"3. Do not disrespect Administrators\n");
strcat(string,
"4. Do not spam.\n");
strcat(string,
"5. Do not bully.\n");
strcat(string,
"6. Do not say /q jokes.\n");
strcat(string,
"7. Do not spawnkill.\n");
strcat(string,
"8. Do not benefit from hacks.\n");
strcat(string,
"9. Do not threaten the server's well-being.\n");
strcat(string,
"10. Do not teamkill, teamjack, and spawnkill.\n");
strcat(string,
"\n");
strcat(string,
"\n");
strcat(string,
"To learn more about the server rules, visit our forums at: http://www.YOUR FORUM HERE.com\n");
ShowPlayerDialog
(playerid, C_Rules, DIALOG_STYLE_MSGBOX,
"Server In-Game Rules:", string,
"Agree",
"Disagree");
//under OnDialogResponse if(dialogid
== C_Rules
) { if(response
) { SendClientMessage
(playerid,COLOR_YELLOW,
"SERVER: Thanks for reading the rules. Enjoy playing in the server!");
} else { SendClientMessage
(playerid,COLOR_RED,
"SERVER: You have been kicked because you didn't agree with our rules!");
Kick
(playerid
);
} return 1;
}
Re: RULES Dialog -
grand.Theft.Otto - 10.08.2012
Probably because you didn't return a value. Try this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case KickBox :
{
if(!response)
{
SendClientMessage(playerid,COLOR_RED, "You Declined and have been kicked Goodbye!");
Kick(playerid);
}
else
{
SendClientMessage(playerid,COLOR_YELLOW, "You Accepted our rules Have fun!");
}
}
}
return 1;
}