29.06.2018, 16:13
Quote:
Yes, the listitem will be the array index. Additionally you could do this, to avoid writing a single case for each item. Change this:
PHP код:
PHP код:
PHP код:
|
PHP код:
case 8:
{
new price = vehList[listitem][1];
new carname = vehList[listitem][2];
new modelName[32], title[90];
format(title,sizeof(title),"{FFFFFF}Game Shop{FF0080} Available Money: %f", GetPlayerMoney(playerid);
format(modelName, sizeof(modelName), "%s {FF0080}$%s", carname, price);
ShowPlayerDialog(playerid, DIALOG_SHOPVEHICLES, DIALOG_STYLE_LIST, title, modelName, "Select", "Close");
}
PHP код:
new vehList[][] = {
//model, price, name
{481, 500, "{FFFFFF}BMX"},
{593, 125000, "{FFFFFF}Dodo"},
{587, 25000, "{FFFFFF}Euros"}
};