HELP Dialog boxes
#1

Hey guyz please help me.
I am using a dialog box for my server.(i use 2 kinds of dialog for teleport, weapon)
But when i click the cancel of any dialog i get kicked from the server.
I havent given any command to kick a player if clicked quit or cancel
Reply
#2

Send me the dialogs script.
Reply
#3

This is the teleport script
Reply
#4

nono, post so i can see it. i dont want to download it
Reply
#5

Код:
#include <a_samp>
#define FILTERSCRIPT
#define INTERIORMENU 1337
#define COLOR_RED 0xAA3333AA
public OnFilterScriptInit()
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp(cmdtext, "/teleport", true) == 0)
	{
	ShowPlayerDialog(playerid, INTERIORMENU, DIALOG_STYLE_LIST, "Teleports Location","Bank\nAirports\nAmmunations\nGarages\nDepartment\nBack", "Select", "Cancel");
	return 1;
	}
 	return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == INTERIORMENU)
	{
		if(response)
		{
  			if(listitem == 0) // Banks
  			{
			ShowPlayerDialog(playerid, INTERIORMENU+1, DIALOG_STYLE_LIST, "Bank", "Bank 1 \nBank 2 \nBank 3 \nBank 4 \nBank 5 \nBank 6 \nBack", "Select", "Cancel");
			}
			if(listitem == 1) // Airports
			{
			ShowPlayerDialog(playerid, INTERIORMENU+2, DIALOG_STYLE_LIST, "Airport Interiors", "Las Venturas Airport \nLas Santos Airport \nSan Fierro Airport \nBack", "Select", "Cancel");
			}
			if(listitem == 2) // Ammunations
			{
      ShowPlayerDialog(playerid, INTERIORMENU+3, DIALOG_STYLE_LIST, "Ammunation Interiors", "Ammunation 1 \nAmmunation 2 \nAmmunation 3 \nAmmunation 4 \nAmmunation 5 \nBack", "Select", "Cancel");
  			}
			if(listitem == 3) // Garages
			{
			ShowPlayerDialog(playerid, INTERIORMENU+4, DIALOG_STYLE_LIST, "Mod Shops/Garages","Loco Low Co. \nWheel Arch Angels \nTransfender \nDoherty Garage \nBack", "Select", "Cancel");
  			}
			if(listitem == 4) // Departements
			{
			ShowPlayerDialog(playerid, INTERIORMENU+5, DIALOG_STYLE_LIST, "Departments","SF Police Department \nLS Police Department \nLV Police Department \nPlanning Department\nBack", "Select", "Cancel");
  			}
  			if(listitem == 5) // Back
			{
			ShowPlayerDialog(playerid, INTERIORMENU, DIALOG_STYLE_LIST, "Teleports Location","24/7's\nAirports\nAmmunations\nGarages\nDepartment\nBack", "Select", "Cancel");
  			}
  		 }
		return 1;
	}
//===================================Bank's===================================//
	if(dialogid == INTERIORMENU+1) // Bank's
	{
		if(response)
		{
			if(listitem == 0) // Bank1
			{
		  	SetPlayerPos(playerid,-25.884498,-185.868988,1003.546875);
		  SetPlayerInterior(playerid,17);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 1) // Bank 2
			{
		  	SetPlayerPos(playerid,6.091179,-29.271898,1003.549438);
		  SetPlayerInterior(playerid,10);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 2) // Bank 3
			{
		  	SetPlayerPos(playerid,-30.946699,-89.609596,1003.546875);
			SetPlayerInterior(playerid,18);
			GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 3) // Bank 4
			{
		  	SetPlayerPos(playerid,-25.132598,-139.066986,1003.546875);
		  SetPlayerInterior(playerid,16);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 4) // Bank 5
			{
		  	SetPlayerPos(playerid,-27.312299,-29.277599,1003.557250);
		  SetPlayerInterior(playerid,4);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 5) // Bank 6
			{
		  	SetPlayerPos(playerid,-26.691598,-55.714897,1003.54687);
		  SetPlayerInterior(playerid,6);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 6) // Back
 			{
			ShowPlayerDialog(playerid, INTERIORMENU, DIALOG_STYLE_LIST, "Teleports Location","Bank\nAirports\nAmmunations\nGarages\nDepartment\nBack", "Select", "Cancel");
			}
		}
		return 1;
	}
