04.02.2015, 19:03
Код:
new PhoneName[][] = { {"Nokia 203", 500}, {"Nokia Lumia 610", 2000}, {"Sony Xperia Ion", 1700}, {"Samsung Galaxy S4", 3500}, {"Samsung Galaxy Nexus", 3400}, {"HTC Desire X", 2900}, {"Apply iPhone 5S", 5000}, {"Huawei Y200", 1500}, {"Apple iPhone 6", 6000}, {"Samsung Galaxy S5", 5500}, {"Nokia Lumia 900", 2800}, {"Nokia N9", 2100} };
Код:
CMD:buy(playerid, params[]) { new string[128]; if(IsPlayerInRangeOfPoint(playerid, 1.0, -2286.1260,-155.3922,3346.8701)) { new price[ sizeof(PhoneName) ]; for(new p; p < sizeof(PhoneName); p++) { price[p] = PhoneName[p][1]; } format(string, sizeof(string), "%s\n%s ($%d)", string, PhoneName[p][0], price[p]); return ShowPlayerDialog(playerid, DIALOG_TMOBILE, DIALOG_STYLE_LIST, "T-Mobile list", string, "Select", "Cancel"); } return 1; }
I have never used this array style, i tried myelf but the phone prices aren't correct, please help me out +REP