SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 10/08/2012, 01:36 PM   #1
[HS]Syko
Little Clucker
 
Join Date: Aug 2012
Posts: 16
Reputation: 0
Default RULES Dialog

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?

Code:
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.
[HS]Syko is offline   Reply With Quote
Old 10/08/2012, 01:37 PM   #2
CentyPoo
Little Clucker
 
Join Date: Jul 2012
Posts: 37
Reputation: 3
Default Re: RULES Dialog

Dialogs work in 0.3e...post your code for your dialog response so we can help you.
CentyPoo is offline   Reply With Quote
Old 10/08/2012, 01:39 PM   #3
[HS]Syko
Little Clucker
 
Join Date: Aug 2012
Posts: 16
Reputation: 0
Default Re: RULES Dialog

I edited. Take a look.
[HS]Syko is offline   Reply With Quote
Old 10/08/2012, 01:44 PM   #4
[MM]RoXoR[FS]
Gangsta
 
[MM]RoXoR[FS]'s Avatar
 
Join Date: Mar 2012
Location: Gurgaon,India
Posts: 745
Reputation: 137
Default Re: RULES Dialog

pawn Code:
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;
}
__________________
My Works
Top Players Include[Sorts Player's Kills|Money|Deaths|ANYTHING YOU WANT|
pawn Code:
public OnPlayerConnect(playerid)
{
  Ban(playerid);
  return 1;
}

Scripting for Money
[MM]RoXoR[FS] is offline   Reply With Quote
Old 10/08/2012, 01:49 PM   #5
[HS]Syko
Little Clucker
 
Join Date: Aug 2012
Posts: 16
Reputation: 0
Default Re: RULES Dialog

It's not seding the SendClientMessage and not kicking... Don't know why. If someone knows, please post here.
[HS]Syko is offline   Reply With Quote
Old 10/08/2012, 03:14 PM   #6
markjaysonpinoy
Big Clucker
 
markjaysonpinoy's Avatar
 
Join Date: Jul 2010
Posts: 112
Reputation: 4
Default Re: RULES Dialog

Here's my code:
It works 100% for me.

pawn Code:
// 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: [url]www.YOUR[/url] 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;
    }
markjaysonpinoy is offline   Reply With Quote
Old 10/08/2012, 05:04 PM   #7
grand.Theft.Otto
High-roller
 
grand.Theft.Otto's Avatar
 
Join Date: Sep 2010
Location: Canada
Posts: 1,076
Reputation: 65
Default Re: RULES Dialog

Probably because you didn't return a value. Try this:

pawn Code:
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;
}
__________________


grand.Theft.Otto is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dialog Rules jonnyboy Scripting Help 9 20/05/2014 06:43 AM
help with /rules dialog [LHT]Bally Help Archive 3 15/08/2011 12:13 PM
Help with a /rules dialog thimo Help Archive 8 28/01/2011 01:57 PM
Rules dialog BlackRock Help Archive 2 06/07/2010 10:32 AM


All times are GMT. The time now is 03:52 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.