[Lua] Поиск в imgui

Ackerman_Kirito

Новичок
Автор темы
24
0
Версия MoonLoader
Другое
Приветствую, снова я, прошу прощения помогите сделать строку поиск в скрипте по названию и id

поискал в интернете нашел инфу только как в чат сообщения выводить, подскажите плиз, код прикреплю:
Исходник:
require 'lib.sampfuncs'
require 'lib.moonloader'

local keys = require 'vkeys'
local imgui = require 'mimgui'
local tag1 = "[Подсказка]: "
local tag = "[Информация]: "

local new = imgui.new
local renderWindow = new.bool(false)
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8

local tCarsName = {"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
"Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BFInjection", "Hunter",
"Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo",
"RCBandit", "Romero","Packer", "Monster", "Admiral", "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed",
"Yankee", "Caddy", "Solair", "Berkley'sRCVan", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RCBaron", "RCRaider", "Glendale", "Oceanic", "Sanchez", "Sparrow",
"Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage",
"Dozer", "Maverick", "NewsChopper", "Rancher", "FBIRancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "BlistaCompact", "PoliceMaverick",
"Boxvillde", "Benson", "Mesa", "RCGoblin", "HotringRacerA", "HotringRacerB", "BloodringBanger", "Rancher", "SuperGT", "Elegant", "Journey", "Bike",
"MountainBike", "Beagle", "Cropduster", "Stunt", "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "hydra", "FCR-900", "NRG-500", "HPV1000",
"CementTruck", "TowTruck", "Fortune", "Cadrona", "FBITruck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight",
"Streak", "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada",
"Yosemite", "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RCTiger", "Flash", "Tahoma", "Savanna", "Bandito",
"FreightFlat", "StreakCarriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "NewsVan",
"Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "FreightBox", "Trailer", "Andromada", "Dodo", "RCCam", "Launch", "PoliceCar", "PoliceCar",
"PoliceCar", "PoliceRanger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "GlendaleShit", "SadlerShit", "Luggage A", "Luggage B", "Stairs", "Boxville", "Tiller",
"UtilityTrailer"}
NameCar = {
    [400] = "Landstalker",
    [401] = 'Bravura',
    [402] = 'Buffalo',
    [403] = 'Linerunner',
    [404] = 'Perenniel',
    [405] = 'Sentinel',
    [406] = 'Dumper',
    [407] = 'Firetruck',
    [408] = 'Trashmaster',
    [409] = 'Stretch',
    [410] = 'Manana',
    [411] = 'Infernus',
    [412] = 'Voodoo',
    [413] = 'Pony',
    [414] = 'Mule',
    [415] = 'Cheetah',
    [416] = 'Ambulance',
    [417] = 'Leviathan',
    [418] = 'Moonbeam',
    [419] = 'Esperanto',
    [420] = 'Taxi',
    [421] = 'Washington',
    [422] = 'Bobcat',
    [423] = 'Mr Whoopee',
    [424] = 'BF Injection',
    [425] = 'Hunter',
    [426] = 'Premier',
    [427] = 'Enforcer',
    [428] = 'Securicar',
    [429] = 'Banshee',
    [430] = 'Predator',
    [431] = 'Bus',
    [432] = 'Rhino',
    [433] = 'Barracks',
    [434] = 'Hotknife',
    [435] = 'Article Trailer',
    [436] = 'Previon',
    [437] = 'Coach',
    [438] = 'Cabbie',
    [439] = 'Stallion',
    [440] = 'Rumpo',
    [441] = 'RC Bandit',
    [442] = 'Romero',
    [443] = 'Packer',
    [444] = 'Monster',
    [445] = 'Admiral',
    [446] = 'Squallo',
    [447] = 'Seasparrow',
    [448] = 'Pizzaboy',
    [449] = 'Tram',
    [450] = 'Article Trailer 2',
    [451] = 'Turismo',
    [452] = 'Speeder',
    [453] = 'Reefer',
    [454] = 'Tropic',
    [455] = 'Flatbed',
    [456] = 'Yankee',
    [457] = 'Caddy',
    [458] = 'Solair',
    [459] = "Berkley's RC",
    [460] = 'Skimmer',
    [461] = 'PCJ-600',
    [462] = 'Faggio',
    [463] = 'Freeway',
    [464] = 'RC Baron',
    [465] = 'RC Raider',
    [466] = 'Glendale',
    [467] = 'Oceanic',
    [468] = 'Sanchez',
    [469] = 'Sparrow',
    [470] = 'Patriot',
    [471] = 'Quad',
    [472] = 'Coastguard',
    [473] = 'Dinghy',
    [474] = 'Hermes',
    [475] = 'Sabre',
    [476] = 'Rustler',
    [477] = 'ZR-350',
    [478] = 'Walton',
    [479] = 'Regina',
    [480] = 'Comet',
    [481] = 'BMX',
    [482] = 'Burrito',
    [483] = 'Camper',
    [484] = 'Marquis',
    [485] = 'Baggage',
    [486] = 'Dozer',
    [487] = 'Maverick',
    [488] = 'SAN News Maverick',
    [489] = 'Rancher',
    [490] = 'FBI Rancher',
    [491] = 'Virgo',
    [492] = 'Greenwood',
    [493] = 'Jetmax',
    [494] = 'Hotring Racer',
    [495] = 'Sandking',
    [496] = 'Blista Compact',
    [497] = 'Police Maverick',
    [498] = 'Boxville',
    [499] = 'Benson',
    [500] = 'Mesa',
    [501] = 'RC Goblin',
    [502] = 'Hotring Racer A',
    [503] = 'Hotring Racer B',
    [504] = 'Bloodring Banger',
    [505] = 'Rancher',
    [506] = 'Super GT',
    [507] = 'Elegant',
    [508] = 'Journey',
    [509] = 'Bike',
    [510] = 'Mountain Bike',
    [511] = 'Beagle',
    [512] = 'Cropduster',
    [513] = 'Stuntplane',
    [514] = 'Tanker',
    [515] = 'Roadtrain',
    [516] = 'Nebula',
    [517] = 'Majestic',
    [518] = 'Buccaneer',
    [519] = 'Shamal',
    [520] = 'Hydra',
    [521] = 'FCR-900',
    [522] = 'NRG-500',
    [523] = 'HPV1000',
    [524] = 'Cement Truck',
    [525] = 'Towtruck',
    [526] = 'Fortune',
    [527] = 'Cadrona',
    [528] = 'FBI Truck',
    [529] = 'Willard',
    [530] = 'Forklift',
    [531] = 'Tractor',
    [532] = 'Combine Harvester',
    [533] = 'Feltzer',
    [534] = 'Remington',
    [535] = 'Slamvan',
    [536] = 'Blade',
    [537] = 'Freight (Train)',
    [538] = 'Brownstreak (Train)',
    [539] = 'Vortex',
    [540] = 'Vincent',
    [541] = 'Bullet',
    [542] = 'Clover',
    [543] = 'Sadler',
    [544] = 'Firetruck LA',
    [545] = 'Hustler',
    [546] = 'Intruder',
    [547] = 'Primo',
    [548] = 'Cargobob',
    [549] = 'Tampa',
    [550] = 'Sunrise',
    [551] = 'Merit',
    [552] = 'Utility Van',
    [553] = 'Nevada',
    [554] = 'Yosemite',
    [555] = 'Windsor',
    [556] = 'Monster A',
    [557] = 'Monster B',
    [558] = 'Uranus',
    [559] = 'Jester',
    [560] = 'Sultan',
    [561] = 'Stratum',
    [562] = 'Elegy',
    [563] = 'Raindance',
    [564] = 'RC Tiger',
    [565] = 'Flash',
    [566] = 'Tahoma',
    [567] = 'Savanna',
    [568] = 'Bandito',
    [569] = 'Freight Flat Trailer',
    [570] = 'Streak Trailer',
    [571] = 'Kart',
    [572] = 'Mower',
    [573] = 'Dune',
    [574] = 'Sweeper',
    [575] = 'Broadway',
    [576] = 'Tornado',
    [577] = 'AT400',
    [578] = 'DFT-30',
    [579] = 'Huntley',
    [580] = 'Stafford',
    [581] = 'BF-400',
    [582] = 'Newsvan',
    [583] = 'Tug',
    [584] = 'Petrol Trailer',
    [585] = 'Emperor',
    [586] = 'Wayfarer',
    [587] = 'Euros',
    [588] = 'Hotdog',
    [589] = 'Club',
    [590] = 'Freight Box Trailer',
    [591] = 'Article Trailer 3',
    [592] = 'Andromada',
    [593] = 'Dodo',
    [594] = 'RC Cam',
    [595] = 'Launch',
    [596] = 'Police Car (LSPD)',
    [597] = 'Police Car (SFPD)',
    [598] = 'Police Car (LVPD)',
    [599] = 'Police Ranger',
    [600] = 'Picador',
    [601] = 'S.W.A.T.',
    [602] = 'Alpha',
    [603] = 'Phoenix',
    [604] = 'Glendale Shit',
    [605] = 'Sadler Shit',
    [606] = 'Baggage Trailer A',
    [607] = 'Baggage Trailer B',
    [608] = 'Tug Stairs Trailer',
    [609] = 'Boxville',
    [610] = 'Farm Trailer',
    [611] = 'Utility Trailer',
  }