//==================================Airports==================================//
	if(dialogid == INTERIORMENU+2) // Airport Interiors
	{
		if(response)
		{
			if(listitem == 0) // LV
			{
		  	SetPlayerPos(playerid,1691.3054,1448.7297,10.7656,94.5689);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 1) // LS
			{
		  	SetPlayerPos(playerid,1685.1808,-2328.4834,-2.6797,4.0910);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 2) // SF
			{
		  	SetPlayerPos(playerid,-1417.9985,-299.1613,14.1484,138.5623);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 3) // Back
			{
			ShowPlayerDialog(playerid, INTERIORMENU, DIALOG_STYLE_LIST, "Teleports Location","Bank\nAirports\nAmmunations\nGarages\nDepartment\nBack", "Select", "Cancel");
			}
		}
		return 1;
	}
//=================================Ammunation=================================//
	if(dialogid == INTERIORMENU+3) // Ammunations
	{
		if(response)
		{
			if(listitem == 0) // Ammunation 1
			{
		  	SetPlayerPos(playerid,286.148986,-40.644397,1001.515625);
		  SetPlayerInterior(playerid,1);
		  GivePlayerMoney(playerid, -1500);
			}
			if(listitem == 1) // Ammunation 2
			{
		  	SetPlayerPos(playerid,286.800994,-82.547599,1001.515625);
		  SetPlayerInterior(playerid,4);
		  GivePlayerMoney(playerid, -1500);
			}
			if(listitem == 2) // Ammunation 3
			{
		  	SetPlayerPos(playerid,296.919982,-108.071998,1001.515625);
		  SetPlayerInterior(playerid,6);
		  GivePlayerMoney(playerid, -1500);
			}
			if(listitem == 3) // Ammunation 4
			{
		  	SetPlayerPos(playerid,314.820983,-141.431991,999.601562);
		  SetPlayerInterior(playerid,7);
		  GivePlayerMoney(playerid, -1500);
			}
			if(listitem == 4) // Ammunation 5
			{
		  	SetPlayerPos(playerid,316.524993,-167.706985,999.593750);
		  SetPlayerInterior(playerid,6);
		  GivePlayerMoney(playerid, -1500);
			}
			if(listitem == 5) // Back
			{
			ShowPlayerDialog(playerid, INTERIORMENU, DIALOG_STYLE_LIST, "Teleports Location","Bank\nAirports\nAmmunations\nGarages\nDepartment\nBack", "Select", "Cancel");
			}
		}
		return 1;
	}

//===================================MOD SHOPS/GARAGES==================================//
	if(dialogid == INTERIORMENU+4) //
	{
		if(response)
		{
			if(listitem == 0) // Loco Low Co.
			{
		  	SetPlayerPos(playerid,616.7820,-74.8151,997.6350);
		  SetPlayerInterior(playerid,2);
		  GivePlayerMoney(playerid, -750);
			}
			if(listitem == 1) // Wheel Arch Angels
			{
		  	SetPlayerPos(playerid,615.2851,-124.2390,997.6350);
		  SetPlayerInterior(playerid,3);
		  GivePlayerMoney(playerid, -750);
			}
			if(listitem == 2) // Transfender
			{
		  	SetPlayerPos(playerid,617.5380,-1.9900,1000.6829);
		  SetPlayerInterior(playerid,1);
		  GivePlayerMoney(playerid, -750);
			}
			if(listitem == 3) // Doherty Garage
			{
		  	SetPlayerPos(playerid,-2041.2334, 178.3969, 28.8465);
		  SetPlayerInterior(playerid,1);
		  GivePlayerMoney(playerid, -750);
			}
			if(listitem == 4) // Back
			{
			ShowPlayerDialog(playerid, INTERIORMENU, DIALOG_STYLE_LIST, "Teleports Location","Bank\nAirports\nAmmunations\nGarages\nDepartment\nBack", "Select", "Cancel");
			}
		}
		return 1;
	}
	
