Could someone please help me with this?
#1

Im trying to create a box that pops up with my server rules that has 2 buttons on it, "Accept" and "Deny"
Now i got the box to pop up yet when i click on "Deny" to test it, it still lets me spawn..

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(listitem == 1)
SendClientMessage(playerid,COLOR_WHITE,"Thank you for agreeing.");
}
if(listitem == 0)
Kick(playerid);
}
return 0;
}

What am i doing wrong?

Thanks to anyone that can help.
Reply
#2

get xfire chaos or post the whole script for it into a fs so we can see all the code.
Reply
#3

Haven't had a chance to test the GUI stuff yet (0.3 crashes =( ) but I think it's done like this:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(Dialogid == 0)
   {
     if(response == 1)
        SendClientMessage(playerid,COLOR_WHITE,"Thank you for agreeing.");
     }
     if(response == 0)
        Kick(playerid);
     }
   }
   return 0;
}
Not too sure though.
Reply
#4

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(Dialogid == 0)
    {
        switch(response)
        {
          case 0: Kick(playerid);
          case 1: SendClientMessage(playerid,COLOR_WHITE,"Thank you for agreeing.");
        }
    }
    return 0;
}
Reply
#5

Quote:
Originally Posted by //exora
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(Dialogid == 0)
    {
        switch(response)
        {
          case 0: Kick(playerid);
          case 1: SendClientMessage(playerid,COLOR_WHITE,"Thank you for agreeing.");
        }
    }
    return 0;
}
thanks for that, except i only get the thank you message showing. The kick doesnt seem to work..
Reply
#6

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(listitem == 1)
  {
  SendClientMessage(playerid,COLOR_WHITE,"Thank you for agreeing with the server terms of service."); //Feel free to change the message. :x
  return 1;
   }
   if(listitem == 0)
   {
  Kick(playerid);
  SendClientMessage(playerid, COLOR_RED, "You have been kicked for not agreeing with our server Terms of Service.");
  return 1;
   }
  return 1;
}
At least, that's how I did it with my GUI and it works perfectly.
Reply
#7

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(!dialogid)//==0
	{
		if(listitem == 1) return SendClientMessage(playerid,COLOR_WHITE,"Thank you for agreeing with the server terms of service.");
		else if(!listitem){	
			SendClientMessage(playerid, COLOR_RED, "You have been kicked for not agreeing with our server Terms of Service."); return Kick(playerid);
		}
	}
	/*else if(dialogid == n)*/
	else return 0;
}
or
Код:
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Accept rules","You mmust write your text here","Accept","Decline");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(!dialogid)//==0
	{
		if(response == 1) return SendClientMessage(playerid,COLOR_WHITE,"Thank you for agreeing with the server terms of service.");
		else if(!response){
			SendClientMessage(playerid, COLOR_RED, "You have been kicked for not agreeing with our server Terms of Service."); return Kick(playerid);
		}
	}
	/*else if(dialogid == n)*/
	else return 0;
}
do you have any brains? << post sig(as Ecko, Regards, name, or smthn )
Reply
#8

Issent this the 2nd button if(!respons)
Because I think that the second button doesent return a value but just closes the box
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)