Пытаюсь сделать всплывающее меню для тюннинга авто на месте. Меню-то врубается,но не один из пунктов не работает. Как это исправить? И можно ли в начале меню не писать по сто раз название раздела (типо,как с "PaintJob (500$)")?
Код:
paint = CreateMenu("Tunning", 2, 200.0, 100.0, 150.0, 150.0); AddMenuItem(paint, 0, "PaintJob (500$)"); AddMenuItem(paint, 0, "PaintJob (500$)"); AddMenuItem(paint, 0, "PaintJob (500$)"); AddMenuItem(paint, 0, "Wheels (1000$)"); AddMenuItem(paint, 0, "Wheels (1000$"); AddMenuItem(paint, 0, "Nitro/Hydralics (1000$)"); AddMenuItem(paint, 0, "Nitro/Hydralics (1000$)"); AddMenuItem(paint, 1, "First Paintjob"); AddMenuItem(paint, 1, "Second Paintjob"); AddMenuItem(paint, 1, "Third Paintjob"); AddMenuItem(paint, 1, "First Wheels"); AddMenuItem(paint, 1, "Second Wheels"); AddMenuItem(paint, 1, "Nitro x10"); AddMenuItem(paint, 1, "Hydralics");
Код:
public OnPlayerSelectedMenuRow(playerid, row) { new Menu:Currentmenu = GetPlayerMenu(playerid); TogglePlayerControllable(playerid, 1); if(Currentmenu == paint) { switch(row) { case 0: //First paintjob { ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),0); GivePlayerMoney(playerid, -500); SendClientMessage(playerid,0x33AA33AA,"Ваш автомобиль перекрашен!"); } case 1: //Second paintjob { ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),1); GivePlayerMoney(playerid, -500); SendClientMessage(playerid,0x33AA33AA,"Ваш автомобиль перекрашен!"); } case 2: //Third paintjob { ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),2); GivePlayerMoney(playerid, -500); SendClientMessage(playerid,0x33AA33AA,"Ваш автомобиль перекрашен!"); } case 3: //First Wheels { GivePlayerMoney(playerid, -1000); SendClientMessage(playerid,0x33AA33AA,"Новые колесы успешно установленны!"); AddVehicleComponent(1,1079); //Wheels } case 4: //First Wheels { GivePlayerMoney(playerid, -1000); SendClientMessage(playerid,0x33AA33AA,"Новые колесы успешно установленны!"); AddVehicleComponent(2,1079); //Wheels } case 5: //Nitro { GivePlayerMoney(playerid, -1000); SendClientMessage(playerid,0x33AA33AA,"Нитро на 10 баллонов установленно!"); AddVehicleComponent(13,1010); //Nitro } case 6: //Hydralics { GivePlayerMoney(playerid, -1500); SendClientMessage(playerid,0x33AA33AA,"Гидравлическая подвеска успешно установленна!"); AddVehicleComponent(13,1087); //Hydralics } } } }
Отредактировано alcatraz (2008-01-19 23:16:59)