Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(dialogid == DIALOG_NOSTOCK)
- {
- if(response)
- {
- hidePlayerDialog(playerid);
- BuyCar[playerid] = 0;
- }
- return 1;
- }
- if(dialogid == DIALOG_CARBUY5)
- {
- if(response)
- {
- new num = BuyCar[playerid];
- if(GetPlayerCash(playerid) >= Stock[num][vPrice])
- {
- if(Stock[num][vStock] > 0)
- {
- InsertCar(playerid,num,0);
- }
- else
- {
- new stringg[MAX_STRING];
- format(stringg,sizeof(stringg),"Aceasta masina nu mai este disponibila in Dealership. Stoc epuizat.\nYou can't buy this vehicle from the dealership. Out of stock.");
- ShowPlayerDialog(playerid, DIALOG_NOSTOCK, DIALOG_STYLE_MSGBOX, "Out of stock", stringg, "Close","");
- }
- }
- else return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this vehicle.");
- }
- else
- {
- BuyCar[playerid] = -1;
- ShowPlayerDialog(playerid,DIALOG_CARBUY, DIALOG_STYLE_LIST, "Buy a car", "Cheap cars\nRegular cars\nExpensive cars\nPremium cars", "Select", "Close");
- }
- }
- if(dialogid == DIALOG_CARBUY2)
- {
- if(response)
- {
- new num = listitem + 1;
- BuyCar[playerid] = num;
- new string33[256], stringtitle[256];
- format(stringtitle, sizeof(stringtitle), "%s ($%s) - %d available", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock]);
- format(string33, sizeof(string33), "Vehicle name: %s\nVehicle price: %s\nNumber of cars available: %d\nTop speed: %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, "Buy car", "Back");
- }
- return 1;
- }
- if(dialogid == DIALOG_CARBUY3)
- {
- if(response)
- {
- new cheapcars;
- for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
- {
- if(Stock[xf][vPrice] > 0 && Stock[xf][vPrice] <= 7000000)
- {
- cheapcars = xf;
- }
- }
- new num = listitem + cheapcars + 1;
- BuyCar[playerid] = num;
- new string33[256], stringtitle[256];
- format(stringtitle, sizeof(stringtitle), "%s ($%s) - %d available", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock]);
- format(string33, sizeof(string33), "Vehicle name: %s\nVehicle price: %s\nNumber of cars available: %d\nTop speed: %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, "Buy car", "Back");
- }
- return 1;
- }
- if(dialogid == DIALOG_CARBUY4)
- {
- if(response)
- {
- new regcheapcars;
- for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
- {
- if(Stock[xf][vPrice] > 7000000 && Stock[xf][vPrice] <= 19999999)
- {
- regcheapcars = xf;
- }
- }
- new num = listitem + regcheapcars + 1;
- BuyCar[playerid] = num;
- new string33[256], stringtitle[256];
- format(stringtitle, sizeof(stringtitle), "%s ($%s) - %d available", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock]);
- format(string33, sizeof(string33), "Vehicle name: %s\nVehicle price: %s\nNumber of cars available: %d\nTop speed: %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, "Buy car", "Back");
- }
- return 1;
- }
- if(dialogid == DIALOG_CARBUY)
- {
- if(response)
- {
- if(listitem == 0)
- {
- new stringzz[MAX_STRING],stringy[MAX_STRING];
- for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
- {
- if(Stock[xf][vPrice] > 0 && Stock[xf][vPrice] <= 7000000)
- {
- format(stringy, sizeof(stringy), "%s ($%s) - %d in stock\n", Stock[xf][vName], FormatNumber(Stock[xf][vPrice]), Stock[xf][vStock]);
- strcat(stringzz,stringy);
- }
- }
- ShowPlayerDialog(playerid, DIALOG_CARBUY2, DIALOG_STYLE_LIST, "Buy a car", stringzz, "Select", "Close");
- }
- if(listitem == 1)
- {
- new stringzz[MAX_STRING],stringy[MAX_STRING];
- for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
- {
- if(Stock[xf][vPrice] > 7000000 && Stock[xf][vPrice] <= 19999999)
- {
- format(stringy, sizeof(stringy), "%s ($%s) - %d in stock\n", Stock[xf][vName], FormatNumber(Stock[xf][vPrice]), Stock[xf][vStock]);
- strcat(stringzz,stringy);
- }
- }
- ShowPlayerDialog(playerid, DIALOG_CARBUY3, DIALOG_STYLE_LIST, "Buy a car", stringzz, "Select", "Close");
- }
- if(listitem == 2)
- {
- new stringzz[MAX_STRING],stringy[MAX_STRING];
- for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
- {
- if(Stock[xf][vPrice] >= 20000000 && Stock[xf][vPrice] < 70000000)
- {
- format(stringy, sizeof(stringy), "%s ($%s) - %d in stock\n", Stock[xf][vName], FormatNumber(Stock[xf][vPrice]), Stock[xf][vStock]);
- strcat(stringzz,stringy);
- }
- }
- ShowPlayerDialog(playerid, DIALOG_CARBUY4, DIALOG_STYLE_LIST, "Buy a car", stringzz, "Select", "Close");
- }
- if(listitem == 3)
- {
- new string2[MAX_STRING];
- format(string2,sizeof(string2),"Sparrow - 220 premium points\nHotring Racer B - 250 premium points\nHotring Racer A - 250 premium points\nVortex - 250 premium points\nHotring Racer - 250 premium points\nMaverick - 300 premium points");
- ShowPlayerDialog(playerid, DIALOG_CARBUY8, DIALOG_STYLE_LIST, "Buy a car", string2, "Select", "Close");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_CARBUY8)
- {
- if(response)
- {
- new num = listitem + 98;
- BuyCar[playerid] = num;
- new string33[256], stringtitle[256];
- format(stringtitle, sizeof(stringtitle), "%s ($%s) - %d available", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock]);
- format(string33, sizeof(string33), "Vehicle name: %s\nVehicle price: %s\nNumber of cars available: %d\nTop speed: %s km/h", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock], FormatNumber(Stock[num][vSpeed]));
- ShowPlayerDialog(playerid, DIALOG_CARBUY9, DIALOG_STYLE_MSGBOX, stringtitle, string33, "Buy car", "Back");
- }
- return 1;
- }
- if(dialogid == DIALOG_CARBUY9)
- {
- if(response)
- {
- new num = BuyCar[playerid],price;
- if(num == 98) price = 220;
- if(num == 99) price = 250;
- if(num == 100) price = 250;
- if(num == 101) price = 250;
- if(num == 102) price = 250;
- if(num == 103) price = 300;
- if(PlayerInfo[playerid][pPremiumPoints] >= price)
- {
- if(Stock[num][vStock] > 0)
- {
- InsertCar(playerid,num,1);
- }
- else
- {
- new stringg[MAX_STRING];
- format(stringg,sizeof(stringg),"Aceasta masina nu mai este disponibila in Dealership. Stoc epuizat.\nYou can't buy this vehicle from the dealership. Out of stock.");
- ShowPlayerDialog(playerid, DIALOG_NOSTOCK, DIALOG_STYLE_MSGBOX, "Out of stock", stringg, "Close","");
- }
- }
- else return SS(playerid, COLOR_WHITE, "Nu ai suficiente puncte premium. Detalii despre punctele premium pe 127.0.0.1", "You don't have enough premium points. Details about premium points here 127.0.0.1");
- }
- else
- {
- BuyCar[playerid] = -1;
- ShowPlayerDialog(playerid,DIALOG_CARBUY, DIALOG_STYLE_LIST, "Buy a car", "Cheap cars\nRegular cars\nExpensive cars\nPremium cars", "Select", "Close");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement