RULES Dialog
#1

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.
Reply
#2

Dialogs work in 0.3e...post your code for your dialog response so we can help you.
Reply
#3

I edited. Take a look.
Reply
#4

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;
}
Reply
#5

It's not seding the SendClientMessage and not kicking... Don't know why. If someone knows, please post here.
Reply
#6

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;
    }
Reply
#7

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)