Problem with dialogs?
#1

I'm having a problem with dialogs. In my way i know i'm doing it right but it will still not work. This is a dialog that spawn cars, if you have a head with a brain somewhere on your body you should be able to see that it spawn cars:P
Код:
// i dont see a problem in here. Complies fine and should work in teori. But it's not working:(

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/vehicles", cmdtext, true, 10) == 0)
	{
		new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
	   	ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," NDRv1.0 Vehicles",allvehicles,"Select","Cancel");
		return 1;
	}
	return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new Float: X, Float: Y, Float: Z;
    GetPlayerPos(playerid,X,Y,Z);
	if(dialogid == 2)
	{
		if(response)
		{
			if(listitem == 0)
			{
			    new allvehicles[] = "1\tAndromada\n2\tAT-400\n3\tBeagle\n4\tCropduster\n5\tDodo\n6\tHydra\n7\tNevada\n8\tRustler\n9\tShamal\n10\tSkimmer\n11\tStunt Plane";
	    		ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"NDRv1.0 Vehicles Airplanes",allvehicles,"Select","Cancel");
	    	}
	    	else if(listitem == 1)
			{
			    new allvehicles[] = "1\tCargobob\n2\tHunter\n3\tLeviathan\n4\tMaverick\n5\tNews Maverick\n6\tPolice Maverick\n7\tRaindance\n8\tSeasparrow\n9\tSparrow";
	    		ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"NDRv1.0 Vehicles Helicopters",allvehicles,"Select","Cancel");
			}
			else if(listitem == 2)
			{
			    new allvehicles[] = "1\tBF-400\n2\tBike\n3\tBMX\n4\tFaggio\n5\tFCR-900\n6\tFreeway\n7\tMountain Bike\n8\tNRG-500\n9\tPCJ-600\n10\tPizzaBoy\n11\tQuad\n12\tSanchez\n13\tWayfarer";
	    		ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"NDRv1.0 Vehicles Bikes",allvehicles,"Select","Cancel");
			}
			else if(listitem == 3)
			{
			    new allvehicles[] = "1\tComet\n2\tFeltzer\n3\tStallion\n4\tWindsor";
	    		ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Convertibles:",allvehicles,"Select","Cancel");
			}
			else if(listitem == 4)
			{
			    new allvehicles[] = "1\tBenson\n2\tBobcat\n3\tBurrito\n4\tBoxville\n5\tBoxburg\n6\tCement Truck\n7\tDFT-300\n8\tFlatbed\n9\tLinerunner\n10\tMule\n11\tNews Van\n12\tPacker\n13\tPetrol Tanker\n14\tPicador\n15\tPony\n16\tRoad Train\n17\tRumpo\n18\tSadler\n19\tSadler Shit( Ghost Car )\n20\tTopfun\n21\tTractor\n22\tTrashmaster\n23\tUitlity Van\n24\tWalton\n25\tYankee\n26\tYosemite";
	    		ShowPlayerDialog(playerid,7,DIALOG_STYLE_LIST,"Industrial Vehicles:",allvehicles,"Select","Cancel");
			}
			else if(listitem == 5)
			{
			    new allvehicles[] = "1\tBlade\n2\tBroadway\n3\tRemington\n4\tSavanna\n5\tSlamvan\n6\tTahoma\n7\tTornado\n8\tVoodoo";
	    		ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"Lowriders:",allvehicles,"Select","Cancel");
			}
			else if(listitem == 6)
			{
			    new allvehicles[] = "1\tBandito\n2\tBF Injection\n3\tDune\n4\tHuntley\n5\tLandstalker\n6\tMesa\n7\tMonster Truck\n8\tMonster Truck 'A'\n9\tMonster Truck 'B'\n10\tPatriot\n11\tRancher 'A'\n12\tRancher 'B'\n13\tSandking";
	    		ShowPlayerDialog(playerid,9,DIALOG_STYLE_LIST,"NDRv1.0 Vehicles Off Road Vehicles",allvehicles,"Select","Cancel");
			}
			else if(listitem == 7)
			{
			    new allvehicles[] = "1\tAmbulance\n2\tBarracks\n3\tBus\n4\tCabbie\n5\tCoach\n6\tHPV-1000 ( Cop Bike )\n7\tEnforcer\n8\tF.B.I Rancher\n9\tF.B.I Truck\n10\tFiretruck\n11\tFireTruck LA\n12\tPolice Car ( LSPD )\n13\tPolice Car ( LVPD )\n14\tPolice Car ( SFPD )\n15\tRanger\n16\tS.W.A.T\n17\tTaxi\n18\n18Rhino";
	    		ShowPlayerDialog(playerid,10,DIALOG_STYLE_LIST,"NDRv1.0 Vehicles Public Service Vehicles",allvehicles,"Select","Cancel");
			}
			else if(listitem == 8)
			{
			    new allvehicles[] = "1\tAdmiral\n2\tBloodring Banger\n3\tBravura\n4\tBuccaneer\n5\tCadrona\n6\tClover\n7\tElegant\n8\tElegy\n9\tEmperor\n10\tEsperanto\n11\tFortune\n12\tGlendale Shit ( Ghost Car )\n13\tGlendale\n14\tGreenwood\n15\tHermes\n16\tIntruder\n17\tMajestic\n18\tMananal\n19\tMerit\n20\tNebula\n21\tOceanic\n22\tPremier\n23\tPrevion\n24\tPrimo\n25\tSentinel\n26\tStafford\n27\tSultan \n28\tSunrise\n29\tTampa\n30\tVicent\n31\tVirgo\n32\tWillard\n33\tWashington";
	    		ShowPlayerDialog(playerid,11,DIALOG_STYLE_LIST,"NDRv1.0 Vehicles Saloons Vehicles",allvehicles,"Select","Cancel");
			}
			else if(listitem == 9)
			{
			    new allvehicles[] = "1\tAlpha\n2\tBanshee\n3\tBlista Compact\n4\tBuffalo\n5\tBullet\n6\tCheetah\n7\tClub\n8\tEuros\n9\tFlash\n10\tHotring Racer 'A'\n11\tHotring Racer 'B'\n12\tHotring Racer 'C'\n13\tInfernus\n14\tJester\n15\tPhoenix\n16\tSabre\n17\tSuper GT\n18\tTurismo\n19\tUranus\n20\tZR-350";
	    		ShowPlayerDialog(playerid,12,DIALOG_STYLE_LIST,"NDRv1.0 Vehicles Sport Vehicles",allvehicles,"Select","Cancel");
			}
			else if(listitem == 10)
			{
			    new allvehicles[] = "1\tMoonbeam\n2\tPerenniel\n3\tRegina\n4\tSolair\n5\tStratum";
	    		ShowPlayerDialog(playerid,13,DIALOG_STYLE_LIST,"NDRv1.0 Vehicles Station Wagons ",allvehicles,"Select","Cancel");
			}
			else if(listitem == 11)
			{
			    new allvehicles[] = "1\tCoastguard\n2\tDinghy\n3\tJetmax\n4\tLaunch\n5\tMarquis\n6\tPredator\n7\tReefer\n8\tSpeeder\n9\tSquallo\n10\tTropic";
	    		ShowPlayerDialog(playerid,14,DIALOG_STYLE_LIST,"NDRv1.0 Vehicles Boats",allvehicles,"Select","Cancel");
			}
			else if(listitem == 12)
			{
			    new allvehicles[] = "1\tBaggage\n2\tCaddy\n3\tCamper 'A'\n4\tCamper 'B'\n5\tCobine Harvester\n6\tDozer\n7\tDumper\n8\tForklift\n9\tHotknife\n10\tHustler\n11\tHotdog\n12\tKart\n13\tMower\n14\tMr. Whoopee\n15\tRomero\n16\tSecuricar\n17\tStretch\n18\tSweeper\n19\tTowtruck\n20\tTug\n21\tVortex";
	    		ShowPlayerDialog(playerid,15,DIALOG_STYLE_LIST,"NDRv1.0 Vehicles Unique",allvehicles,"Select","Cancel");
			}
			else if(listitem == 13)
			{
			    new allvehicles[] = "1\tRC Bandit\n2\tRC Baron\n3\tRC Raider'\n4\tRC Goblin'\n5\tRC Tiger\n6\tRC Cam";
	    		ShowPlayerDialog(playerid,16,DIALOG_STYLE_LIST,"NDRv1.0 RC",allvehicles,"Select","Cancel");
			}
			else if(listitem == 14)
			{
			    new allvehicles[] = "1\tArticle Trailer\n2\tArticle Trailer 2\n3\tArticle Trailer 3'\n4\tBaggage Trailer 'A''\n5\tBaggage Trailer 'B'\n6\tFarm Trailer\n7\tFreight Frat Trailer(Train)\n8\tFreight Box Trailer(Train)\n9\tPetrol Trailer\n10\tStreak Trailer(Train)\n11\tStairs Trailer\n12\tUitlity Trailer";
	    		ShowPlayerDialog(playerid,17,DIALOG_STYLE_LIST,"NDRv1.0 Vehicles Trailers",allvehicles,"Select","Cancel");
			}
		}
	}
	else if(dialogid == 3)// Airplanes
	{
	    if(response)
		{
			if(listitem == 0)
			{
			    PutPlayerInVehicle(playerid,CreateVehicle(592,X,Y,Z,0,-1,-1,-1),0);
			}
			else if(listitem == 1)
			{
			    PutPlayerInVehicle(playerid,CreateVehicle(577,X,Y,Z,0,-1,-1,-1),0);
			}
			else if(listitem == 2)
			{
			    PutPlayerInVehicle(playerid,CreateVehicle(511,X,Y,Z,0,-1,-1,-1),0);
			}
			else if(listitem == 3)
			{
			    PutPlayerInVehicle(playerid,CreateVehicle(512,X,Y,Z,0,-1,-1,-1),0);
			}
			else if(listitem == 4)
			{
			    PutPlayerInVehicle(playerid,CreateVehicle(593,X,Y,Z,0,-1,-1,-1),0);
			}
			else if(listitem == 5)
			{
			    PutPlayerInVehicle(playerid,CreateVehicle(520,X,Y,Z,0,-1,-1,-1),0);
			}
			else if(listitem == 6)
			{
			    PutPlayerInVehicle(playerid,CreateVehicle(553,X,Y,Z,0,-1,-1,-1),0);
			}
			else if(listitem == 7)
			{
			    PutPlayerInVehicle(playerid,CreateVehicle(476,X,Y,Z,0,-1,-1,-1),0);
			}
			else if(listitem == 8)
			{
			    PutPlayerInVehicle(playerid,CreateVehicle(510,X,Y,Z,0,-1,-1,-1),0);
			}
			else if(listitem == 9)
			{
			    PutPlayerInVehicle(playerid,CreateVehicle(460,X,Y,Z,0,-1,-1,-1),0);
			}
			else if(listitem == 10)
			{
			    PutPlayerInVehicle(playerid,CreateVehicle(513,X,Y,Z,0,-1,-1,-1),0);
			}
		}
	return 1;
}
If anyone could see something wrong here please tell me. But i still dont know why this dont work? Maybe a dialog bug or something but if anyone knows tell me.
Reply
#2

See, if your dialogue appears when you type a command and then when you click on one of the options and it disappears right? if that is the problem then you must put your filterscript in the beginning of all.

in server.cgf you will find a filterscript line it might have your own filterscripts now what you have to do is move the dialogue filterscript in the beginning of all the filterscripts and give it a try.

eg: filterscripts dialoguefs 1

Sometimes the dialogue id's get conflict with each other and they stop working.

-FalconX
Reply
#3

Are you getting the dialogs?
Reply
#4

Yes but when i press a listitem the new dialog wont show! It kinda looks like the ShowPlayerDialog does not getting triggered when i press the listitem
Reply
#5

Quote:
Originally Posted by HDFord
Посмотреть сообщение
Yes but when i press a listitem the new dialog wont show! It kinda looks like the ShowPlayerDialog does not getting triggered when i press the listitem
Basically your OnDialogResponse callback is not being called, i would suggest you to define your dialogs with unique dialog ids.
Reply
#6

If this is in a filterscript, you must have return 0 instead of return 1 at the end of all of your other scripts' OnDialogResponse.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)