Ошибка pairs

Vespan

Чешский луашер
Автор темы
Проверенный
2,119
1,719
Версия MoonLoader
.026-beta
Lua:
-- ↑ main
local Allcars = {"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"}


-- imgui
            for k,v in pairs(AllCars) do
                if TableInput.SearchCar.v ~= '' then
                    if string.rlower(v):find(string.rlower(u8:decode(TableInput.SearchCar.v))) then
                        if imgui.Button(u8(v)) then
                            sampAddChatMessage('1', -1)
                        end
                    end
                end
            end       
            
            -- moon log
            [02:12:49.422122] (error)    Gold Tools : D:\GTASHKA\moonloader\Gold Tools.lua:3502: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
    [C]: in function 'pairs'
    D:\GTASHKA\moonloader\Gold Tools.lua:3502: in function 'OnDrawFrame'
    D:\GTASHKA\moonloader\lib\imgui.lua:1378: in function <D:\GTASHKA\moonloader\lib\imgui.lua:1367>
[02:12:49.430124] (error)    Gold Tools : Script died due to an error. (2C3EF224)
 
Решение
Lua:
            for k,v in pairs(Allcars > AllCars) do
                if TableInput.SearchCar.v ~= '' then
                    if string.rlower(v):find(string.rlower(u8:decode(TableInput.SearchCar.v))) then
                        if imgui.Button(u8(v)) then
                            sampAddChatMessage('1', -1)
                        end
                    end
                end
            end    
           
            ???
Сначала выучи азы луа. У тебя переменная в одном регистре а ты пишешь по другому

Vespan

Чешский луашер
Автор темы
Проверенный
2,119
1,719
  • Ха-ха
Реакции: qdIbp

molimawka

Известный
Друг
443
655
Lua:
            for k,v in pairs(Allcars > AllCars) do
                if TableInput.SearchCar.v ~= '' then
                    if string.rlower(v):find(string.rlower(u8:decode(TableInput.SearchCar.v))) then
                        if imgui.Button(u8(v)) then
                            sampAddChatMessage('1', -1)
                        end
                    end
                end
            end    
           
            ???
Сначала выучи азы луа. У тебя переменная в одном регистре а ты пишешь по другому
 
  • Нравится
Реакции: Vespan