If player presses "I Disagree" how do I make it kick them?
#1

Hello. I have added a dialog msg box to pop up after a player has registered just telling them not to ask to be an admin etc.
I have after the text a "I agree" button and a "I disagree" button

I want it to auto-kick them if they press "I disagree" but I don't know how to do this.

PHP код:
ShowPlayerDialog(playerid1DIALOG_STYLE_MSGBOX"{05B1F5}Please read""{66CC66}bla bla bla text etc""I Agree""I Disagree"); 
Thanks if you help !
Reply
#2

You'll have to do something like this:
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]){
    if(
dialogid==1){
       if(!
responseKick(playerid);
       else return 
1;
    }

Reply
#3

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
        {
        case 1:
            {
            if(!response)
                {
                Kick(playerid);
                return 1;
                }
            else if(response)
                {
                return 1;
                }
            }
        }
    return 1;
}
That should do the trick, the code is a little more clear then the one posted above ^^..

Best regards,
Jesse
Reply
#4

If it's not too much to ask, could you help me put it all together?
I'm new to Pawno so not to sure on what to do here.
Reply
#5

Quote:
Originally Posted by aaronwelsh
Посмотреть сообщение
If it's not too much to ask, could you help me put it all together?
I'm new to Pawno so not to sure on what to do here.
What do you exactly want? When do you want the dialog to show up etc etc etc..

Best regards,
Jesse
Reply
#6

Quote:
Originally Posted by jessejanssen
Посмотреть сообщение
What do you exactly want? When do you want the dialog to show up etc etc etc..

Best regards,
Jesse
I already have it placed where I want it which is after a player registers, once they type /start to enter the game this box appears. But only when they have registered.

If they agree the box will go away, if they disagree then they will be kicked.

Sorry if this isn't exactly what you were asking.
Reply
#7

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    // This looks trough all the dialog IDs
    switch(dialogid)
        {
        // If the dialogid is 1.
        case 1:
            {
            // If the player presses the 2nd button.
            if(!response)
                {
                // This kicks the player.
                Kick(playerid);
                // This stops the code reading.
                return 1;
                }
            // If the player presses the 1st button.
            else if(response)
                {
                // This stops the code reading.
                return 1;
                }
            }
        }
    return 1;
}
That was all I need to know, if this is your only dialog just replace the 'OnDialogResponse' area with the one above.

Best regards,
Jesse

EDIT:
Cleared out the code.
Reply
#8

I am extremely sorry if I am getting annoying or sound really stupid but I'm still a little bit confused.
The code I have for my box that appears is;

PHP код:
ShowPlayerDialog(playerid1DIALOG_STYLE_MSGBOX"{05B1F5}Please read""{66CC66}bla bla bla text etc""I Agree""I Disagree"); 
How exactly do I add what you have said? how do I make it know if the user presses 'I disagree' that it has to kick the player?
and do i place it underneath?
The end of my coding for after the player registers is;
PHP код:
ShowPlayerDialog(playerid1DIALOG_STYLE_MSGBOX"{6633CC}Please read""{66CC66}DO NOT ask to be an admin.We will not give you it\n if you continue to ask you may be banned.\nIf you want to be part of the development team apply on forums/n{029EF2}nexthypegaming.tk""I Agree""I Disagree");
                
            }
        }
        return 
1;
    } 
I have gave you rep anyway for your help (If the rep works at my level)

Thanks man!
Reply
#9

Quote:
Originally Posted by jessejanssen
Посмотреть сообщение
I PM'd you.

Best regards,
Jesse
Can you please also tell me how to do it?
Reply
#10

Quote:
Originally Posted by NeymarJr
Посмотреть сообщение
Can you please also tell me how to do it?
If you follow 'Unfriendly's post it should be allright, else do what Unfriendly said at the post aswell ^^.

Best regards,
Jesse
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)