If player presses "I Disagree" how do I make it kick them? -
aaronwelsh - 12.06.2012
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(playerid, 1, DIALOG_STYLE_MSGBOX, "{05B1F5}Please read", "{66CC66}bla bla bla text etc", "I Agree", "I Disagree");
Thanks if you help

!
Re: If player presses "I Disagree" how do I make it kick them? -
mati233 - 12.06.2012
You'll have to do something like this:
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
if(dialogid==1){
if(!response) Kick(playerid);
else return 1;
}
}
Re: If player presses "I Disagree" how do I make it kick them? -
jessejanssen - 12.06.2012
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
Re: If player presses "I Disagree" how do I make it kick them? -
aaronwelsh - 12.06.2012
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.
Re: If player presses "I Disagree" how do I make it kick them? -
jessejanssen - 12.06.2012
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
Re: If player presses "I Disagree" how do I make it kick them? -
aaronwelsh - 12.06.2012
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.
Re: If player presses "I Disagree" how do I make it kick them? -
jessejanssen - 12.06.2012
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.
Re: If player presses "I Disagree" how do I make it kick them? -
aaronwelsh - 12.06.2012
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(playerid, 1, DIALOG_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(playerid, 1, DIALOG_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!
Re: If player presses "I Disagree" how do I make it kick them? -
NeymarJr - 12.06.2012
Quote:
Originally Posted by jessejanssen
I PM'd you.
Best regards,
Jesse
|
Can you please also tell me how to do it?
Re: If player presses "I Disagree" how do I make it kick them? -
jessejanssen - 12.06.2012
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