new VehiclePrices[47][47] =
{
// {model, price}
{400, 40000}, //Landstalker
{600, 44000}, //Picador
{602, 60500} //Alpha
};
stock ShowVehicleDialog(playerid)
{
for ( new i = 0; i < sizeof(VehiclePrices); i++ )
{
new vid = GetPlayerVehicleID(playerid), model = GetVehicleModel(vid);
new price = VehiclePrices[i][1];
new str[256];
format(str, sizeof(str), "%s %d "COL_DGREEN"$%d", VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400], model, FormatNumber(price);
Dialog_Show(playerid, BUYVEHICLE, DIALOG_STYLE_LIST, str,"Test", "Seз", "İptal");
}
return 1;
}
|
new VehiclePrices[47][2] |
stock ShowVehicleDialog(playerid)
{
new model = GetVehicleModel(GetPlayerVehicleID(playerid)), found = -1;
for ( new i = 0; i < sizeof(VehiclePrices); i++ )
{
if(model == VehiclePrices[i][0])
{
found = i;
break;
}
}
new str[100];
if(found == -1)str = "Model not found";
//note the difference in format parameters in next line
else format(str, sizeof(str), "%s %d "COL_DGREEN"$%d", VehicleNames[model-400], model, FormatNumber(VehiclePrices[found][1]));
Dialog_Show(playerid, BUYVEHICLE, DIALOG_STYLE_LIST, str,"Test", "Seз", "İptal");
return 1;
}
new VehiclePrices[47][2] =
{
// {model, price}
{400, 40000}, //Landstalker
{401, 36000}, //Bravura
{402, 125000}, //Buffalo
{404, 18000}, //Perenial
{410, 14500}, //Manana
{412, 40000}, //VooDoo
{418, 20000}, //Moonbeam
{419, 54000}, //Esperanto
{422, 48000}, //Bobcat
{436, 35000}, //Previon
{445, 60000}, //Admiral
{458, 60000}, //Solair
{466, 38000}, //Glendale
{467, 50500}, //Oceanic
{474, 48000}, //Hermes
{475, 56000}, //Sabre
{478, 20000}, //Walton
{479, 40000}, //Regina
{482, 54000}, //Burrito
{489, 52000}, //Rancher
{491, 46500}, //Virgo
{492, 46000}, //Greenwood
{496, 42000}, //BlistaC
{500, 54000}, //Mesa
{516, 38000}, //Nebula
{517, 40500}, //Majestic
{518, 42000}, //Buccaneer
{526, 39500}, //Fortune
{527, 28500}, //Cadrona
{529, 50000}, //Willard
{534, 66000}, //Remington
{536, 54000}, //Blade
{542, 19000}, //Clover
{543, 30000}, //Sadler
{546, 45500}, //Intruder
{547, 44500}, //Primo
{549, 19500}, //Tampa
{551, 44000}, //Merit
{554, 58000}, //Yosemite
{566, 48000}, //Tahoma
{567, 50000}, //Savanna
{576, 36000}, //Tornado
{579, 70000}, //Huntley
{585, 80000}, //Emperor
{589, 63000}, //Club
{600, 44000}, //Picador
{602, 60500} //Alpha
};
stock FormatNumber(Float:amount)
{
new str[16];
format(str, sizeof(str), "%d", floatround(amount));
new l = strlen(str);
if (amount < 0) // -
{
if (l > 4) strins(str, ",", l-3);
if (l > 7) strins(str, ",", l-6);
if (l > 10) strins(str, ",", l-9);
}
else
{
if (l > 3) strins(str, ",", l-3);
if (l > 6) strins(str, ",", l-6);
if (l > 9) strins(str, ",", l-9);
}
return str;
}