- 219
- 18
- Версия MoonLoader
- .026-beta
всем дарова. столкнулся с проблемой такой. хочу сделать отображение названия автомобиля по ID, но игра крашит.
Lua:
if elements.value.renderInfoCars.v then
for k, v in ipairs(getAllVehicles()) do
local pos = {getCarCoordinates(v)}
local my_pos = {getCharCoordinates(playerPed)}
local result, id = sampGetVehicleIdByCarHandle(v)
local hp = getCarHealth(v)
local carID = getCarModel(v)
local x, y = convert3DCoordsToScreen(pos[1], pos[2], pos[3])
local vname = VehicleID
if result then
if isCarOnScreen(v) then
if getDistanceBetweenCoords3d(my_pos[1], my_pos[2], my_pos[3], pos[1], pos[2], pos[3]) < elements.value.intInfoCars.v then
renderFontDrawText(font, ''..vname..': '..carID..'\nSERVER ID: '..id..'\nHEALTH: '..hp, x, y, 0xFFFFFFFF, true)
end
end
end
end
end
Lua:
local VehicleID =
{
[400] = 'Landstalker',
[401] = 'Bravura',
[402] = 'Buffalo',
[403] = 'Linerunner',
[404] = 'Perennial',
[405] = 'Sentinel',
[406] = 'Dumper',
[407] = 'Firetruck',
[408] = 'Trashmaster',
[409] = 'Stretch',
[410] = 'Manana',
[411] = 'Infernus',
[412] = 'Voodoo',
[413] = 'Packer',
[414] = 'Monster',
[415] = 'Admiral',
[416] = 'Sultan',
[417] = 'Cheetah',
[418] = 'Airtug',
[419] = 'Taxi',
[420] = 'Wangcar',
[421] = 'Freight',
[422] = 'Streak',
[423] = 'Rumpo',
[424] = 'RC Bandit',
[425] = 'Romero',
[426] = 'RC Raider',
[427] = 'Zombie',
[428] = 'Banshee',
[429] = 'Burrito',
[430] = 'Moonbeam',
[431] = 'Picador',
[432] = 'Swat',
[433] = 'Alpha',
[434] = 'Predator',
[435] = 'Cargobob',
[436] = 'Tanker',
[437] = 'Journey',
[438] = 'Roadtrain',
[439] = 'Love Media',
[440] = 'Articulated Lorry',
[441] = 'Tractor',
[442] = 'Quadbike',
[443] = 'BMX',
[444] = 'Bike',
[445] = 'Mountainbike',
[446] = 'Vortex',
[447] = 'Sandking',
[448] = 'Wheels',
[449] = 'Towtruck',
[450] = 'Freeway',
[451] = 'Hellfish',
[452] = 'Zirconium',
[453] = 'Rhino',
[454] = 'Hotknife',
[455] = 'Turismo',
[456] = 'Eagle',
[457] = 'Phoenix',
[458] = 'Club',
[459] = 'Infernus2',
[460] = 'Hunter',
[461] = 'Bloodring',
[462] = 'Bandit',
[463] = 'Tractor2',
[464] = 'Cementtruck',
[465] = 'Linerunner2',
[466] = 'Bigstreetcar',
[467] = 'Bigrider'
}
Moon-log:
attempt to concatenate local 'vname' (a table value)