local tSkinName = {"cj", "truth", "maccer", "andre", "bbthin", "bb", "emmet", "Male01", "janitor", "bfori", "bfost", "vbfycrp",
"bfyri", "bfyst", "bmori", "bmost", "bmyap", "bmybu", "bmybe", "bmydj", "bmyri", "bmycr", "bmyst", "wmybmx",
 "wbdyg1", "wbdyg2", "wmybp", "wmycon", "bmydrug", "wmydrug", "hmydrug", "dwfolc", "dwmolc1", "dwmolc2", "dwmylc1", "hmogar",
 "wmygol1", "wmygol2", "hfori", "hfost", "hfyri", "hfyst", "jethro", "hmori", "hmost", "hmybe", "hmyri", "hmycr",
 "hmyst", "omokung", "wmymech", "bmymoun", "wmymoun", "Unknown", "ofost", "ofyri", "ofyst", "omori", "omost", "omyri",
 "omyst", "wmyplt", "wmopj", "bfypro", "hfypro", "kendl", "bmypol1", "bmypol2", "wmoprea", "sbfyst", "wmosci", "wmysgrd",
 "swmyhp1", "swmyhp2", "swfopro", "wfystew", "swmotr1", "wmotr1", "bmotr1", "vbmybox", "vwmybox", "vhmyelv", "vbmyelv", "vimyelv",
 "vwfypro", "ryder3", "vwfyst1", "wfori", "wfost", "wfyjg", "wfyri", "wfyro", "wfyst", "wmori", "wmost", "wmyjg",
 "wmylg", "wmyri", "wmyro", "wmycr", "wmyst", "ballas1", "ballas2", "ballas3", "fam1", "fam2", "fam3", "lsv1",
 "lsv2", "lsv3", "maffa", "maffb", "mafboss", "vla1", "vla2", "vla3", "triada", "triadb", "sindaco", "triboss",
 "dnb1", "dnb2", "dnb3", "vmaff1", "vmaff2", "vmaff3", "vmaff4", "dnmylc", "dnfolc1", "dnfolc2", "dnfylc", "dnmolc1",
 "dnmolc2", "sbmotr2", "swmotr2", "sbmytr3", "swmotr3", "wfybe", "bfybe", "hfybe", "sofybu", "sbmyst", "sbmycr", "bmycg",
 "wfycrk", "hmycm", "wmybu", "bfybu", "smokev", "wfybu", "dwfylc1", "wfypro", "wmyconb", "wmybe", "wmypizz", "bmobar",
 "cwfyhb", "cwmofr", "cwmohb1", "cwmohb2", "cwmyfr", "cwmyhb1", "bmyboun", "wmyboun", "wmomib", "bmymib", "wmybell", "bmochil",
 "sofyri", "somyst", "vwmybjd", "vwfycrp", "sfr1", "sfr2", "sfr3", "bmybar", "wmybar", "wfysex", "wmyammo", "bmytatt",
 "vwmycr", "vbmocd", "vbmycr", "vhmycr", "sbmyri", "somyri", "somybu", "swmyst", "wmyva", "copgrl3", "gungrl3", "mecgrl3",
 "nurgrl3", "crogrl3", "gangrl3", "cwfofr", "cwfohb", "cwfyfr1", "cwfyfr2", "cwmyhb2", "dwfylc2", "dwmylc2", "omykara", "wmykara",
 "wfyburg", "vwmycd", "vhfypro", "suzie", "omonood", "omoboat", "wfyclot", "vwmotr1", "vwmotr2", "vwfywai", "sbfori", "swfyri",
 "wmyclot", "sbfost", "sbfyri", "sbmocd", "sbmori", "sbmost", "shmycr", "sofori", "sofost", "sofyst", "somobu", "somori",
 "somost", "swmotr5", "swfori", "swfost", "swfyst", "swmocd", "swmori", "swmost", "shfypro", "sbfypro", "swmotr4", "swmyri",
 "smyst", "smyst2", "sfypro", "vbfyst2", "vbfypro", "vhfyst3", "bikera", "bikerb", "bmypimp", "swmycr", "wfylg", "wmyva2",
 "bmosec", "bikdrug", "wmych", "sbfystr", "swfystr", "heck1", "heck2", "bmycon", "wmycd1", "bmocd", "vwfywa2", "wmoice",
 "tenpen", "pulaski", "Hernandez", "dwayne", "smoke", "sweet", "ryder", "forelli", "tbone", "laemt1", "lvemt1", "sfemt1",
 "lafd1", "lvfd1", "sffd1", "lapd1", "sfpd1", "lvpd1", "csher", "lapdm1", "swat", "fbi", "army", "dsher",
 "zero", "rose", "paul", "cesar", "ogloc", "wuzimu", "torino", "jizzy", "maddogg", "cat", "claude",}
