Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local GREEN = 'зёлен'
- local BLACK = 'чёрн'
- local WHITE = 'бел'
- local WHITENESS = 'белоснежного'
- local GREY = 'сер'
- local BEZHEV = 'бежев'
- local RED = 'красн'
- local AQUA = 'бирюзов'
- local ORANGE = 'оранжев'
- local SEREBRIST = 'серебрист'
- local DARKRED = 'бордов'
- local PURPLE = 'розов'
- local PURPURN = 'пурпурн'
- local BLUE = 'син'
- local LIGHTBLUE = 'голуб'
- local SANDLY = 'песочн'
- local BROWN = 'коричнев'
- local YELLOW = 'жёлт'
- local PINK = 'розов'
- local GOLDEN = 'золот'
- function darkly(c)
- return 'темно-' .. c
- end
- function brightly(c)
- return 'ярко-' .. c
- end
- function lightly(c)
- return 'светло-' .. c
- end
- function poison(c)
- return 'ядовито-' .. c
- end
- function bluely(c)
- return 'сине-' .. c
- end
- function greily(c)
- return 'серо-' .. c
- end
- local colorNames = {
- [0] = BLACK,
- [1] = WHITE,
- [2] = AQUA,
- [3] = RED,
- [4] = darkly(GREEN),
- [5] = PURPLE,
- [6] = YELLOW,
- [7] = BLUE,
- [8] = BEZHEV,
- [9] = GREY,
- [10] = greily(BLUE),
- [11] = SEREBRIST,
- [12] = LIGHTBLUE,
- [13] = GREY,
- [14] = WHITE,
- [15] = SEREBRIST,
- [16] = GREEN,
- [17] = RED,
- [18] = PURPLE,
- [19] = SEREBRIST,
- [20] = greily(BLUE),
- [21] = lightly(RED),
- [22] = PURPURN,
- [23] = BEZHEV,
- [24] = GREY,
- [25] = GREY,
- [26] = BEZHEV,
- [27] = GREY,
- [28] = greily(BLUE),
- [29] = BEZHEV,
- [30] = RED,
- [31] = darkly(RED),
- [32] = WHITE,
- [33] = BEZHEV,
- [34] = BEZHEV,
- [35] = BEZHEV,
- [36] = darkly(GREY),
- [37] = GREEN,
- [38] = 'салатн',
- [39] = SEREBRIST,
- [40] = BLACK,
- [41] = BEZHEV,
- [42] = RED,
- [43] = RED,
- [44] = GREEN,
- [45] = DARKRED,
- [46] = lightly(YELLOW),
- [47] = SANDLY,
- [48] = BEZHEV,
- [49] = WHITE,
- [50] = GREY,
- [51] = GREEN,
- [52] = greily(GREEN),
- [53] = BLUE,
- [54] = greily(BLUE),
- [55] = BEZHEV,
- [56] = SEREBRIST,
- [57] = GOLDEN,
- [58] = RED,
- [59] = greily(BLUE),
- [60] = BEZHEV,
- [61] = GOLDEN,
- [62] = RED,
- [63] = WHITE,
- [64] = WHITE,
- [65] = YELLOW,
- [66] = BROWN,
- [67] = GREY,
- [68] = brightly(GOLDEN),
- [69] = BEZHEV,
- [70] = RED,
- [71] = GREY,
- [72] = darkly(GREY),
- [73] = lightly(YELLOW),
- [74] = DARKRED,
- [75] = BLACK,
- [76] = 'светло-бежев',
- [77] = YELLOW,
- [78] = RED,
- [79] = BLUE,
- [80] = PURPURN,
- [81] = 'желто-зелён',
- [82] = RED,
- [83] = 'темно-сер',
- [84] = BROWN,
- [85] = BROWN,
- [86] = GREEN,
- [87] = greily(BLUE),
- [88] = DARKRED,
- [89] = BEZHEV,
- [90] = WHITE,
- [91] = GREY,
- [92] = GREY,
- [93] = AQUA,
- [94] = AQUA,
- [95] = GREY,
- [96] = BEZHEV,
- [97] = SEREBRIST,
- [98] = AQUA,
- [99] = SANDLY,
- [100] = LIGHTBLUE,
- [101] = BLACK,
- [102] = SANDLY,
- [103] = LIGHTBLUE,
- [104] = BEZHEV,
- [105] = GREY,
- [106] = BLUE,
- [107] = GOLDEN,
- [108] = LIGHTBLUE,
- [109] = GREY,
- [110] = SANDLY,
- [111] = SEREBRIST,
- [112] = GREY,
- [113] = BROWN,
- [114] = GREEN,
- [115] = PURPURN,
- [116] = greily(BLUE),
- [117] = RED,
- [118] = WHITENESS,
- [119] = BEZHEV,
- [120] = BEZHEV,
- [121] = DARKRED,
- [122] = GREY,
- [123] = BROWN,
- [124] = RED,
- [125] = BLUE,
- [126] = PURPLE,
- [127] = BLACK,
- [128] = brightly(GREEN),
- [129] = BROWN,
- [130] = AQUA,
- [131] = BROWN,
- [132] = 'красно-коричнев',
- [133] = GREEN,
- [134] = PURPLE,
- [135] = 'кораллов',
- [136] = PURPLE,
- [137] = lightly(GREEN),
- [138] = BEZHEV,
- [139] = lightly(PURPLE),
- [140] = BEZHEV,
- [141] = SANDLY,
- [142] = GOLDEN,
- [143] = PINK,
- [144] = PURPLE,
- [145] = GOLDEN,
- [146] = PURPLE,
- [147] = PURPLE,
- [148] = darkly(GREEN),
- [149] = BROWN,
- [150] = greily(GREEN),
- [151] = GREEN,
- [152] = LIGHTBLUE,
- [153] = GREEN,
- [154] = brightly(GREEN),
- [155] = AQUA,
- [156] = SANDLY,
- [157] = WHITE,
- [158] = ORANGE,
- [159] = BROWN,
- [160] = GREEN,
- [161] = PURPLE,
- [162] = BLUE,
- [163] = AQUA,
- [164] = darkly(GREEN),
- [165] = AQUA,
- [166] = AQUA,
- [167] = PURPLE,
- [168] = PURPLE,
- [169] = PURPLE,
- [170] = PURPLE,
- [171] = PURPLE,
- [172] = 'зелено-золот',
- [173] = BROWN,
- [174] = BROWN,
- [175] = RED,
- [176] = PURPLE,
- [177] = PURPLE,
- [178] = PURPLE,
- [179] = PURPLE,
- [180] = GOLDEN,
- [181] = RED,
- [182] = ORANGE,
- [183] = ORANGE,
- [184] = 'бледно-розов',
- [185] = BEZHEV,
- [186] = darkly(GREEN),
- [187] = darkly(GREEN),
- [188] = GREEN,
- [189] = GREEN,
- [190] = PURPLE,
- [191] = brightly(GREEN),
- [192] = BEZHEV,
- [193] = SEREBRIST,
- [194] = 'лимонн',
- [195] = 'лаймов',
- [196] = 'бледно-жёлт',
- [197] = GOLDEN,
- [198] = 'синеват',
- [199] = 'темно-медн',
- [200] = SANDLY,
- [201] = greily(BLUE),
- [202] = GREEN,
- [203] = greily(BLUE),
- [204] = SEREBRIST,
- [205] = darkly(BLUE),
- [206] = darkly(GREY),
- [207] = GREY,
- [208] = LIGHTBLUE,
- [209] = LIGHTBLUE,
- [210] = greily(BLUE),
- [211] = PURPURN,
- [212] = ORANGE,
- [213] = BEZHEV,
- [214] = 'медн',
- [215] = GREEN,
- [216] = brightly(BEZHEV),
- [217] = lightly(AQUA),
- [218] = lightly(PINK),
- [219] = ORANGE,
- [220] = PURPLE,
- [221] = YELLOW,
- [222] = ORANGE,
- [223] = darkly(BLUE),
- [224] = BROWN,
- [225] = 'медн',
- [226] = 'лаймов',
- [227] = GREEN,
- [228] = YELLOW,
- [229] = GREEN,
- [230] = DARKRED,
- [231] = SANDLY,
- [232] = PURPLE,
- [233] = PURPLE,
- [234] = GREEN,
- [235] = GREEN,
- [236] = bluely(GREEN),
- [237] = PURPLE,
- [238] = SANDLY,
- [239] = ORANGE,
- [240] = AQUA,
- [241] = 'лаймов',
- [242] = PURPURN,
- [243] = brightly(GREEN),
- [244] = BROWN,
- [245] = GREEN,
- [246] = LIGHTBLUE,
- [247] = GREY,
- [248] = RED,
- [249] = DARKRED,
- [250] = DARKRED,
- [251] = GREY,
- [252] = GREY,
- [253] = BEZHEV,
- [254] = GREY,
- [255] = GREY
- }
- local tCarsName = {
- 'Лэндсталкер',
- 'Бравура',
- 'Буффало',
- 'Лайнраннер',
- 'Перрениал',
- 'Сентинел',
- 'Дампер',
- 'Пожарная машина',
- 'Trashmaster',
- 'Лимузин',
- 'Манана',
- 'Инфернус',
- 'Вуду',
- 'Пони',
- 'Мул',
- 'Читах',
- 'Скорая',
- 'Левиафан',
- 'Мунбим',
- 'Эсперанто',
- 'Такси',
- 'Вашингтон',
- 'Бобкэт',
- 'Вуп',
- 'БФИнжекшн',
- 'Хантер',
- 'Премьер',
- 'Энфорсер',
- 'Секьюркар',
- 'Баньши',
- 'Предатор',
- 'Автобус',
- 'Танк',
- 'Барракс',
- 'Хоткнайф',
- 'Трейлер',
- 'Превион',
- 'Автобус',
- 'Такси',
- 'Сталлион',
- 'Румпо',
- 'RCBandit',
- 'Ромеро',
- 'Пэкер',
- 'Монстер',
- 'Адмирал',
- 'Скуало',
- 'Сиспэрроу',
- 'Пиццабой',
- 'Трамвай',
- 'Трэйлер',
- 'Туризмо',
- 'Спидир',
- 'Риивир',
- 'Тропик',
- 'Флэтбед',
- 'Янки',
- 'Кэдди',
- 'Солар',
- "Berkley'sRCVan",
- 'Скиммер',
- 'PCJ-600',
- 'мопед',
- 'Фривей',
- 'RCBaron',
- 'RCRaider',
- 'Глендэйл',
- 'Ошеаник',
- 'Санчез',
- 'Спэрроу',
- 'Патриот',
- 'Квадроцикл',
- 'Coastguard',
- 'Динги',
- 'Хермес',
- 'Сабре',
- 'Растлер',
- 'ZR-350',
- 'Валтон',
- 'Регина',
- 'Комет',
- 'BMX',
- 'Буррито',
- 'Кэмпер',
- 'Макрис',
- 'Baggage',
- 'Dozer',
- 'Маверик',
- 'NewsChopper',
- 'Ранчер',
- 'FBIRancher',
- 'Вирго',
- 'Гринвуд',
- 'Jetmax',
- 'Хотринг',
- 'Сэндкинг',
- 'Блиста',
- 'PoliceMaverick',
- 'Боксвилль',
- 'Бенсон',
- 'Меса',
- 'RCGoblin',
- 'Хотринг',
- 'Хотринг',
- 'BloodringBanger',
- 'Рэнчер',
- 'SuperGT',
- 'Элегант',
- 'Journey',
- 'Bike',
- 'MountainBike',
- 'Beagle',
- 'Cropduster',
- 'Stunt',
- 'Tanker',
- 'Roadtrain',
- 'Небула',
- 'Маджестик',
- 'Буканнер',
- 'Шамал',
- 'hydra',
- 'FCR-900',
- 'NRG-500',
- 'HPV1000',
- 'CementTruck',
- 'Эвакуатор',
- 'Фортуна',
- 'Кадрона',
- 'FBITruck',
- 'Willard',
- 'Forklift',
- 'Tractor',
- 'Combine',
- 'Feltzer',
- 'Ремингтон',
- 'Сламвэн',
- 'Блейд',
- 'Freight',
- 'Streak',
- 'Vortex',
- 'Vincent',
- 'Bullet',
- 'Clover',
- 'Sadler',
- 'Firetruck',
- 'Hustler',
- 'Intruder',
- 'Primo',
- 'Cargobob',
- 'Tampa',
- 'Sunrise',
- 'Merit',
- 'Utility',
- 'Nevada',
- 'Йосемэйт',
- 'Виндсор',
- 'Monster',
- 'Monster',
- 'Уранус',
- 'Джестер',
- 'Султан',
- 'Стратум',
- 'Элегия',
- 'Рэйнденс',
- 'RCTiger',
- 'Флеш',
- 'Тахома',
- 'Savanna',
- 'Bandito',
- 'FreightFlat',
- 'StreakCarriage',
- 'Kart',
- 'Mower',
- 'Dune',
- 'Sweeper',
- 'Broadway',
- 'Tornado',
- 'AT-400',
- 'DFT-30',
- 'Хантли',
- 'Stafford',
- 'BF-400',
- 'NewsVan',
- 'Tug',
- 'Трейлер',
- 'Emperor',
- 'Wayfarer',
- 'Euros',
- 'Hotdog',
- 'Club',
- 'FreightBox',
- 'Trailer',
- 'Andromada',
- 'Dodo',
- 'RCCam',
- 'Launch',
- 'Машина ЛСПД',
- 'Машина СФПД',
- 'Машина ЛВПД',
- 'Полицейский рейнджер',
- 'Пикадор',
- 'S.W.A.T',
- 'Альфа',
- 'Феникс',
- 'GlendaleShit',
- 'SadlerShit',
- 'Luggage A',
- 'Luggage B',
- 'Stairs',
- 'Боксвиль',
- 'Tiller',
- 'UtilityTrailer'
- }
- function getVehName(veh)
- if veh == nil or not doesVehicleExist(veh) then
- return 'Nil'
- end
- return tCarsName[getCarModel(veh) - 399]
- end
- function getVehColorName(veh)
- local colorId, _ = getCarColours(veh)
- if colorNames[colorId] == nil then
- sampAddChatMessage(string.format('неопозанный цвет %s', colorId), 5)
- return 'неопознанного'
- end
- local colorName = colorNames[colorId]
- if string.find(colorName, BLUE) then
- return colorName .. 'его'
- else
- return colorName .. 'ого'
- end
- end
- local excludedCars = {[591] = true, [435] = true, [584] = true}
- function getNearVeh(X, Y, Z)
- local closestVeh, lastMinDist
- local allVehicles = getAllVehicles()
- for _, veh in ipairs(allVehicles) do
- local distance = getDistanceBetweenCoords3d(X, Y, Z, getCarCoordinates(veh))
- local vehModel = getCarModel(veh)
- if
- not isCharInCar(PLAYER_PED, veh) and (lastMinDist == nil or distance < lastMinDist) and
- excludedCars[vehModel] == nil
- then
- lastMinDist, closestVeh = distance, veh
- end
- end
- return closestVeh
- end
- registerVariable(
- 'nearveh',
- 'возвращает ближайший транспорт (не ваш)',
- function()
- local closestVeh = getNearVeh(getCharCoordinates(PLAYER_PED))
- if closestVeh ~= nil then
- getVehName(closestVeh)
- else
- return 'Транспорт'
- end
- end
- )
- registerVariable(
- 'nearvehcolor',
- 'возвращает цвет ближайшего транспорта (не ваш)',
- function()
- local veh = getNearVeh(getCharCoordinates(PLAYER_PED))
- if veh == nil then
- return ''
- end
- return getVehColorName(veh)
- end
- )
- local IsChoosingVehicle = false
- local TargetVehicle = nil
- local TargetVehicleIndex = 1
- local NearVehicles = {}
- local BlipForTargetVehicle = nil
- local _VehSelectionTime = 0
- function getVehDriverSampId(veh)
- if not doesVehicleExist(veh) then
- return -1
- end
- local driverPed = getDriverOfCar(veh)
- if doesCharExist(driverPed) then
- local _, driverId = sampGetPlayerIdByCharHandle(driverPed)
- return driverId
- end
- return -1
- end
- function go()
- repeat
- wait(100)
- until isPlayerPlaying(PLAYER_PED)
- function endSelectTarget()
- if doesVehicleExist(TargetVehicle) then
- local driverId = getVehDriverSampId(TargetVehicle)
- if driverId ~= -1 then
- sampAddChatMessage(
- 'Выбран альтернативный транспорт: ' .. getVehName(TargetVehicle) .. ' SA-' .. driverId,
- 0xd3d3d3
- )
- else
- sampAddChatMessage(
- 'Выбран альтернативный транспорт без водителя: ' .. getVehName(TargetVehicle),
- 0x6495ed
- )
- end
- removeBlip(BlipForTargetVehicle)
- else
- sampAddChatMessage('Выбран неверный транспорт', 0x6495ed)
- end
- IsChoosingVehicle = false
- end
- while true do
- if IsChoosingVehicle and localClock() - _VehSelectionTime > 3 then
- endSelectTarget()
- _VehSelectionTime = localClock()
- end
- local mouseWheel = getMousewheelDelta()
- local isChanged = false
- if isKeyJustPressed(0x04) then
- if IsChoosingVehicle then
- endSelectTarget()
- else
- if doesVehicleExist(TargetVehicle) then
- BlipForTargetVehicle = addBlipForCar(TargetVehicle)
- end
- for k in pairs(NearVehicles) do
- NearVehicles[k] = nil
- end
- local i = 1
- for _, veh in ipairs(getAllVehicles()) do
- if doesVehicleExist(veh) and veh ~= nil then
- NearVehicles[i] = veh
- i = i + 1
- end
- end
- TargetVehicleIndex = 1
- local px, py = getCharCoordinates(PLAYER_PED)
- table.sort(
- NearVehicles,
- function(v1, v2)
- local x1, y1 = getCarCoordinates(v1)
- local x2, y2 = getCarCoordinates(v2)
- return getDistanceBetweenCoords2d(x1, y1, px, py) > getDistanceBetweenCoords2d(x2, y2, px, py)
- end
- )
- if table.getn(NearVehicles) ~= 0 then
- sampAddChatMessage(
- 'Выбираем транспорт (Колесико мыши вверх - дальше, вниз - ближе). Всего транспорта: ' ..
- table.getn(NearVehicles),
- -1
- )
- _VehSelectionTime = localClock()
- IsChoosingVehicle = true
- else
- sampAddChatMessage('Нет транспорта по близости', 0xd3d3d3)
- end
- end
- end
- if mouseWheel > 0 then
- _VehSelectionTime = localClock()
- if IsChoosingVehicle then
- isChanged = true
- if TargetVehicleIndex == 1 then
- TargetVehicleIndex = table.getn(NearVehicles)
- else
- TargetVehicleIndex = TargetVehicleIndex - 1
- end
- end
- end
- if mouseWheel < 0 then
- _VehSelectionTime = localClock()
- if IsChoosingVehicle then
- isChanged = true
- if TargetVehicleIndex == table.getn(NearVehicles) then
- TargetVehicleIndex = 1
- else
- TargetVehicleIndex = TargetVehicleIndex + 1
- end
- end
- end
- if isChanged then
- if doesBlipExist(BlipForTargetVehicle) then
- removeBlip(BlipForTargetVehicle)
- end
- TargetVehicle = NearVehicles[TargetVehicleIndex]
- if TargetVehicle == nil or not doesVehicleExist(TargetVehicle) then
- sampAddChatMessage('Выбранный транспорт более недоступен', 0xd3d3d3)
- TargetVehicleIndex = 1
- else
- BlipForTargetVehicle = addBlipForCar(TargetVehicle)
- local driverId = getVehDriverSampId(TargetVehicle)
- local distance =
- math.ceil(
- getDistanceBetweenCoords3d(getCarCoordinates(TargetVehicle), getCharCoordinates(PLAYER_PED))
- ) .. 'м.'
- if driverId ~= -1 then
- sampAddChatMessage(getVehName(TargetVehicle) .. ' SA-' .. driverId .. ' ' .. distance, -1)
- else
- sampAddChatMessage(getVehName(TargetVehicle) .. ' ' .. distance, -1)
- end
- end
- end
- wait(0)
- end
- end
- registerVariable(
- 'alttargetvehname',
- 'возвращает название транспорта альтернативного таргета',
- function()
- if doesVehicleExist(TargetVehicle) then
- return getVehName(TargetVehicle)
- else
- return ''
- end
- end
- )
- registerVariable(
- 'alttargetvehcolor',
- 'возвращает название транспорта альтернативного таргета',
- function()
- if doesVehicleExist(TargetVehicle) then
- return getVehColorName(TargetVehicle)
- else
- return ''
- end
- end
- )
- registerVariable(
- 'alttargetvehdriverid',
- 'возвращает название транспорта альтернативного таргета',
- function()
- if doesVehicleExist(TargetVehicle) then
- return getVehDriverSampId(TargetVehicle)
- else
- return ''
- end
- end
- )
- lua_thread.create(go)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement