SA-MP Forums Archive
Dialog Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog Problem (/showthread.php?tid=427669)



Dialog Problem - yaron0600 - 02.04.2013

Код:
	else if(dialogid == Private_Name)
	{
	    if(response)
	    {
	        if(PlayerInfo[playerid][pConnectHours] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are currently restricted from possessing weapons!");
			new CrateID = GetPVarInt(playerid, "CrateGuns_CID");
			switch(listitem)
			{ //Desert Eagle\nSPAS-12\nMP5\nM4A1\nAK-47\nSniper Rifle\nShotgun
				/*
			    Deagle - 4
				Spas - 8
				AK-47 - 5
				M4    - 6
				Sniper Rifle - 5
				MP5 - 5
				*/

			    case 0: // CRATE GUNS
				{
					GivePlayerValidWeapon(playerid, 24, 99999);
					CrateInfo[CrateID][GunQuantity]--;
				}
				case 1: // CRATE GUNS
				{
					GivePlayerValidWeapon(playerid, 27, 99999);
					CrateInfo[CrateID][GunQuantity]--;
				}
				case 2: // CRATE GUNS
				{
					GivePlayerValidWeapon(playerid, 29, 99999);
					CrateInfo[CrateID][GunQuantity]--;
				}
				case 3: // CRATE GUNS
				{
					GivePlayerValidWeapon(playerid, 31, 99999);
					CrateInfo[CrateID][GunQuantity]--;
				}
				case 4: // CRATE GUNS
				{
					GivePlayerValidWeapon(playerid, 30, 99999);
					CrateInfo[CrateID][GunQuantity]--;
				}
				case 5: // CRATE GUNS
				{
					GivePlayerValidWeapon(playerid, 34, 99999);
					CrateInfo[CrateID][GunQuantity]--;
				}
				case 6: // CRATE GUNS
				{
					GivePlayerValidWeapon(playerid, 25, 99999);
					CrateInfo[CrateID][GunQuantity]--;
				}
			}
			format(string, sizeof(string), "Serial Number: %d\nCapacity: %d/50", CrateID, CrateInfo[CrateID][GunQuantity]);
			UpdateDynamic3DTextLabelText(CrateInfo[CrateID][crLabel], COLOR_ORANGE, string);
	    }

And if I remove this lines thats compile with errors :

Код:
			new CrateID = GetPVarInt(playerid, "CrateGuns_CID");
			switch(listitem)
When I try compile it the Pawno is stuck... WhY!?


Re: Dialog Problem - L.Hudson - 02.04.2013

Did you define the Private_Name dialog?


Re: Dialog Problem - yaron0600 - 02.04.2013

Yeah


Re: Dialog Problem - MrTinder - 02.04.2013

don't remove
Код:
switch(listitem)