NameSkin = {
    [0] = 'no skin',
    [1] = 'truth',
    [2] = 'maccer',
    [3] = 'andre',
    [4] = 'bbthin',
    [5] = 'bb',
    [6] = 'emmet',
    [7] = 'Male01',
    [8] = 'janitor',
    [9] = 'bfori',
    [10] = 'bfost',
    [11] = 'vbfycrp',
    [12] = 'bfyri',
    [13] = 'bfyst',
    [14] = 'bmori',
    [15] = 'bmost',
    [16] = 'bmyap',
    [17] = 'bmybu',
    [18] = 'bmybe',
    [19] = 'bmydj',
    [20] = 'bmyri',
    [21] = 'bmycr',
    [22] = 'bmyst',
    [23] = 'wmybmx',
    [24] = 'wbdyg1',
    [25] = 'wbdyg2',
    [26] = 'wmybp',
    [27] = 'wmycon',
    [28] = 'bmydrug',
    [29] = 'wmydrug',
    [30] = 'hmydrug',
    [31] = 'dwfolc',
    [32] = 'dwmolc1',
    [33] = 'dwmolc2',
    [34] = 'dwmylc1',
    [35] = 'hmogar',
    [36] = 'wmygol1',
    [37] = 'wmygol2',
    [38] = 'hfori',
    [39] = 'hfost',
    [40] = 'hfyri',
    [41] = 'hfyst',
    [42] = 'jethro',
    [43] = 'hmori',
    [44] = 'hmost',
    [45] = 'hmybe',
    [46] = 'hmyri',
    [47] = 'hmycr',
    [48] = 'hmyst',
    [49] = 'omokung',
    [50] = 'wmymech',
    [51] = 'bmymoun',
    [52] = 'wmymoun',
    [53] = 'Unknown',
    [54] = 'ofost',
    [55] = 'ofyri',
    [56] = 'ofyst',
    [57] = 'omori',
    [58] = 'omost',
    [59] = "omyri",
    [60] = 'omyst',
    [61] = 'wmyplt',
    [62] = 'wmopj',
    [63] = 'bfypro',
    [64] = 'hfypro',
    [65] = 'kendl',
    [66] = 'bmypol1',
    [67] = 'bmypol2',
    [68] = 'wmoprea',
    [69] = 'sbfyst',
    [70] = 'wmosci',
    [71] = 'wmysgrd',
    [72] = 'swmyhp1',
    [73] = 'swmyhp2',
    [74] = 'no skin',
    [75] = 'swfopro',
    [76] = 'wfystew',
    [77] = 'swmotr1',
    [78] = 'wmotr1',
    [79] = 'bmotr1',
    [80] = 'vbmybox',
    [81] = 'vwmybox',
    [82] = 'vhmyelv',
    [83] = 'vbmyelv',
    [84] = 'vimyelv',
    [85] = 'vwfypro',
    [86] = 'ryder3',
    [87] = 'vwfyst1',
    [88] = 'wfori',
    [89] = 'wfost',
    [90] = 'wfyjg',
    [91] = 'wfyri',
    [92] = 'wfyro',
    [93] = 'wfyst',
    [94] = 'wmori',
    [95] = 'wmost',
    [96] = 'wmyjg',
    [97] = 'wmylg',
    [98] = 'wmyri',
    [99] = 'wmyro',
    [100] = 'wmycr',
    [101] = 'wmyst',
    [102] = 'ballas1',
    [103] = 'ballas2',
    [104] = 'ballas3',
    [105] = 'fam1',
    [106] = 'fam2',
    [107] = 'fam3',
    [108] = 'lsv1',
    [109] = 'lsv2',
    [110] = 'lsv3',
    [111] = 'maffa',
    [112] = 'maffb',
    [113] = 'mafboss',
    [114] = 'vla1',
    [115] = 'vla2',
    [116] = 'vla3',
    [117] = 'triada',
    [118] = 'triadb',
    [119] = 'sindaco',
    [120] = 'triboss',
    [121] = 'dnb1',
    [122] = 'dnb2',
    [123] = 'dnb3',
    [124] = 'vmaff1',
    [125] = 'vmaff2',
    [126] = 'vmaff3',
    [127] = 'vmaff4',
    [128] = 'dnmylc',
    [129] = 'dnfolc1',
    [130] = 'dnfolc2',
    [131] = 'dnfylc',
    [132] = 'dnmolc1',
    [133] = 'dnmolc2',
    [134] = 'sbmotr2',
    [135] = 'swmotr2',
    [136] = 'sbmytr3',
    [137] = 'swmotr3',
    [138] = 'wfybe',
    [139] = 'bfybe',
    [140] = 'hfybe',
    [141] = 'sofybu',
    [142] = 'sbmyst',
    [143] = 'sbmycr',
    [144] = 'bmycg LA',
    [145] = 'wfycrk',
    [146] = 'hmycm',
    [147] = 'wmybu',
    [148] = 'bfybu',
    [149] = 'smokev',
    [150] = 'wfybu',
    [151] = 'dwfylc1',
    [152] = 'wfypro',
    [153] = 'wmyconb',
    [154] = 'wmybe',
    [155] = 'wmypizz',
    [156] = 'bmobar',
    [157] = 'cwfyhb',
    [158] = 'cwmofr',
    [159] = 'cwmohb1',
    [160] = 'cwmohb2',
    [161] = 'cwmyfr',
    [162] = 'cwmyhb1',
    [163] = 'bmyboun',
    [164] = 'wmyboun',
    [165] = 'wmomib',
    [166] = 'bmymib',
    [167] = 'wmybell',
    [168] = 'bmochil',
    [169] = 'sofyri',
    [170] = 'somyst',
    [171] = 'vwmybjd',
    [172] = 'vwfycrp',
    [173] = 'sfr1',
    [174] = 'sfr2',
    [175] = 'sfr3',
    [176] = 'bmybar',
    [177] = 'wmybar',
    [178] = 'wfysex',
    [179] = 'wmyammo',
    [180] = 'bmytatt',
    [181] = 'vwmycr',
    [182] = 'vbmocd',
    [183] = 'vbmycr',
    [184] = 'vhmycr',
    [185] = 'sbmyri',
    [186] = 'somyri',
    [187] = 'somybu',
    [188] = 'swmyst',
    [189] = 'wmyva',
    [190] = 'copgrl3',
    [191] = 'gungrl3',
    [192] = 'mecgrl3',
    [193] = 'nurgrl3',
    [194] = 'crogrl3',
    [195] = 'gangrl3',
    [196] = 'cwfofr',
    [197] = 'cwfohb',
    [198] = 'cwfyfr1',
    [199] = 'cwfyfr2',
    [200] = 'cwmyhb2',
    [201] = 'dwfylc2',
    [202] = 'dwmylc2',
    [203] = 'omykara',
    [204] = 'wmykara',
    [205] = 'wfyburg',
    [206] = 'vwmycd',
    [207] = 'vhfypro',
    [208] = 'suzie',
    [209] = 'omonood',
    [210] = 'omoboat',
    [211] = 'wfyclot',
    [212] = 'vwmotr1',
    [213] = 'vwmotr2',
    [214] = 'vwfywai',
    [215] = 'sbfori',
    [216] = 'swfyri',
    [217] = 'wmyclot',
    [218] = 'sbfost',
    [219] = 'sbfyri',
    [220] = 'sbmocd',
    [221] = 'sbmori',
    [222] = 'sbmost',
    [223] = 'shmycr',
    [224] = 'sofori',
    [225] = 'sofost',
    [226] = 'sofyst',
    [227] = 'somobu',
    [228] = 'somori',
    [229] = 'somost',
    [230] = 'swmotr5',
    [231] = 'swfori',
    [232] = 'swfost',
    [233] = 'swfyst',
    [234] = 'swmocd',
    [235] = 'swmori',
    [236] = 'swmost',
    [237] = 'shfypro',
    [238] = 'sbfypro',
    [239] = 'swmotr4',
    [240] = 'swmyri',
    [241] = 'smyst',
    [242] = 'smyst2',
    [243] = 'sfypro',
    [244] = 'vbfyst2',
    [245] = 'vbfypro',
    [246] = 'vhfyst3',
    [247] = 'bikera',
    [248] = 'bikerb',
    [249] = 'bmypimp',
    [250] = 'swmycr',
    [251] = 'wfylg',
    [252] = 'wmyva2',
    [253] = 'bmosec',
    [254] = 'bikdrug',
    [255] = 'wmych',
    [256] = 'sbfystr',
    [257] = 'swfystr',
    [258] = 'heck1',
    [259] = 'heck2',
    [260] = 'bmycon',
    [261] = 'wmycd1',
    [262] = 'bmocd',
    [263] = 'vwfywa2',
    [264] = 'wmoice',
    [265] = 'tenpen',
    [266] = 'pulaski',
    [267] = 'Hernandez',
    [268] = 'dwayne',
    [269] = 'smoke',
    [270] = 'sweet',
    [271] = 'ryder',
    [272] = 'forelli',
    [273] = 'tbone',
    [274] = 'laemt1',
    [275] = 'lvemt1',
    [276] = 'sfemt1',
    [277] = 'lafd1',
    [278] = 'lvfd1',
    [279] = 'sffd1',
    [280] = 'lapd1',
    [281] = 'sfpd1',
    [282] = 'lvpd1',
    [283] = 'csher',
    [284] = 'lapdm1',
    [285] = 'swat',
    [286] = 'fbi',
    [287] = 'army',
    [288] = 'dsher',
    [289] = 'zero',
    [290] = 'rose',
    [291] = 'paul',
    [292] = 'cesar',
    [293] = 'ogloc',
    [294] = "wuzimu",
    [295] = 'torino',
    [296] = 'jizzy',
    [297] = 'maddogg',
    [298] = 'Catalina',
    [299] = 'claude',
  }

