Problem dialog
#1

Hi all, i have a problem with dialog from portbagage system.
My command and dialog:

Код:
 CMD:v(playerid, params)
{
	
	if(P_DATA[playerid][pCarKey][1] == 0 || P_DATA[playerid][pCarKey][2] == 0 || P_DATA[playerid][pCarKey][3] == 0)
			return SCM(playerid, Red, "You  don't have personal vehicle!");
			
	new string[60];
	for(new key = 1; key <= 3; key++)
	{
		foreach(new i : Vehicles)
		{
			if(P_DATA[playerid][pCarKey][key] == 0)
				continue;
			
			if ( P_DATA[playerid][pCarKey][key] == AutoData[i][cID] ) 
			{  
				format(string, sizeof(string), "%s%s:(%d)\n", string, vehName[AutoData[i][cModel] - 400], AutoData[i][cID]);
				ShowPlayerDialog(playerid, DIALOG_VEHICLES, DIALOG_STYLE_LIST, "Cars", string, "OK", "Exit");
			}
		}
	}
	return 1;
}
Код:
case DIALOG_VEHICLES:
		{
			new idx = 0, string[10];
			for(new i = 0; i <= 4; i++)
			{
				if(idx++ == listitem)
				{
					foreach(new v: Vehicles)
					{
						if(P_DATA[playerid][pCarKey][i] == AutoData[v][cID])
						{
							format(string, sizeof(string), "%s", vehName[AutoData[v][cModel] - 400]);
							SCM(playerid, Verde, string);
						}
						else continue;
					}
				}
			}
		}
The problem is that if we did not slot 1 or 2 on the vehicle and on the other we can not select the vehicle , rustle . If it works in perfect order .
Reply
#2

someone?
Reply
#3

so, my problem is with show vehicle in dialog_STYLE_LIST. If i don't have vehicle on slot 1 or 2 and i have vehicle in the other not working. If i have vehicle on slot 1,2 or 3 in that order work perfect.
Reply
#4

Just format the string if there is no vehicle and call it "No Vehicle". With "inputtext" you can find out if the text of the listitem he selected is "No Vehicle". If yes, just reshow the dialog or close it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)