Dialog carbuy
#1

Problem: when i click on a vehicle i get the info for a premium vehicle not an expensive vehicle.

The price of premium vehicles are >= 10000000 and at expensive vehicles are <= 300000

The vehicles with price more ethan 6000 have id >= 63 & <= 96.

Dialog to carbuy4:
Код:
new stringzz[MAX_STRING],stringy[MAX_STRING];
				for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
				{
				    if(Stock[xf][vPrice] >= 6001 && Stock[xf][vPrice] < 310000)
				    {
						format(stringy, sizeof(stringy), "%s (%s de lei) - %d in stoc\n", Stock[xf][vName], FormatNumber(Stock[xf][vPrice]), Stock[xf][vStock]);
  						strcat(stringzz,stringy);
					}
				}
			    ShowPlayerDialog(playerid, DIALOG_CARBUY4, DIALOG_STYLE_LIST, "Vehicule", stringzz, "Alege", "Anuleaza")
Dialog carbuy4:
Код:
if(dialogid == DIALOG_CARBUY4)
	{
	    if(response)
        {
	    	new regcheapcars;
	    	for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
			{
			    if(Stock[xf][vPrice] > 59999 && Stock[xf][vPrice] <= 300000)
			    {
       				regcheapcars = xf;
				}
			}
			new num = listitem + regcheapcars + 1;
   			BuyCar[playerid] = num;
			new string33[256], stringtitle[256];
			format(stringtitle, sizeof(stringtitle), "%s (%s de lei)", Stock[num][vName], FormatNumber(Stock[num][vPrice]));
			format(string33, sizeof(string33), "Nume: %s\nPret: %s\nStoc: %d\nViteza maxima: %s km/h", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock], FormatNumber(Stock[num][vSpeed]));
			ShowPlayerDialog(playerid, DIALOG_CARBUY5, DIALOG_STYLE_MSGBOX, stringtitle, string33, "Cumpara", "Inapoi");
		}
		return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)