function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('inf', function()
        renderWindow[0] = not renderWindow[0]
    end)
    
    sampAddChatMessage(tag .. "{FFFFFF}Версия скрипта 1.1 успешно загружена | Для Администраторов {FF0000}Advance {FFFFFF}выдача траспорта/скина доступна с 4 lvl'a", 0xFF0000)
    sampAddChatMessage(tag1 .. "{FFFFFF}Для вывода информации используйте команду {008000}/inf", 0xFF0000)
    
    while true do
        wait(0)
        
    end
end

imgui.OnInitialize(function()
    imgui.GetIO().IniFilename = nil
    tCars = {}
    for i = 400, 611, 1 do
        tCars[i] = imgui.CreateTextureFromFile(getGameDirectory() .. "\\moonloader\\images\\Vehicle_" .. i .. ".jpg")
    end
end)

imgui.OnInitialize(function()
    imgui.GetIO().IniFilename = nil
    tSkin = {}
    for i = 0, 299, 1 do
        tSkin[i] = imgui.CreateTextureFromFile(getGameDirectory() .. "\\moonloader\\skins\\Skin_" .. i .. ".png")
    end
end)

function getNameVehicleModel(id)
    local name
    if NameCar[id] ~= nil then
        name = NameCar[id]
    else
        name = 'Неизвестно'
    end
    return name
end

function getNameVehicleModel1(id)
    local name
    if NameSkin[id] ~= nil then
        name = NameSkin[id]
    else
        name = 'Неизвестно'
    end
    return name
end