//===============================Departments================================//
	if(dialogid == INTERIORMENU+5) //
	{
		if(response)
		{
			if(listitem == 0) // SFPD
			{
		  	SetPlayerPos(playerid,246.40,110.84,1003.22);
		  SetPlayerInterior(playerid,10);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 1) // LSPD
			{
		  	SetPlayerPos(playerid,246.6695, 65.8039, 1003.6406);
		  SetPlayerInterior(playerid,6);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 2) // LVPD
			{
		  	SetPlayerPos(playerid,288.4723, 170.0647, 1007.1794);
		  SetPlayerInterior(playerid,3);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 3) // Planning Department(CITY HALL)
			{
		  	SetPlayerPos(playerid,386.5259, 173.6381, 1008.3828);
		  SetPlayerInterior(playerid,3);
		  GivePlayerMoney(playerid, -1000);
			}
			if(listitem == 4) // Back
			{
			ShowPlayerDialog(playerid, INTERIORMENU, DIALOG_STYLE_LIST, "Teleports Location","Bank\nAirports\nAmmunations\nGarages\nDepartment\nBack", "Select", "Cancel");
			}
		}
		return 1;
	}
	return 0;
 }
 
public OnFilterScriptExit()
{
	return 1;
}
Reply
#6

Thats not the way i'd want to put it up but
guess you have to

pawn Код:
if(dialogid == INTERIORMENU)
    {
        if(response)
        {
            if(listitem == 0) // Banks
            {
            ShowPlayerDialog(playerid, INTERIORMENU+1, DIALOG_STYLE_LIST, "Bank", "Bank 1 \nBank 2 \nBank 3 \nBank 4 \nBank 5 \nBank 6 \nBack", "Select", "Cancel");
            }
            if(listitem == 1) // Airports
            {
            ShowPlayerDialog(playerid, INTERIORMENU+2, DIALOG_STYLE_LIST, "Airport Interiors", "Las Venturas Airport \nLas Santos Airport \nSan Fierro Airport \nBack", "Select", "Cancel");
            }
            if(listitem == 2) // Ammunations
            {
      ShowPlayerDialog(playerid, INTERIORMENU+3, DIALOG_STYLE_LIST, "Ammunation Interiors", "Ammunation 1 \nAmmunation 2 \nAmmunation 3 \nAmmunation 4 \nAmmunation 5 \nBack", "Select", "Cancel");
            }
            if(listitem == 3) // Garages
            {
            ShowPlayerDialog(playerid, INTERIORMENU+4, DIALOG_STYLE_LIST, "Mod Shops/Garages","Loco Low Co. \nWheel Arch Angels \nTransfender \nDoherty Garage \nBack", "Select", "Cancel");
            }
            if(listitem == 4) // Departements
            {
            ShowPlayerDialog(playerid, INTERIORMENU+5, DIALOG_STYLE_LIST, "Departments","SF Police Department \nLS Police Department \nLV Police Department \nPlanning Department\nBack", "Select", "Cancel");
            }
            if(listitem == 5) // Back
            {
            ShowPlayerDialog(playerid, INTERIORMENU, DIALOG_STYLE_LIST, "Teleports Location","24/7's\nAirports\nAmmunations\nGarages\nDepartment\nBack", "Select", "Cancel");
            }
         }
         else
         {
            SendClientMessage(playerid, COLOR, "Menu have been closed");
         }
         return 1;
    }
Reply
#7

thank you i will try, well it doesnt work. But it works on my friends computer.
Reply
#8

mm, lol. then it could be a mistake futher in the script. remember to make what i did in all your dialogs, else it wont work
Reply
#9

ok thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)