01.10.2015, 19:14
Код:
CMD:taller(playerid, params[]) { if (GetFactionType(playerid) != FACTION_MECANICO) return SendErrorMessage(playerid, "No perteneces a la facciуn mecбnicos."); new vehicleid = GetNearestVehicle(playerid); if (vehicleid == INVALID_VEHICLE_ID) return SendErrorMessage(playerid, "Debes estar cerca de un vehнculo."); if (TALLER_Nearest(playerid) == -1) return SendErrorMessage(playerid, "No estбs cerca de ningъn punto de taller."); Dialog_Show(playerid, TuneVehicle, DIALOG_STYLE_LIST, "Tбller mecбnico", "Llantas\nNitrogeno\nHidraulicos", "Seleccionar", "Cancelar"); return 1; }
Код:
Dialog:TuneVehicle(playerid, response, listitem, inputtext[]) { new vehicleid = GetNearestVehicle(playerid) || TALLER_Nearest(playerid) || GetPlayerVehicleID(playerid); if (vehicleid == INVALID_VEHICLE_ID) return 0; if (response) { switch (listitem) { case 0: ShowModelSelectionMenu(playerid, "Que ruedas buscas", MODEL_SELECTION_WHEELS, {1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1096, 1097, 1098}, 17, 0.0, 0.0, 90.0); case 1: Dialog_Show(playerid, AddNOS, DIALOG_STYLE_LIST, "Aсadir Nitrogeno", "2x NOS\n5x NOS\n10x NOS", "Selecionar", "Cancelar"); case 2: { AddComponent(vehicleid, 1087); SendServerMessage(playerid, "Agregaste hydraulicos al vehнculo."); } } } return 1; } Dialog:AddNOS(playerid, response, listitem, inputtext[]) { new vehicleid = GetNearestVehicle(playerid) || TALLER_Nearest(playerid) || GetPlayerVehicleID(playerid); if (vehicleid == INVALID_VEHICLE_ID) return 0; if (response) { switch (listitem) { case 0: { AddComponent(vehicleid, 1009); SendServerMessage(playerid, "Aсadiste 2x de nitrуgeno."); } case 1: { AddComponent(vehicleid, 1008); SendServerMessage(playerid, "Aсadiste 5x de nitrуgeno."); } case 2: { AddComponent(vehicleid, 1010); SendServerMessage(playerid, "Aсadiste 10x de nitrуgeno."); } } } return 1; }