local newFrame = imgui.OnFrame(
    function() return renderWindow[0] end,
    
    
    function(self)
        local resX, resY = getScreenResolution()
        local sizeX, sizeY = 1180, 600
        imgui.SetNextWindowPos(imgui.ImVec2(resX / 2, resY / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
        imgui.SetNextWindowSize(imgui.ImVec2(sizeX, sizeY), imgui.Cond.FirstUseEver)
        imgui.Begin(u8'ID Автомобилей | скинов v: 1.1 · by Ackerman ®', renderWindow, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse)

        imgui.CenterTextColored(imgui.ImVec4(1,1,1,1), u8"Выберите нужный ID.")
        imgui.BeginChild("Window1", imgui.ImVec2(770, 540), true)
            imgui.Text(u8"Список транспорта с картинками:")
            imgui.Separator()
        kl = 0
        posvehx = 5
        posvehy = 60
        postextx = 10
        postexty = 145

        for i = 400, 611, 1 do
            imgui.SetCursorPos(imgui.ImVec2(posvehx, posvehy))
            imgui.BeginChild("##clickzona" .. i, imgui.ImVec2(115, 80))
            imgui.EndChild()

            if imgui.IsItemClicked() then
                sampSendChat("/vec " .. i .. " 0 0")

                renderWindow[0] = true
            end

            imgui.SetCursorPos(imgui.ImVec2(posvehx, posvehy))
            imgui.Image(tCars[i], imgui.ImVec2(115, 80))

            if imgui.IsItemHovered() then
            imgui.SetCursorPos(imgui.ImVec2(posvehx, posvehy))
            imgui.Image(tCars[i], imgui.ImVec2(120, 85))
            imgui.BeginTooltip()
            imgui.TextUnformatted(u8"\nТранспорт: " .. getNameVehicleModel(i) .. "[" .. i .. "]")
            imgui.EndTooltip()
            end

            imgui.SetCursorPos(imgui.ImVec2(postextx, postexty))
            imgui.Text(getNameVehicleModel(i) .. "[" .. i .. "]")

            postextx = postextx + 130
            posvehx = posvehx + 130
            kl = kl + 1

            if kl > 5 then
            kl = 0
            posvehx = 5
            postextx = 10
            posvehy = posvehy + 110
            postexty = posvehy + 90
            end
        end
                
        imgui.EndChild()
        
        imgui.SameLine()
        
            imgui.BeginChild("Window", imgui.ImVec2(390, 540), true)
                imgui.Text(u8"Список скинов с картинками:")
            
                imgui.Separator()
                kl = 0
                posvehx = 5
                posvehy = 60
                postextx = 10
                postexty = 145

                for i = 0, 299, 1 do
                    imgui.SetCursorPos(imgui.ImVec2(posvehx, posvehy))
                    imgui.BeginChild("##clickzona" .. i, imgui.ImVec2(50, 80))
                    imgui.EndChild()

                    if imgui.IsItemClicked(1) then
                        sampSendChat("/skin " .. "")

                        renderWindow[0] = true
                    end

                    imgui.SetCursorPos(imgui.ImVec2(posvehx, posvehy))
                    imgui.Image(tSkin[i], imgui.ImVec2(50, 80))

                    if imgui.IsItemHovered() then
                    imgui.SetCursorPos(imgui.ImVec2(posvehx, posvehy))
                    imgui.Image(tSkin[i], imgui.ImVec2(55, 85))
                    imgui.BeginTooltip()
                    imgui.TextUnformatted(u8"\nСкин: " .. getNameVehicleModel1(i) .. "[" .. i .. "]")
                    imgui.EndTooltip()
                    end

                    imgui.SetCursorPos(imgui.ImVec2(postextx, postexty))
                    imgui.Text(getNameVehicleModel1(i) .. "[" .. i .. "]")

                    postextx = postextx + 145
                    posvehx = posvehx + 145
                    kl = kl + 1

                    if kl > 2 then
                    kl = 0
                    posvehx = 5
                    postextx = 10
                    posvehy = posvehy + 110
                    postexty = posvehy + 90
                    end
                end
                imgui.End()
            imgui.EndChild()
        
    end
)
 

Vespan

Чешский луашер
Проверенный
2,123
1,729
Lua:
-- in imgui
-- input - поисковая строка*
-- :lower() переводит текст в нижний регистр(:upper() в верхний)
-- ..позволяя искать текст не зависимости от КАПСА
if #input.v ~= 0 then
    for k,v in pairs(tCarsName) do
        if v:lower():find(input.v:lower()) then
            imgui.Text('id car:'..k+400..',veh:'..v)
        end
    end
else
    imgui.Text('nothing..')
end
 
  • Нравится
Реакции: Ackerman_Kirito

chapo

чопа сребдс // @moujeek
Модератор
8,934
11,700
1655650815721.png

Lua:
script_author('chapo')

local ffi = require('ffi')
local imgui = require 'mimgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8

local renderWindow = imgui.new.bool(true)
local search = imgui.new.char[128]('')
local tab = 0
local List = {
    Vehs = {[400] = "Landstalker",[401] = 'Bravura',[402] = 'Buffalo',[403] = 'Linerunner',[404] = 'Perenniel',[405] = 'Sentinel',[406] = 'Dumper',[407] = 'Firetruck',[408] = 'Trashmaster',[409] = 'Stretch',[410] = 'Manana',[411] = 'Infernus',[412] = 'Voodoo',[413] = 'Pony',[414] = 'Mule',[415] = 'Cheetah',[416] = 'Ambulance',[417] = 'Leviathan',[418] = 'Moonbeam',[419] = 'Esperanto',[420] = 'Taxi',[421] = 'Washington',[422] = 'Bobcat',[423] = 'Mr Whoopee',[424] = 'BF Injection',[425] = 'Hunter',[426] = 'Premier',[427] = 'Enforcer',[428] = 'Securicar',[429] = 'Banshee',[430] = 'Predator',[431] = 'Bus',[432] = 'Rhino',[433] = 'Barracks',[434] = 'Hotknife',[435] = 'Article Trailer',[436] = 'Previon',[437] = 'Coach',[438] = 'Cabbie',[439] = 'Stallion',[440] = 'Rumpo',[441] = 'RC Bandit',[442] = 'Romero',[443] = 'Packer',[444] = 'Monster',[445] = 'Admiral',[446] = 'Squallo',[447] = 'Seasparrow',[448] = 'Pizzaboy',[449] = 'Tram',[450] = 'Article Trailer 2',[451] = 'Turismo',[452] = 'Speeder',[453] = 'Reefer',[454] = 'Tropic',[455] = 'Flatbed',[456] = 'Yankee',[457] = 'Caddy',[458] = 'Solair',[459] = "Berkley's RC",[460] = 'Skimmer',[461] = 'PCJ-600',[462] = 'Faggio',[463] = 'Freeway',[464] = 'RC Baron',[465] = 'RC Raider',[466] = 'Glendale',[467] = 'Oceanic',[468] = 'Sanchez',[469] = 'Sparrow',[470] = 'Patriot',[471] = 'Quad',[472] = 'Coastguard',[473] = 'Dinghy',[474] = 'Hermes',[475] = 'Sabre',[476] = 'Rustler',[477] = 'ZR-350',[478] = 'Walton',[479] = 'Regina',[480] = 'Comet',[481] = 'BMX',[482] = 'Burrito',[483] = 'Camper',[484] = 'Marquis',[485] = 'Baggage',[486] = 'Dozer',[487] = 'Maverick',[488] = 'SAN News Maverick',[489] = 'Rancher',[490] = 'FBI Rancher',[491] = 'Virgo',[492] = 'Greenwood',[493] = 'Jetmax',[494] = 'Hotring Racer',[495] = 'Sandking',[496] = 'Blista Compact',[497] = 'Police Maverick',[498] = 'Boxville',[499] = 'Benson',[500] = 'Mesa',[501] = 'RC Goblin',[502] = 'Hotring Racer A',[503] = 'Hotring Racer B',[504] = 'Bloodring Banger',[505] = 'Rancher',[506] = 'Super GT',[507] = 'Elegant',[508] = 'Journey',[509] = 'Bike',[510] = 'Mountain Bike',[511] = 'Beagle',[512] = 'Cropduster',[513] = 'Stuntplane',[514] = 'Tanker',[515] = 'Roadtrain',[516] = 'Nebula',[517] = 'Majestic',[518] = 'Buccaneer',[519] = 'Shamal',[520] = 'Hydra',[521] = 'FCR-900',[522] = 'NRG-500',[523] = 'HPV1000',[524] = 'Cement Truck',[525] = 'Towtruck',[526] = 'Fortune',[527] = 'Cadrona',[528] = 'FBI Truck',[529] = 'Willard',[530] = 'Forklift',[531] = 'Tractor',[532] = 'Combine Harvester',[533] = 'Feltzer',[534] = 'Remington',[535] = 'Slamvan',[536] = 'Blade',[537] = 'Freight (Train)',[538] = 'Brownstreak (Train)',[539] = 'Vortex',[540] = 'Vincent',[541] = 'Bullet',[542] = 'Clover',[543] = 'Sadler',[544] = 'Firetruck LA',[545] = 'Hustler',[546] = 'Intruder',[547] = 'Primo',[548] = 'Cargobob',[549] = 'Tampa',[550] = 'Sunrise',[551] = 'Merit',[552] = 'Utility Van',[553] = 'Nevada',[554] = 'Yosemite',[555] = 'Windsor',[556] = 'Monster A',[557] = 'Monster B',[558] = 'Uranus',[559] = 'Jester',[560] = 'Sultan',[561] = 'Stratum',[562] = 'Elegy',[563] = 'Raindance',[564] = 'RC Tiger',[565] = 'Flash',[566] = 'Tahoma',[567] = 'Savanna',[568] = 'Bandito',[569] = 'Freight Flat Trailer',[570] = 'Streak Trailer',[571] = 'Kart',[572] = 'Mower',[573] = 'Dune',[574] = 'Sweeper',[575] = 'Broadway',[576] = 'Tornado',[577] = 'AT400',[578] = 'DFT-30',[579] = 'Huntley',[580] = 'Stafford',[581] = 'BF-400',[582] = 'Newsvan',[583] = 'Tug',[584] = 'Petrol Trailer',[585] = 'Emperor',[586] = 'Wayfarer',[587] = 'Euros',[588] = 'Hotdog',[589] = 'Club',[590] = 'Freight Box Trailer',[591] = 'Article Trailer 3',[592] = 'Andromada',[593] = 'Dodo',[594] = 'RC Cam',[595] = 'Launch',[596] = 'Police Car (LSPD)',[597] = 'Police Car (SFPD)',[598] = 'Police Car (LVPD)',[599] = 'Police Ranger',[600] = 'Picador',[601] = 'S.W.A.T.',[602] = 'Alpha',[603] = 'Phoenix',[604] = 'Glendale Shit',[605] = 'Sadler Shit',[606] = 'Baggage Trailer A',[607] = 'Baggage Trailer B',[608] = 'Tug Stairs Trailer',[609] = 'Boxville',[610] = 'Farm Trailer',[611] = 'Utility Trailer',},
    Skins = {[0] = 'no skin',[1] = 'truth',[2] = 'maccer',[3] = 'andre',[4] = 'bbthin',[5] = 'bb',[6] = 'emmet',[7] = 'Male01',[8] = 'janitor',[9] = 'bfori',[10] = 'bfost',[11] = 'vbfycrp',[12] = 'bfyri',[13] = 'bfyst',[14] = 'bmori',[15] = 'bmost',[16] = 'bmyap',[17] = 'bmybu',[18] = 'bmybe',[19] = 'bmydj',[20] = 'bmyri',[21] = 'bmycr',[22] = 'bmyst',[23] = 'wmybmx',[24] = 'wbdyg1',[25] = 'wbdyg2',[26] = 'wmybp',[27] = 'wmycon',[28] = 'bmydrug',[29] = 'wmydrug',[30] = 'hmydrug',[31] = 'dwfolc',[32] = 'dwmolc1',[33] = 'dwmolc2',[34] = 'dwmylc1',[35] = 'hmogar',[36] = 'wmygol1',[37] = 'wmygol2',[38] = 'hfori',[39] = 'hfost',[40] = 'hfyri',[41] = 'hfyst',[42] = 'jethro',[43] = 'hmori',[44] = 'hmost',[45] = 'hmybe',[46] = 'hmyri',[47] = 'hmycr',[48] = 'hmyst',[49] = 'omokung',[50] = 'wmymech',[51] = 'bmymoun',[52] = 'wmymoun',[53] = 'Unknown',[54] = 'ofost',[55] = 'ofyri',[56] = 'ofyst',[57] = 'omori',[58] = 'omost',[59] = "omyri",[60] = 'omyst',[61] = 'wmyplt',[62] = 'wmopj',[63] = 'bfypro',[64] = 'hfypro',[65] = 'kendl',[66] = 'bmypol1',[67] = 'bmypol2',[68] = 'wmoprea',[69] = 'sbfyst',[70] = 'wmosci',[71] = 'wmysgrd',[72] = 'swmyhp1',[73] = 'swmyhp2',[74] = 'no skin',[75] = 'swfopro',[76] = 'wfystew',[77] = 'swmotr1',[78] = 'wmotr1',[79] = 'bmotr1',[80] = 'vbmybox',[81] = 'vwmybox',[82] = 'vhmyelv',[83] = 'vbmyelv',[84] = 'vimyelv',[85] = 'vwfypro',[86] = 'ryder3',[87] = 'vwfyst1',[88] = 'wfori',[89] = 'wfost',[90] = 'wfyjg',[91] = 'wfyri',[92] = 'wfyro',[93] = 'wfyst',[94] = 'wmori',[95] = 'wmost',[96] = 'wmyjg',[97] = 'wmylg',[98] = 'wmyri',[99] = 'wmyro',[100] = 'wmycr',[101] = 'wmyst',[102] = 'ballas1',[103] = 'ballas2',[104] = 'ballas3',[105] = 'fam1',[106] = 'fam2',[107] = 'fam3',[108] = 'lsv1',[109] = 'lsv2',[110] = 'lsv3',[111] = 'maffa',[112] = 'maffb',[113] = 'mafboss',[114] = 'vla1',[115] = 'vla2',[116] = 'vla3',[117] = 'triada',[118] = 'triadb',[119] = 'sindaco',[120] = 'triboss',[121] = 'dnb1',[122] = 'dnb2',[123] = 'dnb3',[124] = 'vmaff1',[125] = 'vmaff2',[126] = 'vmaff3',[127] = 'vmaff4',[128] = 'dnmylc',[129] = 'dnfolc1',[130] = 'dnfolc2',[131] = 'dnfylc',[132] = 'dnmolc1',[133] = 'dnmolc2',[134] = 'sbmotr2',[135] = 'swmotr2',[136] = 'sbmytr3',[137] = 'swmotr3',[138] = 'wfybe',[139] = 'bfybe',[140] = 'hfybe',[141] = 'sofybu',[142] = 'sbmyst',[143] = 'sbmycr',[144] = 'bmycg LA',[145] = 'wfycrk',[146] = 'hmycm',[147] = 'wmybu',[148] = 'bfybu',[149] = 'smokev',[150] = 'wfybu',[151] = 'dwfylc1',[152] = 'wfypro',[153] = 'wmyconb',[154] = 'wmybe',[155] = 'wmypizz',[156] = 'bmobar',[157] = 'cwfyhb',[158] = 'cwmofr',[159] = 'cwmohb1',[160] = 'cwmohb2',[161] = 'cwmyfr',[162] = 'cwmyhb1',[163] = 'bmyboun',[164] = 'wmyboun',[165] = 'wmomib',[166] = 'bmymib',[167] = 'wmybell',[168] = 'bmochil',[169] = 'sofyri',[170] = 'somyst',[171] = 'vwmybjd',[172] = 'vwfycrp',[173] = 'sfr1',[174] = 'sfr2',[175] = 'sfr3',[176] = 'bmybar',[177] = 'wmybar',[178] = 'wfysex',[179] = 'wmyammo',[180] = 'bmytatt',[181] = 'vwmycr',[182] = 'vbmocd',[183] = 'vbmycr',[184] = 'vhmycr',[185] = 'sbmyri',[186] = 'somyri',[187] = 'somybu',[188] = 'swmyst',[189] = 'wmyva',[190] = 'copgrl3',[191] = 'gungrl3',[192] = 'mecgrl3',[193] = 'nurgrl3',[194] = 'crogrl3',[195] = 'gangrl3',[196] = 'cwfofr',[197] = 'cwfohb',[198] = 'cwfyfr1',[199] = 'cwfyfr2',[200] = 'cwmyhb2',[201] = 'dwfylc2',[202] = 'dwmylc2',[203] = 'omykara',[204] = 'wmykara',[205] = 'wfyburg',[206] = 'vwmycd',[207] = 'vhfypro',[208] = 'suzie',[209] = 'omonood',[210] = 'omoboat',[211] = 'wfyclot',[212] = 'vwmotr1',[213] = 'vwmotr2',[214] = 'vwfywai',[215] = 'sbfori',[216] = 'swfyri',[217] = 'wmyclot',[218] = 'sbfost',[219] = 'sbfyri',[220] = 'sbmocd',[221] = 'sbmori',[222] = 'sbmost',[223] = 'shmycr',[224] = 'sofori',[225] = 'sofost',[226] = 'sofyst',[227] = 'somobu',[228] = 'somori',[229] = 'somost',[230] = 'swmotr5',[231] = 'swfori',[232] = 'swfost',[233] = 'swfyst',[234] = 'swmocd',[235] = 'swmori',[236] = 'swmost',[237] = 'shfypro',[238] = 'sbfypro',[239] = 'swmotr4',[240] = 'swmyri',[241] = 'smyst',[242] = 'smyst2',[243] = 'sfypro',[244] = 'vbfyst2',[245] = 'vbfypro',[246] = 'vhfyst3',[247] = 'bikera',[248] = 'bikerb',[249] = 'bmypimp',[250] = 'swmycr',[251] = 'wfylg',[252] = 'wmyva2',[253] = 'bmosec',[254] = 'bikdrug',[255] = 'wmych',[256] = 'sbfystr',[257] = 'swfystr',[258] = 'heck1',[259] = 'heck2',[260] = 'bmycon',[261] = 'wmycd1',[262] = 'bmocd',[263] = 'vwfywa2',[264] = 'wmoice',[265] = 'tenpen',[266] = 'pulaski',[267] = 'Hernandez',[268] = 'dwayne',[269] = 'smoke',[270] = 'sweet',[271] = 'ryder',[272] = 'forelli',[273] = 'tbone',[274] = 'laemt1',[275] = 'lvemt1',[276] = 'sfemt1',[277] = 'lafd1',[278] = 'lvfd1',[279] = 'sffd1',[280] = 'lapd1',[281] = 'sfpd1',[282] = 'lvpd1',[283] = 'csher',[284] = 'lapdm1',[285] = 'swat',[286] = 'fbi',[287] = 'army',[288] = 'dsher',[289] = 'zero',[290] = 'rose',[291] = 'paul',[292] = 'cesar',[293] = 'ogloc',[294] = "wuzimu",[295] = 'torino',[296] = 'jizzy',[297] = 'maddogg',[298] = 'Catalina',[299] = 'claude'}
}
local Image = {
    Vehs = {},
    Skins = {}
}
--[[
function InitImages()
    local Path = {
        veh = getWorkingDirectory()..'\\resource\\models\\veh',
        skin = getWorkingDirectory()..'\\resource\\models\\skin'
    }
    for k, v in pairs(List.Vehs) do
        if doesFileExist(Path.veh..'\\'..tostring(k)..'.png') then
            Image.Vehs[k] = imgui.CreateTextureFromFile(Path.veh..'\\'..tostring(k)..'.png')
        end
    end
    for k, v in pairs(List.Skins) do
        if doesFileExist(Path.skin..'\\'..tostring(k)..'.png') then
            Image.Skins[k] = imgui.CreateTextureFromFile(Path.skin..'\\'..tostring(k)..'.png')
        end
    end
end

imgui.OnInitialize(function()
    InitImages()
end)
]]
--DRAW TD IN IMGUI
local ffi = require "ffi"

local MODEL_INFO_ATOMIC = 1
local MODEL_INFO_TIME = 3
local MODEL_INFO_WEAPON = 4
local MODEL_INFO_CLUMP = 5
local MODEL_INFO_VEHICLE = 6
local MODEL_INFO_PED = 7
local MODEL_INFO_LOD = 8

ffi.cdef [[
    typedef unsigned char RwUInt8;
    typedef int RwInt32;
    typedef short RwInt16;

    struct RwRaster {
        struct RwRaster             *parent;
        RwUInt8                     *cpPixels;
        RwUInt8                     *palette;
        RwInt32                     width, height, depth;
        RwInt32                     stride;
        RwInt16                     nOffsetX, nOffsetY;
        RwUInt8                     cType;
        RwUInt8                     cFlags;
        RwUInt8                     privateFlags;
        RwUInt8                     cFormat;
        RwUInt8                     *originalPixels;
        RwInt32                      originalWidth;
        RwInt32                      originalHeight;
        RwInt32                      originalStride;
        void*                       texture_ptr;
    };

    struct RwTexture {
        struct RwRaster* raster;
    };

    struct CBaseModelInfo_vtbl {
        void* destructor;
        void* AsAtomicModelInfoPtr;
        void* AsDamageAtomicModelInfoPtr;
        void* AsLodAtomicModelInfoPtr;
        char(__thiscall* GetModelType)(struct CBaseModelInfo*);
    };

    struct CBaseModelInfo {
        struct CBaseModelInfo_vtbl* vtbl;
    };

    typedef struct RwTexture*(__thiscall* vehicle_render_t)(unsigned long, int, int, float*, float, int, int);
    typedef struct RwTexture*(__thiscall* ped_render_t)(unsigned long, int, int, float*, float);
    typedef struct RwTexture*(__thiscall* others_render_t)(unsigned long, int, int, float*, float);
]]

local RwTextureDestroy = ffi.cast("int(__cdecl*)(struct RwTexture*)", 0x7F3820)
local GetModelInfo = ffi.cast("struct CBaseModelInfo*(__cdecl*)(int)", 0x403DA0)

local textures_from_render = {}

function render_ond3d_lost()
    for i = 1, #textures_from_render do
        RwTextureDestroy(textures_from_render[i])
    end
end

function render_model(model_id, params)
    if 0 > model_id or model_id >= 20000 then return nil end

    local backcolor = params["background_color"]
    local zoom = params["zoom"]
    local rot = params["rotation"]
    local rotation = ffi.new("float [3]")
    rotation[0] = rot.x
    rotation[1] = rot.y
    rotation[2] = rot.z

    local offsets = {
        ["vehicle"]   = { ["R1"] = 0x2EE4E5, ["R3"] = 0x6BC50 },
        ["ped"]       = { ["R1"] = 0x2F522D, ["R3"] = 0x6B9D0 },
        ["others"]    = { ["R1"] = 0x2BE702, ["R3"] = 0x6C240 },
        ["sampst"]    = { ["R1"] = 0x21A108, ["R3"] = 0x26E8F0 }
    }
    local vSAMP = getGameGlobal(707) <= 21 and "R1" or "R3"

    local model_info = GetModelInfo(model_id);
    if model_info ~= ffi.NULL then
        local model_type = model_info.vtbl.GetModelType(model_info);
        local sampst = ffi.cast("unsigned long*", sampGetBase() + offsets["sampst"][vSAMP])[0]

        local result = ffi.NULL
        if model_type == MODEL_INFO_VEHICLE then
            local func_addr = sampGetBase() + offsets["vehicle"][vSAMP]
            result = ffi.cast("vehicle_render_t", func_addr)(sampst, model_id, backcolor,  rotation, zoom, params["carc_1"], params["carc_2"])
        elseif model_type == MODEL_INFO_PED then
            local func_addr = sampGetBase() + offsets["ped"][vSAMP]
            result = ffi.cast("ped_render_t", func_addr)(sampst, model_id, backcolor,  rotation, zoom)
        elseif model_type == MODEL_INFO_WEAPON or model_type == MODEL_INFO_ATOMIC or model_type == MODEL_INFO_CLUMP then
            local func_addr = sampGetBase() + offsets["others"][vSAMP]
            result = ffi.cast("others_render_t", func_addr)(sampst, model_id, backcolor,  rotation, zoom)
        else
            return nil
        end
        if result ~= ffi.NULL and result.raster ~= ffi.NULL and result.raster.texture_ptr ~= ffi.NULL then
            textures_from_render[#textures_from_render + 1] = result
            return result.raster.texture_ptr
        end
        return nil
    end
end
local texture = nil
local model = 411

local newFrame = imgui.OnFrame(
    function() return renderWindow[0] end,
    function(player)
        local resX, resY = getScreenResolution()
        local sizeX, sizeY = 300, 300
        imgui.SetNextWindowPos(imgui.ImVec2(resX / 2, resY / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
        imgui.SetNextWindowSize(imgui.ImVec2(sizeX, sizeY), imgui.Cond.FirstUseEver)
        --imgui.Begin('Main Window', renderWindow)
        imgui.BeginCustomTitle('Vehs And Skins', 30, renderWindow, 0)
        
        local size = imgui.GetWindowSize()
        local TabSize = imgui.ImVec2((size.x - 15) / 2, 24)

        imgui.SetCursorPos(imgui.ImVec2(5, 35))
        if imgui.Button('Vehicles', TabSize) then tab = 0 end
        imgui.SameLine(TabSize.x + 10)
        if imgui.Button('Skins', TabSize) then tab = 1 end
        imgui.Separator()
        imgui.SetCursorPos(imgui.ImVec2(5, 35 + TabSize.y + 5 + 5))
        imgui.PushItemWidth(size.x - 10)
        imgui.InputText('##search', search, 128)
        imgui.PopItemWidth()
        if #ffi.string(search) == 0 then
            imgui.SameLine(15)
            imgui.TextDisabled('Search')
        end
        imgui.SetCursorPos(imgui.ImVec2(5, 35 + TabSize.y + 5 + 5 + 25))
        imgui.BeginChild('CONTENT', imgui.ImVec2(size.x - 10, size.y - 5 - 35 - TabSize.y - 5 - 25 - 5), true)
        local _List = tab == 0 and List.Vehs or List.Skins
        for k, v in pairs(_List) do
            local Text = tostring(k)..'. '..tostring(v)
            if #ffi.string(search) == 0 or Text:lower():find(ffi.string(search):lower(), nil, true) then
                imgui.Text(Text)
                if imgui.IsItemHovered() then
                    if model ~= k then
                        model = k
                        texture = render_model(model, {
                            ["background_color"] = 0x00000000,
                            ["zoom"] = 1,
                            ["rotation"] = { ["x"] = 0, ["y"] = 0, ["z"] = 320 },
                            ["carc_1"] = 0,
                            ["carc_2"] = 1
                        })
                    end
                        
                    imgui.BeginTooltip()
                    imgui.Text(Text)
                    if texture then
                        imgui.Image(texture, imgui.ImVec2(256, 256))
                    end
                    imgui.EndTooltip()
                end
            end
        end
        imgui.EndChild()

        imgui.End()
    end
)

function onD3DDeviceLost()
    render_ond3d_lost()
    texture = nil
end

function main()
    while not isSampAvailable() do wait(0) end
    texture = render_model(411, {
        ["background_color"] = 0x00000000,
        ["zoom"] = 1,
        ["rotation"] = { ["x"] = 90, ["y"] = 0, ["z"] = 0 },
        ["carc_1"] = 0,
        ["carc_2"] = 1
    })
    sampRegisterChatCommand('vsinfo', function()
        renderWindow[0] = not renderWindow[0]
    end)
    wait(-1)
end

function imgui.BeginCustomTitle(title, titleSizeY, var, flags)
    imgui.PushStyleVarVec2(imgui.StyleVar.WindowPadding, imgui.ImVec2(0, 0))
    imgui.PushStyleVarFloat(imgui.StyleVar.WindowBorderSize, 0)
    imgui.Begin(title, var, imgui.WindowFlags.NoTitleBar + (flags or 0))
    imgui.SetCursorPos(imgui.ImVec2(0, 0))
    local p = imgui.GetCursorScreenPos()
    imgui.GetWindowDrawList():AddRectFilled(p, imgui.ImVec2(p.x + imgui.GetWindowSize().x, p.y + titleSizeY), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.TitleBgActive]), imgui.GetStyle().WindowRounding, 1 + 2)
    imgui.SetCursorPos(imgui.ImVec2(imgui.GetWindowSize().x / 2 - imgui.CalcTextSize(title).x / 2, titleSizeY / 2 - imgui.CalcTextSize(title).y / 2))
    imgui.Text(title)
    imgui.SetCursorPos(imgui.ImVec2(imgui.GetWindowSize().x - (titleSizeY - 10) - 5, 5))
    imgui.PushStyleVarFloat(imgui.StyleVar.FrameRounding, imgui.GetStyle().WindowRounding)
    if imgui.Button('X##CLOSEBUTTON.WINDOW.'..title, imgui.ImVec2(titleSizeY - 10, titleSizeY - 10)) then var[0] = false end
    imgui.SetCursorPos(imgui.ImVec2(5, titleSizeY + 5))
    imgui.PopStyleVar(3)
    imgui.PushStyleVarVec2(imgui.StyleVar.WindowPadding, imgui.ImVec2(5, 5))
end
 
  • Нравится
Реакции: Foxy01 и Ackerman_Kirito

Ackerman_Kirito

Новичок
Автор темы
24
0
Lua:
-- in imgui
-- input - поисковая строка*
-- :lower() переводит текст в нижний регистр(:upper() в верхний)
-- ..позволяя искать текст не зависимости от КАПСА
if #input.v ~= 0 then
    for k,v in pairs(tCarsName) do
        if v:lower():find(input.v:lower()) then
            imgui.Text('id car:'..k+400..',veh:'..v)
        end
    end
else
    imgui.Text('nothing..')
end
Вот на эту строчку ругается, как исправить подскажи пожалуйста
На эту строчку:
                        imgui.Text('id car:'..k+400..',veh:'..v)
[ML] (error) auto and skin.lua: C:\Game play\Для сборки\SAMP\moonloader\auto and skin.lua:644: malformed number near '400..'
 
Последнее редактирование:

Vespan

Чешский луашер
Проверенный
2,123
1,729
Вот на эту строчку ругается, как исправить подскажи пожалуйста
На эту строчку:
                        imgui.Text('id car:'..k+400..',veh:'..v)
[ML] (error) auto and skin.lua: C:\Game play\Для сборки\SAMP\moonloader\auto and skin.lua:644: malformed number near '400..'
лан,убери +400
всё айди авто начинаються с 400,а массив в луа с 1
 
  • Нравится
Реакции: Ackerman_Kirito

Vespan

Чешский луашер
Проверенный
2,123
1,729
Убрал он на 641 начал ругаться. Прости за тупость
Ну так замени input.v на свой,оно как пример.
Можешь ещё сюда зайти,скачать последнюю версию и строки 858 850 где есть поиск.
 

RTD

Потужно
Модератор
399
470
Никто не любит filter(
Lua:
local filter = imgui.ImGuiTextFilter()
local lines = { u8"кирилица", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" };
imgui.OnFrame(function() return true end, function()
    imgui.Text([[Filter usage:"
""         display all lines
"xxx"      display lines containing "xxx"
"xxx,yyy"  display lines containing "xxx" or "yyy"
"-xxx"     hide lines containing "xxx"]]);
    filter:Draw(--[[u8"Просто поиск", ширина]])
    for i = 1, #lines do
        --[[if not filter:PassFilter(lines[i]) then
            continue --вот би била егэ па continue в луа но и так норм
        end]]
        if filter:PassFilter(lines[i]) then
            imgui.BulletText("%s", lines[i])
        end
    end
    if imgui.Button("Clear") then
        filter:Clear()
    end
    imgui.Text(filter:IsActive() and "Filter on" or "Filter off")
end)