diff --git a/cheat-menu.lua b/cheat-menu.lua index 9863d70c..eda96787 100755 --- a/cheat-menu.lua +++ b/cheat-menu.lua @@ -21,7 +21,7 @@ script_url("https://forum.mixmods.com.br/f5-scripts-codigos/t1777-lua-cheat-menu script_dependencies("ffi","mimgui","memory","MoonAdditions") script_properties('work-in-pause') script_version("1.7-staging") -script_version_number(28092019) -- DDMMYYYY +script_version_number(27092019) -- DDMMYYYY -- All the command keys used throughout the Cheat-Menu tkeys = @@ -45,7 +45,6 @@ tkeys = resX,resY = getScreenResolution() --- Script Dependencies ffi = require "ffi" imgui = require 'mimgui' memory = require 'memory' @@ -84,6 +83,7 @@ if fmenu.tmenu.disable_in_samp[0] and isSampLoaded() then script.this:unload() end + tcheatmenu = { dir = Dir, @@ -97,10 +97,8 @@ tcheatmenu = show = imgui.new.bool(false), title = string.format("%s v%s by %s",script.this.name,script.this.version,script.this.authors[1]), }, - menubuttons = - { - current = fconfig.get('tcheatmenu.menubuttons.current',1), - }, + current_menu = fconfig.get('tcheatmenu.current_menu',1), + update = { available = false, @@ -108,8 +106,6 @@ tcheatmenu = }, } -fmenu.tmenu.overlay.position_array = imgui.new['const char*'][#fmenu.tmenu.overlay.position](fmenu.tmenu.overlay.position) - imgui.OnInitialize(function() -- Called once -- Styles imgui.PushStyleVarFloat(imgui.StyleVar.WindowBorderSize,0) @@ -143,7 +139,7 @@ function(self) -- render frame imgui.Spacing() end - fcommon.UiCreateButtons({"Teleport","Memory","Player","Animation","Vehicle","Weapon","Peds","Mission","Game","Visual","Menu", + fcommon.CreateMenus({"Teleport","Memory","Player","Animation","Vehicle","Weapon","Peds","Mission","Game","Visual","Menu", "About"},{fteleport.TeleportMain,fmemory.MemoryMain,fplayer.PlayerMain,fanimation.AnimationMain,fvehicle.VehicleMain, fweapon.WeaponMain,fped.PedMain,fmission.MissionMain,fgame.GameMain,fvisual.VisualMain,fmenu.MenuMain, fabout.AboutMain}) @@ -153,8 +149,8 @@ end) imgui.OnFrame(function() - return fmenu.tmenu.overlay.show[0] and fmenu.tmenu.overlay.fps[0] and fmenu.tmenu.overlay.coordinates[0] and not isGamePaused() - or ((fmenu.tmenu.overlay.speed[0] or fmenu.tmenu.overlay.health[0]) and isCharInAnyCar(PLAYER_PED)) + return not isGamePaused() and (fmenu.tmenu.overlay.show[0] and fmenu.tmenu.overlay.fps[0] and fmenu.tmenu.overlay.coordinates[0] + or ((fmenu.tmenu.overlay.speed[0] or fmenu.tmenu.overlay.health[0]) and isCharInAnyCar(PLAYER_PED))) end, function() local io = imgui.GetIO() @@ -179,7 +175,6 @@ function() if fmenu.tmenu.overlay.fps[0] then imgui.Text("Frames :" .. tostring(math.floor(imgui.GetIO().Framerate))) end - if isCharInAnyCar(PLAYER_PED) then car = getCarCharIsUsing(PLAYER_PED) if fmenu.tmenu.overlay.speed[0] then @@ -220,8 +215,8 @@ function() end if imgui.MenuItemBool("Close") then fgame.tgame.fps.bool[0] = false - fvehicle.tvehicles.show.speed[0] = false - fvehicle.tvehicles.show.health[0] = false + fvehicle.tvehicle.show.speed[0] = false + fvehicle.tvehicle.show.health[0] = false fvisual.tvisuals.show_coordinates[0] = false end imgui.EndPopup() @@ -249,7 +244,28 @@ function main() writeMemory(0x004384D1 ,4,0x000000D0 ,false) writeMemory(0x004384D5 ,4,0x90909090 ,false) end - + + switchArrestPenalties(fgame.tgame.keep_stuff[0]) + switchDeathPenalties(fgame.tgame.keep_stuff[0]) + setGangWarsActive(fped.tped.gang_wars[0]) + setPlayerFastReload(PLAYER_HANDLE,fweapon.tweapon.fast_reload[0]) + + if fweapon.tweapon.no_reload[0] then + writeMemory( 7600773,1,144,1) + writeMemory( 7600815,1,144,1) + writeMemory( 7600816,2,37008,1) + writeMemory( 7612591,1,144,1) + writeMemory( 7612646,1,144,1) + writeMemory( 7612647,2,37008,1) + else + writeMemory( 7600773,1,72,1) + writeMemory( 7600815,1,255,1) + writeMemory( 7600816,2,3150,1) + writeMemory( 7612591,1,72,1) + writeMemory( 7612646,1,255,1) + writeMemory( 7612647,2,3150,1) + end + while true do if fanimation.tanimation.ped[0] == true or fweapon.tweapon.ped[0] == true then @@ -281,7 +297,7 @@ function main() fcommon.KeyWait(tkeys.teleport_key1,tkeys.teleport_key2) fteleport.Teleport() end - + setCharProofs(PLAYER_PED,fplayer.tplayer.god[0],fplayer.tplayer.god[0],fplayer.tplayer.god[0],fplayer.tplayer.god[0],fplayer.tplayer.god[0]) if fplayer.tplayer.aimSkinChanger[0] and isKeyDown(tkeys.asc_key) then @@ -294,7 +310,7 @@ function main() end if isKeyDown(tkeys.control_key) and isKeyDown(tkeys.quickspawner_key) then - if (fvehicle.tvehicles.quick_spawn[0] or fweapon.tweapons.quick_spawn[0]) then + if (fvehicle.tvehicle.quick_spawn[0] or fweapon.tweapon.quick_spawn[0]) then fcommon.QuickSpawner() end end @@ -304,41 +320,40 @@ function main() lua_thread.create(fvehicle.AircraftCamera) end - -- Vehicle related stuff which is required to run every frame if isCharInAnyCar(PLAYER_PED) then car = getCarCharIsUsing(PLAYER_PED) - if fvehicle.tvehicles.color.default ~= -1 then + if fvehicle.tvehicle.color.default ~= -1 then local color_id = getCarColours(car) - if fvehicle.tvehicles.color.default ~= color_id then + if fvehicle.tvehicle.color.default ~= color_id then fvehicle.ForEachCarComponent(function(mat) mat:reset_color() end) end end - setCarCanBeDamaged(car,not(fvehicle.tvehicles.no_damage[0])) - setCharCanBeKnockedOffBike(PLAYER_PED,fvehicle.tvehicles.stay_on_bike[0]) - setCarHeavy(car,fvehicle.tvehicles.heavy[0]) + setCarCanBeDamaged(car,not(fvehicle.tvehicle.no_damage[0])) + setCharCanBeKnockedOffBike(PLAYER_PED,fvehicle.tvehicle.stay_on_bike[0]) + setCarHeavy(car,fvehicle.tvehicle.heavy[0]) - if fvehicle.tvehicles.lock_speed[0] then - if fvehicle.tvehicles.speed[0] > 500 then - fvehicle.tvehicles.speed[0] = 500 + if fvehicle.tvehicle.lock_speed[0] then + if fvehicle.tvehicle.speed[0] > 500 then + fvehicle.tvehicle.speed[0] = 500 end - setCarForwardSpeed(car,fvehicle.tvehicles.speed[0]) + setCarForwardSpeed(car,fvehicle.tvehicle.speed[0]) end - setCarCanBeVisiblyDamaged(car,not(fvehicle.tvehicles.visual_damage[0])) + setCarCanBeVisiblyDamaged(car,not(fvehicle.tvehicle.visual_damage[0])) if getCarDoorLockStatus(car) == 4 then - fvehicle.tvehicles.lock_doors[0] = true + fvehicle.tvehicle.lock_doors[0] = true else - fvehicle.tvehicles.lock_doors[0] = false + fvehicle.tvehicle.lock_doors[0] = false end else - fvehicle.tvehicles.lock_doors[0] = false - fvehicle.tvehicles.lights.all[0] = false + fvehicle.tvehicle.lock_doors[0] = false + fvehicle.tvehicle.lights[0] = false end wait(0) diff --git a/lib/cheat-menu/modules/about.lua b/lib/cheat-menu/modules/about.lua index 1b6db857..48d3610f 100755 --- a/lib/cheat-menu/modules/about.lua +++ b/lib/cheat-menu/modules/about.lua @@ -23,7 +23,7 @@ function module.AboutMain() imgui.BulletText(string.format("Version number : %d",script.this.version_num)) imgui.SameLine() if imgui.Button("Check for update",imgui.ImVec2(120,20)) then - fupdate.CheckUpdates() + lua_thread.create(fupdate.CheckUpdates) end imgui.BulletText(string.format("Author : %s",script.this.authors[1])) imgui.BulletText(string.format("Imgui : v%s",imgui._VERSION)) diff --git a/lib/cheat-menu/modules/animation.lua b/lib/cheat-menu/modules/animation.lua index ce94f76f..5bb46dd5 100755 --- a/lib/cheat-menu/modules/animation.lua +++ b/lib/cheat-menu/modules/animation.lua @@ -16,31 +16,30 @@ local module = {} -local tanimation = +module.tanimation = { - loop = imgui.new.bool(fconfig.get('tanimation.loop',false)), - secondary = imgui.new.bool(fconfig.get('tanimation.secondary',false)), - search_text = imgui.new.char[20](), - name = imgui.new.char[20](), - ifp_name = imgui.new.char[20](), - fighting = + fighting = { - selected = imgui.new.int(fconfig.get('tanimation.fighting.selected',0)), - names = {"Default","Boxing","Kung fu","Kick Boxing","Punch Kick"}, - list = {}, + selected = imgui.new.int(fconfig.get('tanimation.fighting.selected',0)), + names = {"Default","Boxing","Kung fu","Kick Boxing","Punch Kick"}, + array = {}, + }, + ifp_name = imgui.new.char[20](), + loop = imgui.new.bool(fconfig.get('tanimation.loop',false)), + name = imgui.new.char[20](), + ped = imgui.new.bool(fconfig.get('tanimation.ped',false)), + secondary = imgui.new.bool(fconfig.get('tanimation.secondary',false)), + search_text = imgui.new.char[20](), + walking = + { + selected = imgui.new.int(fconfig.get('tanimation.walking.selected',0)), + names = {"man","shuffle","oldman","gang1","gang2","oldfatman","fatman","jogger","drunkman","blindman","swat","woman","shopping","busywoman","sexywoman","pro","oldwoman","fatwoman","jogwoman","oldfatwoman","skate"}, + array = {}, }, - walking = - { - selected = imgui.new.int(fconfig.get('tanimation.walking.selected',0)), - names = {"man","shuffle","oldman","gang1","gang2","oldfatman","fatman","jogger","drunkman","blindman","swat","woman","shopping","busywoman","sexywoman","pro","oldwoman","fatwoman","jogwoman","oldfatwoman","skate"}, - list = {}, - }, - ped = imgui.new.bool(fconfig.get('tanimation.ped',false)), } -module.tanimation = tanimation -tanimation.fighting.list = imgui.new['const char*'][#tanimation.fighting.names](tanimation.fighting.names) -tanimation.walking.list = imgui.new['const char*'][#tanimation.walking.names](tanimation.walking.names) +module.tanimation.fighting.array = imgui.new['const char*'][#module.tanimation.fighting.names](module.tanimation.fighting.names) +module.tanimation.walking.array = imgui.new['const char*'][#module.tanimation.walking.names](module.tanimation.walking.names) function AnimationEntry(file,animation) @@ -55,7 +54,7 @@ function AnimationEntry(file,animation) end function PlayAnimation(file,animation) - if fanimation.tanimation.ped[0] == true then + if module.tanimation.ped[0] == true then if fped.tped.selected ~= nil then char = fped.tped.selected else @@ -66,10 +65,10 @@ function PlayAnimation(file,animation) char = PLAYER_PED end - if tanimation.secondary[0] == true then - taskPlayAnimSecondary(char,animation,file,4.0,tanimation.loop[0],0,0,0,-1) + if module.tanimation.secondary[0] == true then + taskPlayAnimSecondary(char,animation,file,4.0,module.tanimation.loop[0],0,0,0,-1) else - taskPlayAnim(char,animation,file,4.0,tanimation.loop[0],0,0,0,-1) + taskPlayAnim(char,animation,file,4.0,module.tanimation.loop[0],0,0,0,-1) end fcommon.CheatActivated() if file ~= "ped" then @@ -82,7 +81,7 @@ function module.AnimationMain() imgui.Spacing() if imgui.Button("Stop animation",imgui.ImVec2(fcommon.GetSize(1))) then local char = nil - if fanimation.tanimation.ped[0] == true then + if module.tanimation.ped[0] == true then if fped.tped.selected ~= nil then char = fped.tped.selected else @@ -97,10 +96,10 @@ function module.AnimationMain() end imgui.Spacing() imgui.Columns(2,nil,false) - fcommon.CheckBox({name = "Loop",var = tanimation.loop}) - fcommon.CheckBox({name = "Ped",var = tanimation.ped,help_text = "Play animation on ped.Aim with a gun to select."}) + fcommon.CheckBox({name = "Loop",var = module.tanimation.loop}) + fcommon.CheckBox({name = "Ped",var = module.tanimation.ped,help_text = "Play animation on ped.Aim with a gun to select."}) imgui.NextColumn() - fcommon.CheckBox({name = "Secondary",var = tanimation.secondary}) + fcommon.CheckBox({name = "Secondary",var = module.tanimation.secondary}) imgui.Columns(1) imgui.Spacing() if imgui.BeginTabBar("Animation") then @@ -135,17 +134,17 @@ function module.AnimationMain() imgui.Spacing() imgui.Columns(1) - if imgui.InputText("Search",tanimation.search_text,ffi.sizeof(tanimation.search_text)) then end + if imgui.InputText("Search",module.tanimation.search_text,ffi.sizeof(module.tanimation.search_text)) then end imgui.SameLine() imgui.Spacing() - imgui.Text("Found entries :(" .. ffi.string(tanimation.search_text) .. ")") + imgui.Text("Found entries :(" .. ffi.string(module.tanimation.search_text) .. ")") imgui.Separator() imgui.Spacing() if imgui.BeginChild("Stat Entries") then for key,value in pairs(ftable.animation.table) do file, animation = value:match("([^$]+)$([^$]+)") - if (string.upper(animation):find(string.upper(ffi.string(tanimation.search_text)))) then + if (string.upper(animation):find(string.upper(ffi.string(module.tanimation.search_text)))) then AnimationEntry(file,animation) end end @@ -158,28 +157,28 @@ function module.AnimationMain() if imgui.BeginTabItem("Misc") then - if imgui.Combo("Fighting", tanimation.fighting.selected,tanimation.fighting.list,#tanimation.fighting.names) then - giveMeleeAttackToChar(PLAYER_PED,tanimation.fighting.selected[0]+4,6) + if imgui.Combo("Fighting", module.tanimation.fighting.selected,module.tanimation.fighting.array,#module.tanimation.fighting.names) then + giveMeleeAttackToChar(PLAYER_PED,module.tanimation.fighting.selected[0]+4,6) fcommon.CheatActivated() end - if imgui.Combo("Walking", tanimation.walking.selected,tanimation.walking.list,#tanimation.walking.names) then + if imgui.Combo("Walking", module.tanimation.walking.selected,module.tanimation.walking.array,#module.tanimation.walking.names) then writeMemory(0x609A4E,4,-1869574000,true) writeMemory(0x609A52,2,37008,true) - requestAnimation(tanimation.walking.names[tanimation.walking.selected[0]+1]) + requestAnimation(module.tanimation.walking.names[module.tanimation.walking.selected[0]+1]) loadAllModelsNow() - setAnimGroupForChar(PLAYER_PED,tanimation.walking.names[tanimation.walking.selected[0]+1]) - removeAnimation(tanimation.walking.names[tanimationwalking.selected[0]+1]) + setAnimGroupForChar(PLAYER_PED,module.tanimation.walking.names[module.tanimation.walking.selected[0]+1]) + removeAnimation(module.tanimation.walking.names[module.tanimation.walking.selected[0]+1]) fcommon.CheatActivated() end imgui.EndTabItem() end if imgui.BeginTabItem("Custom") then - if imgui.InputText("IFP name",tanimation.ifp_name,ffi.sizeof(tanimation.ifp_name)) then end - if imgui.InputText("Animation name",tanimation.name,ffi.sizeof(tanimation.name)) then end + if imgui.InputText("IFP name",module.tanimation.ifp_name,ffi.sizeof(module.tanimation.ifp_name)) then end + if imgui.InputText("Animation name",module.tanimation.name,ffi.sizeof(module.tanimation.name)) then end imgui.Spacing() if imgui.Button("Play animation",imgui.ImVec2(fcommon.GetSize(1))) then - PlayAnimation(ffi.string(tanimation.ifp_name),ffi.string(tanimation.name)) + PlayAnimation(ffi.string(module.tanimation.ifp_name),ffi.string(module.tanimation.name)) end imgui.EndTabItem() end diff --git a/lib/cheat-menu/modules/common.lua b/lib/cheat-menu/modules/common.lua index 1ba4f422..8908100e 100755 --- a/lib/cheat-menu/modules/common.lua +++ b/lib/cheat-menu/modules/common.lua @@ -65,14 +65,14 @@ function module.QuickSpawner() local weapon = fweapon.CBaseWeaponInfo(text) - if fweapon.tweapons.quick_spawn[0] == true and weapon ~= 0 then - fweapon.GiveWeaponToPlayer(weapon) + if fweapon.tweapon.quick_spawn[0] == true and weapon ~= 0 then + fweapon.GiveWeapon(weapon) return end local vehicle = fvehicle.CBaseModelInfo(text) - if fvehicle.tvehicles.quick_spawn[0] == true and vehicle ~= 0 then + if fvehicle.tvehicle.quick_spawn[0] == true and vehicle ~= 0 then fvehicle.GiveVehicleToPlayer(vehicle) return end @@ -139,22 +139,20 @@ function module.GetSize(count,x,y) return x,y end -function module.UiCreateButtons(names,funcs) +function module.CreateMenus(names,funcs) imgui.PushStyleVarVec2(imgui.StyleVar.ItemSpacing,imgui.ImVec2(0,0)) for i=1,#names,1 do - if tcheatmenu.menubuttons.current == i then + if tcheatmenu.current_menu == i then imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(0.060,0.530,0.980,1.0)) end if imgui.Button(names[i],imgui.ImVec2(module.GetSize(4,imgui.GetWindowWidth()/4 - 4*imgui.StyleVar.WindowPadding,20))) then - tcheatmenu.menubuttons.current = i + tcheatmenu.current_menu = i end - if tcheatmenu.menubuttons.current == i then - imgui.GetStyleColorVec4(imgui.Col.Button) + if tcheatmenu.current_menu == i then imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(0.260,0.590,0.980,0.400)) end - if i%4 ~= 0 then imgui.SameLine() end @@ -162,14 +160,8 @@ function module.UiCreateButtons(names,funcs) imgui.PopStyleVar() imgui.Spacing() - - for i=1,#funcs,1 do - if tcheatmenu.menubuttons.current == i then - imgui.Spacing() - funcs[i]() - break - end - end + funcs[tcheatmenu.current_menu]() + end function LoadTextures(store_table,image_path,model_table,extention) @@ -209,6 +201,7 @@ function module.ShowEntries(title,model_table,height,width,store_table,image_pat if func_show_tooltip == nil then if imgui.IsMouseClicked(1) then removeVehicleMod(car,model_table[j]) + printHelpString("Component ~r~removed") end end @@ -256,8 +249,7 @@ function module.RadioButton(label,rb_table,addr_table) module.CheatActivated() end end - - if imgui.RadioButtonIntPtr("Default ".. string.lower(label),button,#addr_table + 1) then + if imgui.RadioButtonIntPtr("Default ##" ..label,button,#addr_table + 1) then for j = 1,#addr_table,1 do writeMemory(addr_table[j],1,0,false) end @@ -265,25 +257,6 @@ function module.RadioButton(label,rb_table,addr_table) end end -function module.RwMemory(address,size,value,protect,is_float) - if protect ~= true then protect = false end - if is_float ~= true then is_float = false end - - if value == nil then - if is_float then - return memory.getfloat(address,protect) - else - return memory.read(address,size,protect) - end - else - if is_float then - memory.setfloat(address,value,protect) - else - memory.write(address,value,size,protect) - end - end -end - function module.CheckBox(arg) arg.value = arg.value or 1 arg.value2 = arg.value2 or 0 @@ -355,21 +328,21 @@ function module.UpdateStat(arg) imgui.Columns(1) imgui.PushItemWidth(imgui.GetWindowWidth()-70) - if imgui.InputInt("Set",value) then + if imgui.InputInt("Set ##".. arg.name,value) then setFloatStat(arg.stat,value[0]) end imgui.PopItemWidth() imgui.Spacing() - if imgui.Button("Minimum",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Minimum ##".. arg.name,imgui.ImVec2(fcommon.GetSize(3))) then setFloatStat(arg.stat,arg.min) end imgui.SameLine() - if imgui.Button("Default",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Default ##".. arg.name,imgui.ImVec2(fcommon.GetSize(3))) then setFloatStat(arg.stat,arg.default) end imgui.SameLine() - if imgui.Button("Maximum",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Maximum ##".. arg.name,imgui.ImVec2(fcommon.GetSize(3))) then setFloatStat(arg.stat,arg.max) end if value[0] < arg.min then @@ -381,8 +354,25 @@ function module.UpdateStat(arg) end) end +function module.RwMemory(address,size,value,protect,is_float) + if protect == nil then protect = false end + + if value == nil then + if is_float == true then + return memory.getfloat(address,protect) + else + return readMemory(address,size,protect) + end + else + if is_float == true then + memory.setfloat(address,value,protect) + else + memory.write(address,value,size,protect) + end + end +end + function module.UpdateAddress(arg) - if arg.is_float == nil then arg.is_float = false end if arg.default == nil then arg.default = 0 end if arg.cvalue == nil then arg.cvalue = 1 end @@ -402,7 +392,7 @@ function module.UpdateAddress(arg) imgui.Spacing() - if imgui.InputFloat("",value) then + if imgui.InputFloat("##".. arg.name,value) then module.RwMemory(arg.address,arg.size,value[0],nil,arg.is_float) end imgui.SameLine(0.0,4.0) @@ -416,15 +406,15 @@ function module.UpdateAddress(arg) imgui.SameLine(0.0,4.0) imgui.Text("Set") imgui.Spacing() - if imgui.Button("Minimum",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Minimum ##".. arg.name,imgui.ImVec2(fcommon.GetSize(3))) then module.RwMemory(arg.address,arg.size,arg.min,nil,arg.is_float) end imgui.SameLine() - if imgui.Button("Default",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Default ##".. arg.name,imgui.ImVec2(fcommon.GetSize(3))) then module.RwMemory(arg.address,arg.size,arg.default,nil,arg.is_float) end imgui.SameLine() - if imgui.Button("Maximum",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Maximum ##".. arg.name,imgui.ImVec2(fcommon.GetSize(3))) then module.RwMemory(arg.address,arg.size,arg.max,nil,arg.is_float) end imgui.SameLine() diff --git a/lib/cheat-menu/modules/config.lua b/lib/cheat-menu/modules/config.lua index 0d37330a..574dd174 100755 --- a/lib/cheat-menu/modules/config.lua +++ b/lib/cheat-menu/modules/config.lua @@ -31,119 +31,113 @@ function module.write() tconfig.write = { - tcheatmenu = - { - menubuttons = - { - current = tcheatmenu.menubuttons.current, - }, - }, - - tteleport = - { - shortcut = fteleport.tteleport.shortcut[0], - auto_z = fteleport.tteleport.auto_z[0], - insert_coords = fteleport.tteleport.insert_coords[0], - coords = ffi.string(fteleport.tteleport.coords), - }, - tmemory = - { - address = ffi.string(fmemory.tmemory.address), - size = fmemory.tmemory.size[0], - vp = fmemory.tmemory.vp[0], - clear_entries = fmemory.tmemory.clear_entries[0], - value = fmemory.tmemory.value[0], - is_float = fmemory.tmemory.is_float[0], - }, - tplayer = - { - god = fplayer.tplayer.god[0], - aimSkinChanger = fplayer.tplayer.aimSkinChanger[0], - neverWanted = fplayer.tplayer.neverWanted[0], - cjBody = fplayer.tplayer.cjBody[0], - }, tanimation = { - loop = fanimation.tanimation.loop[0], - ped = fanimation.tanimation.ped[0], - secondary = fanimation.tanimation.secondary[0], fighting = { selected = fanimation.tanimation.fighting.selected[0], }, + loop = fanimation.tanimation.loop[0], + ped = fanimation.tanimation.ped[0], + secondary = fanimation.tanimation.secondary[0], walking = { selected = fanimation.tanimation.walking.selected[0], }, }, - tweapon = + tcheatmenu = { - quick_spawn = fweapon.tweapon.quick_spawn[0], - ped = fweapon.tweapon.ped[0], + current_menu = tcheatmenu.current_menu, }, - tvisual = + tgame = { - money = - { - positive = ffi.string(fvisual.tvisual.money.positive), - negative = ffi.string(fvisual.tvisual.money.negative), + disable_cheats = fgame.tgame.disable_cheats[0], + disable_help_popups = fgame.tgame.disable_help_popups[0], + fps_limit = fgame.tgame.fps_limit[0], + keep_stuff = fgame.tgame.keep_stuff[0], + ss_shortcut = fgame.tgame.ss_shortcut[0], + }, + tmemory = + { + address = ffi.string(fmemory.tmemory.address), + clear_entries = fmemory.tmemory.clear_entries[0], + is_float = fmemory.tmemory.is_float[0], + size = fmemory.tmemory.size[0], + value = fmemory.tmemory.value[0], + vp = fmemory.tmemory.vp[0], + }, + tmenu = + { + auto_update_check = fmenu.tmenu.auto_update_check[0], + auto_reload = fmenu.tmenu.auto_reload[0], + disable_in_samp = fmenu.tmenu.disable_in_samp[0], + lock_player = fmenu.tmenu.lock_player[0], + overlay = + { + coordinates = fmenu.tmenu.overlay.coordinates[0], + fps = fmenu.tmenu.overlay.fps[0], + health = fmenu.tmenu.overlay.health[0], + position_index = fmenu.tmenu.overlay.position_index[0], + show = fmenu.tmenu.overlay.show[0], + speed = fmenu.tmenu.overlay.speed[0], }, + show_tooltips = fmenu.tmenu.show_tooltips[0], + show_crash_message = fmenu.tmenu.show_crash_message[0], }, tped = { + gang_wars = fped.tped.gang_wars[0], type = { - selected = fped.tped.type.selected[0], + index = fped.tped.type.index[0], }, }, - tgame = + tplayer = { - ss_shortcut = fgame.tgame.ss_shortcut[0], - disable_cheats = fgame.tgame.disable_cheats[0], - fps = - { - limit = fgame.tgame.fps.limit[0], - }, - disable_help_popups = fgame.tgame.disable_help_popups[0], + aimSkinChanger = fplayer.tplayer.aimSkinChanger[0], + cjBody = fplayer.tplayer.cjBody[0], + god = fplayer.tplayer.god[0], }, - tvehicles = + tteleport = + { + auto_z = fteleport.tteleport.auto_z[0], + coords = ffi.string(fteleport.tteleport.coords), + insert_coords = fteleport.tteleport.insert_coords[0], + shortcut = fteleport.tteleport.shortcut[0], + }, + tvehicle = { - quick_spawn = fvehicle.tvehicles.quick_spawn[0], - spawn_inside = fvehicle.tvehicles.spawn_inside[0], aircraft = { - camera = fvehicle.tvehicles.aircraft.camera[0], - spawn_in_air = fvehicle.tvehicles.aircraft.spawn_in_air[0], - index = fvehicle.tvehicles.aircraft.index, - }, - no_damage = fvehicle.tvehicles.no_damage[0], - visual_damage = fvehicle.tvehicles.visual_damage[0], - heavy = fvehicle.tvehicles.heavy[0], - stay_on_bike = fvehicle.tvehicles.stay_on_bike[0], - lock_speed = fvehicle.tvehicles.lock_speed[0], - speed = fvehicle.tvehicles.speed[0], - lights = { - all = fvehicle.tvehicles.lights.all[0], + camera = fvehicle.tvehicle.aircraft.camera[0], + index = fvehicle.tvehicle.aircraft.index, + spawn_in_air = fvehicle.tvehicle.aircraft.spawn_in_air[0], }, + heavy = fvehicle.tvehicle.heavy[0], + quick_spawn = fvehicle.tvehicle.quick_spawn[0], + lights = fvehicle.tvehicle.lights[0], + lock_speed = fvehicle.tvehicle.lock_speed[0], + no_damage = fvehicle.tvehicle.no_damage[0], + spawn_inside = fvehicle.tvehicle.spawn_inside[0], + speed = fvehicle.tvehicle.speed[0], + stay_on_bike = fvehicle.tvehicle.stay_on_bike[0], + visual_damage = fvehicle.tvehicle.visual_damage[0], }, - tmenu = + tvisual = { - auto_update_check = fmenu.tmenu.auto_update_check[0], - auto_reload = fmenu.tmenu.auto_reload[0], - show_tooltips = fmenu.tmenu.show_tooltips[0], - show_crash_message = fmenu.tmenu.show_crash_message[0], - disable_in_samp = fmenu.tmenu.disable_in_samp[0], - lock_player = fmenu.tmenu.lock_player[0], - overlay = + money = { - show = fmenu.tmenu.overlay.show[0], - position_index = fmenu.tmenu.overlay.position_index[0], - coordinates = fmenu.tmenu.overlay.coordinates[0], - fps = fmenu.tmenu.overlay.fps[0], - health = fmenu.tmenu.overlay.health[0], - speed = fmenu.tmenu.overlay.speed[0], + negative = ffi.string(fvisual.tvisual.money.negative), + positive = ffi.string(fvisual.tvisual.money.positive), }, }, + tweapon = + { + fast_reload = fweapon.tweapon.fast_reload[0], + no_reload = fweapon.tweapon.no_reload[0], + ped = fweapon.tweapon.ped[0], + quick_spawn = fweapon.tweapon.quick_spawn[0], + }, } local file = io.open(config_path,'w') diff --git a/lib/cheat-menu/modules/game.lua b/lib/cheat-menu/modules/game.lua index fa2839c7..63e3ba42 100755 --- a/lib/cheat-menu/modules/game.lua +++ b/lib/cheat-menu/modules/game.lua @@ -16,35 +16,33 @@ local module = {} -local tgame = +module.tgame = { - ss_shortcut = imgui.new.bool(fconfig.get('tgame.ss_shortcut',false)), - keep_stuff = imgui.new.bool(false), - unlock_interior = imgui.new.bool(false), - disable_cheats = imgui.new.bool(fconfig.get('tgame.disable_cheats',false)), - current_weather = 0, - day_names = {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"}, - weather_names = ftable.weather.table, - fps = - { - limit = imgui.new.int(fconfig.get('tgame.fps.limit',30)), - }, - airbreak = imgui.new.bool(false), - disable_help_popups = imgui.new.bool(fconfig.get('tgame.disable_help_popups',false)), - stats = - { - search_text = imgui.new.char[20](), - names = ftable.stats.table, + airbreak = imgui.new.bool(false), + day = + { + names = {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"}, + array = {}, + }, + disable_cheats = imgui.new.bool(fconfig.get('tgame.disable_cheats',false)), + disable_help_popups = imgui.new.bool(fconfig.get('tgame.disable_help_popups',false)), + fps_limit = imgui.new.int(fconfig.get('tgame.fps_limit',30)), + keep_stuff = imgui.new.bool(fconfig.get('tgame.keep_stuff',false)), + ss_shortcut = imgui.new.bool(fconfig.get('tgame.ss_shortcut',false)), + stats = + { + search_text = imgui.new.char[20](), + names = ftable.stats.table, + }, + weather = + { + names = ftable.weather.table, + array = {}, }, } -module.tgame = tgame - -local days_list = imgui.new['const char*'][#tgame.day_names](tgame.day_names) -local weather_list = imgui.new['const char*'][#tgame.weather_names](tgame.weather_names) - --- Game Interriors list -local interior_names = ftable.interiors.table +module.tgame.day.array = imgui.new['const char*'][#module.tgame.day.names](module.tgame.day.names) +module.tgame.weather.array = imgui.new['const char*'][#module.tgame.weather.names](module.tgame.weather.names) function CheatsEntry(func,names) @@ -66,7 +64,7 @@ function CheatsEntry(func,names) end function module.AirbreakMode() - if tgame.airbreak[0] then + if module.tgame.airbreak[0] then if isKeyDown(tkeys.airbreak_up) then x,y,z = getCharCoordinates(PLAYER_PED) setCharCoordinates(PLAYER_PED,x,y,z+2.0) @@ -156,7 +154,7 @@ end function SetCurrentWeekday() imgui.Spacing() local current_day = imgui.new.int(readMemory(0xB7014E,1,false)-1) - if imgui.Combo("Day", current_day,days_list,#tgame.day_names) then + if imgui.Combo("Day", current_day,module.tgame.day.array,#module.tgame.day.names) then writeMemory(0xB7014E,1,current_day[0]+1,false) fcommon.CheatActivated() end @@ -165,7 +163,7 @@ end function SetWeather() imgui.Spacing() local current_weather = imgui.new.int(readMemory(0xC81320,2,false)) - if imgui.Combo("Weather", current_weather,weather_list,#tgame.weather_names) then + if imgui.Combo("Weather", current_weather,module.tgame.weather.array,#module.tgame.weather.names) then writeMemory(0xC81320,2,current_weather[0],false) fcommon.CheatActivated() end @@ -186,8 +184,8 @@ function module.GameMain() imgui.Spacing() imgui.Columns(2,nil,false) - fcommon.CheckBox({name = "Airbreak mode",var = tgame.airbreak,help_text = "Controls:\nW : Forward\tS : Backward\nA : Left \t\tD : Right\nArrow_Up\t : Move up\nArrow_Down : Move Down",func = function() - if tgame.airbreak[0] == true then + fcommon.CheckBox({name = "Airbreak mode",var = module.tgame.airbreak,help_text = "Controls:\nW : Forward\tS : Backward\nA : Left \t\tD : Right\nArrow_Up\t : Move up\nArrow_Down : Move Down",func = function() + if module.tgame.airbreak[0] == true then lockPlayerControl(true) setCharCollision(PLAYER_PED,false) setCameraBehindPlayer() @@ -198,8 +196,8 @@ function module.GameMain() fcommon.CheatDeactivated() end end}) - fcommon.CheckBox({name = "Disable cheats",var = tgame.disable_cheats,func = function() - if tgame.disable_cheats[0] == true then + fcommon.CheckBox({name = "Disable cheats",var = module.tgame.disable_cheats,func = function() + if module.tgame.disable_cheats[0] == true then writeMemory(0x004384D0 ,1,0xE9 ,false) writeMemory(0x004384D1 ,4,0x000000D0 ,false) writeMemory(0x004384D5 ,4,0x90909090 ,false) @@ -211,34 +209,16 @@ function module.GameMain() fcommon.CheatDeactivated() end end}) - fcommon.CheckBox({ name = "Disable help popups",var = tgame.disable_help_popups ,show_help_popups = true,help_text = "Disables wasted & arrested popups that\nappear in a new game.Requires restart."}) + fcommon.CheckBox({ name = "Disable help popups",var = module.tgame.disable_help_popups ,show_help_popups = true,help_text = "Disables wasted & arrested popups that\nappear in a new game.Requires restart."}) fcommon.CheckBox({ address = 0x96C009,name = 'Free PNS'}) imgui.NextColumn() - fcommon.CheckBox({name = "Keep stuff",var = tgame.keep_stuff,help_text = "Keep stuff after arrest/death" ,func = function() - if tgame.keep_stuff[0] == false then - switchArrestPenalties(true) - switchDeathPenalties(true) - else - switchArrestPenalties(false) - switchDeathPenalties(false) - end - end}) - fcommon.CheckBox({ name = 'Screenshot shortcut',var = tgame.ss_shortcut,show_help_popups = true,help_text = "Take screenshot using (Left Ctrl + S) key combination"}) - fcommon.CheckBox({name = 'Unlock interior',var = tgame.unlock_interior,func = function() - if tgame.unlock_interior[0] == true then - for _,name in ipairs(interior_names) do - switchEntryExit(name,1) - fcommon.CheatActivated() - end - else - for _,name in ipairs(interior_names) do - switchEntryExit(name,0) - fcommon.CheatDeactivated() - end - end + fcommon.CheckBox({name = "Keep stuff",var = module.tgame.keep_stuff,help_text = "Keep stuff after arrest/death" ,func = function() + switchArrestPenalties(module.tgame.keep_stuff[0]) + switchDeathPenalties(module.tgame.keep_stuff[0]) end}) + fcommon.CheckBox({ name = 'Screenshot shortcut',var = module.tgame.ss_shortcut,show_help_popups = true,help_text = "Take screenshot using (Left Ctrl + S) key combination"}) fcommon.CheckBox({ address = 0xB6F065,name = 'Widescreen'}) imgui.Columns(1) @@ -268,12 +248,12 @@ function module.GameMain() imgui.Columns(1) imgui.PushItemWidth(imgui.GetWindowWidth()-50) - if imgui.InputInt('Set',tgame.fps.limit) then - memory.write(0xC1704C,(tgame.fps.limit[0]+1),1) + if imgui.InputInt('Set',module.tgame.fps_limit) then + memory.write(0xC1704C,(module.tgame.fps_limit[0]+1),1) memory.write(0xBA6794,1,1) end - if tgame.fps.limit[0] < 1 then - tgame.fps.limit[0] = 1 + if module.tgame.fps_limit[0] < 1 then + module.tgame.fps_limit[0] = 1 end imgui.PopItemWidth() @@ -282,18 +262,18 @@ function module.GameMain() if imgui.Button("Minimum",imgui.ImVec2(fcommon.GetSize(3))) then memory.write(0xC1704C,1,1) memory.write(0xBA6794,1,1) - tgame.fps.limit[0] = 1 + module.tgame.fps_limit[0] = 1 end imgui.SameLine() if imgui.Button("Default",imgui.ImVec2(fcommon.GetSize(3))) then memory.write(0xC1704C,30,1) memory.write(0xBA6794,1,1) - tgame.fps.limit[0] = 30 + module.tgame.fps_limit[0] = 30 end imgui.SameLine() if imgui.Button("Maximum",imgui.ImVec2(fcommon.GetSize(3))) then memory.write(0xBA6794,0,1) - tgame.fps.limit[0] = 999 + module.tgame.fps_limit[0] = 999 end end) fcommon.UpdateAddress({name = 'Game speed',address = 0xB7CB64,size = 4,max = 10,min = 0, is_float =true, default = 1}) @@ -388,18 +368,18 @@ function module.GameMain() if imgui.BeginTabItem("Search") then imgui.Spacing() imgui.Columns(1) - if imgui.InputText("Search",tgame.stats.search_text,ffi.sizeof(tgame.stats.search_text)) then end + if imgui.InputText("Search",module.tgame.stats.search_text,ffi.sizeof(module.tgame.stats.search_text)) then end imgui.SameLine() imgui.Spacing() - imgui.Text("Found entries :(" .. ffi.string(tgame.stats.search_text) .. ")") + imgui.Text("Found entries :(" .. ffi.string(module.tgame.stats.search_text) .. ")") imgui.Separator() imgui.Spacing() if imgui.BeginChild("Stat Entries") then for i=0,342,1 do - if tgame.stats.names[i] ~= nil then - if (ffi.string(tgame.stats.search_text) == "") or (string.upper(tgame.stats.names[i]):find(string.upper(ffi.string(tgame.stats.search_text))) ~= nil) then - fcommon.UpdateStat({ name = tgame.stats.names[i],stat = i}) + if module.tgame.stats.names[i] ~= nil then + if (ffi.string(module.tgame.stats.search_text) == "") or (string.upper(module.tgame.stats.names[i]):find(string.upper(ffi.string(module.tgame.stats.search_text))) ~= nil) then + fcommon.UpdateStat({ name = module.tgame.stats.names[i],stat = i}) end end end diff --git a/lib/cheat-menu/modules/memory.lua b/lib/cheat-menu/modules/memory.lua index 75468ae1..22b3f367 100755 --- a/lib/cheat-menu/modules/memory.lua +++ b/lib/cheat-menu/modules/memory.lua @@ -16,59 +16,56 @@ local module = {} --- Memory table -local tmemory = +module.tmemory = { - address = imgui.new.char[10](fconfig.get('tmemory.address',"")), - size = imgui.new.int(fconfig.get('tmemory.size',1)), - vp = imgui.new.bool(fconfig.get('tmemory.vp',false)), + address = imgui.new.char[10](fconfig.get('tmemory.address',"")), clear_entries = imgui.new.bool(fconfig.get('tmemory.clear_entries',false)), - value = imgui.new.int(fconfig.get('tmemory.value',0)), - is_float = imgui.new.bool(fconfig.get('tmemory.is_float',false)), + is_float = imgui.new.bool(fconfig.get('tmemory.is_float',false)), + size = imgui.new.int(fconfig.get('tmemory.size',1)), + value = imgui.new.int(fconfig.get('tmemory.value',0)), + vp = imgui.new.bool(fconfig.get('tmemory.vp',false)), } -module.tmemory = tmemory - function module.MemoryMain() if isKeyDown(tkeys.control_key) and isKeyDown(tkeys.mc_paste) then - imgui.StrCopy(tmemory.address, imgui.GetClipboardText(),ffi.sizeof(tmemory.address)) + imgui.StrCopy(module.tmemory.address, imgui.GetClipboardText(),ffi.sizeof(module.tmemory.address)) end if imgui.BeginTabBar("Memory") then if imgui.BeginTabItem("Read") then - imgui.Text("Memory value : " .. tmemory.value[0]) + imgui.Text("Memory value : " .. module.tmemory.value[0]) imgui.Spacing() - imgui.InputText("Address", tmemory.address,ffi.sizeof(tmemory.address)) - fcommon.InformationTooltip("You can simply paste copied address using Ctrl + V") - imgui.SliderInt("Size", tmemory.size,1,4) + imgui.InputText("Address", module.tmemory.address,ffi.sizeof(module.tmemory.address)) + fcommon.InformationTooltip("Ctrl + V to paste address") + imgui.SliderInt("Size", module.tmemory.size,1,4) - if tmemory.size[0] == 4 then + if module.tmemory.size[0] == 4 then imgui.Columns(3,nil,false) - imgui.Checkbox("Float",tmemory.is_float) + imgui.Checkbox("Float",module.tmemory.is_float) imgui.NextColumn() else imgui.Columns(2,nil,false) end - imgui.Checkbox("Virtual protect", tmemory.vp) + imgui.Checkbox("Virtual protect", module.tmemory.vp) imgui.NextColumn() - imgui.Checkbox("Clear entries", tmemory.clear_entries) + imgui.Checkbox("Clear entries", module.tmemory.clear_entries) imgui.Columns(1) if imgui.Button("Read",imgui.ImVec2(fcommon.GetSize(1))) then - if ffi.string(tmemory.address) ~= "" then - tmemory.value[0] = fcommon.RwMemory(tonumber(ffi.string(tmemory.address)),tmemory.size[0],nil,tmemory.vp[0],tmemory.is_float[0]) - if tmemory.clear_entries[0] == 1 then - tmemory.value[0] = 0 - imgui.StrCopy(tmemory.address,"") - tmemory.size[0] = 0 - tmemory.vp[0] = false - tmemory.is_float[0] = false + if ffi.string(module.tmemory.address) ~= "" then + module.tmemory.value[0] = fcommon.RwMemory(tonumber(ffi.string(module.tmemory.address)),module.tmemory.size[0],nil,module.tmemory.vp[0],module.tmemory.is_float[0]) + if module.tmemory.clear_entries[0] == true then + module.tmemory.value[0] = 0 + imgui.StrCopy(module.tmemory.address,"") + module.tmemory.size[0] = 0 + module.tmemory.vp[0] = false + module.tmemory.is_float[0] = false end end end @@ -77,34 +74,34 @@ function module.MemoryMain() end if imgui.BeginTabItem("Write") then - imgui.InputInt("Value", tmemory.value) - imgui.InputText("Address", tmemory.address,ffi.sizeof(tmemory.address)) + imgui.InputInt("Value", module.tmemory.value) + imgui.InputText("Address", module.tmemory.address,ffi.sizeof(module.tmemory.address)) fcommon.InformationTooltip("You can simply paste copied address using Ctrl + V") - imgui.SliderInt("Size", tmemory.size,1,4) + imgui.SliderInt("Size", module.tmemory.size,1,4) - if tmemory.size[0] == 4 then + if module.tmemory.size[0] == 4 then imgui.Columns(3,nil,false) - imgui.Checkbox("Float",tmemory.is_float) + imgui.Checkbox("Float",module.tmemory.is_float) imgui.NextColumn() else imgui.Columns(2,nil,false) end - imgui.Checkbox("Virtual protect", tmemory.vp) + imgui.Checkbox("Virtual protect", module.tmemory.vp) imgui.NextColumn() - imgui.Checkbox("Clear entries", tmemory.clear_entries) + imgui.Checkbox("Clear entries", module.tmemory.clear_entries) imgui.Columns(1) if imgui.Button("Write",imgui.ImVec2(fcommon.GetSize(1))) then - if ffi.string(tmemory.address) ~= "" then - fcommon.RwMemory(tonumber(ffi.string(tmemory.address)),tmemory.size[0],tmemory.value[0],tmemory.vp[0],tmemory.is_float[0]) - if tmemory.clear_entries[0] == 1 then - tmemory.value[0] = 0 - imgui.StrCopy(tmemory.address,"") - tmemory.size[0] = 0 - tmemory.vp[0] = false - tmemory.is_float[0] = false + if ffi.string(module.tmemory.address) ~= "" then + fcommon.RwMemory(tonumber(ffi.string(module.tmemory.address)),module.tmemory.size[0],module.tmemory.value[0],module.tmemory.vp[0],module.tmemory.is_float[0]) + if module.tmemory.clear_entries[0] == true then + module.tmemory.value[0] = 0 + imgui.StrCopy(module.tmemory.address,"") + module.tmemory.size[0] = 0 + module.tmemory.vp[0] = false + module.tmemory.is_float[0] = false end printHelpString("Value ~g~Updated") end diff --git a/lib/cheat-menu/modules/menu.lua b/lib/cheat-menu/modules/menu.lua index 0ab70392..44a020b5 100755 --- a/lib/cheat-menu/modules/menu.lua +++ b/lib/cheat-menu/modules/menu.lua @@ -16,30 +16,29 @@ local module = {} -local tmenu = -{ - overlay = +module.tmenu = +{ + auto_update_check = imgui.new.bool(fconfig.get('tmenu.auto_update_check',true)), + auto_reload = imgui.new.bool(fconfig.get('tmenu.auto_reload',true)), + disable_in_samp = imgui.new.bool(fconfig.get('tmenu.disable_in_samp',false)), + lock_player = imgui.new.bool(fconfig.get('tmenu.lock_player',false)), + overlay = { + coordinates = imgui.new.bool(fconfig.get('tmenu.overlay.coordinates',false)), + fps = imgui.new.bool(fconfig.get('tmenu.overlay.fps',false)), + show = imgui.new.bool(true), offset = imgui.new.int(10), - show = imgui.new.bool(true), position = {"Custom","Top Left","Top Right","Bottom Left","Bottom Right","Close"}, position_array = {}, - position_index = imgui.new.int(fconfig.get('tmenu.overlay.position_index',4)), + position_index = imgui.new.int(fconfig.get('tmenu.overlay.position_index',4)), health = imgui.new.bool(fconfig.get('tmenu.overlay.health',false)), - speed = imgui.new.bool(fconfig.get('tmenu.overlay.speed',false)), - coordinates = imgui.new.bool(fconfig.get('tmenu.overlay.coordinates',false)), - fps = imgui.new.bool(fconfig.get('tmenu.overlay.fps',false)), + speed = imgui.new.bool(fconfig.get('tmenu.overlay.speed',false)), }, - - auto_update_check = imgui.new.bool(fconfig.get('tmenu.auto_update_check',true)), - auto_reload = imgui.new.bool(fconfig.get('tmenu.auto_reload',true)), - lock_player = imgui.new.bool(fconfig.get('tmenu.lock_player',false)), show_tooltips = imgui.new.bool(fconfig.get('tmenu.show_tooltips',true)), show_crash_message = imgui.new.bool(fconfig.get('tmenu.show_crash_message',true)), - disable_in_samp = imgui.new.bool(fconfig.get('tmenu.disable_in_samp',false)), } -module.tmenu = tmenu +module.tmenu.overlay.position_array = imgui.new['const char*'][#module.tmenu.overlay.position](module.tmenu.overlay.position) function module.MenuMain() @@ -47,13 +46,13 @@ function module.MenuMain() if imgui.BeginTabItem("Config") then imgui.Columns(2,nil,false) imgui.Spacing() - fcommon.CheckBox({name = "Auto check for updates",var = fmenu.tmenu.auto_update_check}) - fcommon.CheckBox({name = "Auto reload",var = fmenu.tmenu.auto_reload,help_text = "Script will automatically reload itself if\nany crash occurs(Might cause issues)"}) - fcommon.CheckBox({name = "Disable in SAMP",var = fmenu.tmenu.disable_in_samp}) + fcommon.CheckBox({name = "Auto check for updates",var = module.tmenu.auto_update_check}) + fcommon.CheckBox({name = "Auto reload",var = module.tmenu.auto_reload,help_text = "Script will automatically reload itself if\nany crash occurs(Might cause issues)"}) + fcommon.CheckBox({name = "Disable in SAMP",var = module.tmenu.disable_in_samp}) imgui.NextColumn() - fcommon.CheckBox({name = "Lock player",var = fmenu.tmenu.lock_player,help_text = "Lock player controls while the menu is open"}) - fcommon.CheckBox({name = "Show crash message",var = fmenu.tmenu.show_crash_message}) - fcommon.CheckBox({name = "Show tooltips",var = fmenu.tmenu.show_tooltips}) + fcommon.CheckBox({name = "Lock player",var = module.tmenu.lock_player,help_text = "Lock player controls while the menu is open"}) + fcommon.CheckBox({name = "Show crash message",var = module.tmenu.show_crash_message}) + fcommon.CheckBox({name = "Show tooltips",var = module.tmenu.show_tooltips}) imgui.Columns(1) @@ -62,18 +61,18 @@ function module.MenuMain() if imgui.BeginTabItem("Overlay") then imgui.Columns(2,nil,false) imgui.Spacing() - fcommon.CheckBox({name = "Show coordinates",var = tmenu.overlay.coordinates,show_help_popups = true}) - fcommon.CheckBox({name = "Show FPS",var = tmenu.overlay.fps}) + fcommon.CheckBox({name = "Show coordinates",var = module.tmenu.overlay.coordinates,show_help_popups = true}) + fcommon.CheckBox({name = "Show FPS",var = module.tmenu.overlay.fps}) imgui.NextColumn() - fcommon.CheckBox({name = "Show health",var = tmenu.overlay.health}) - fcommon.CheckBox({name = "Show speed",var = tmenu.overlay.speed}) + fcommon.CheckBox({name = "Show health",var = module.tmenu.overlay.health}) + fcommon.CheckBox({name = "Show speed",var = module.tmenu.overlay.speed}) imgui.Columns(1) imgui.Spacing() imgui.Separator() imgui.Spacing() - if imgui.Combo("Position", fmenu.tmenu.overlay.position_index,fmenu.tmenu.overlay.position_array,#fmenu.tmenu.overlay.position) then - if fmenu.tmenu.overlay.position_index[0] == 5 then + if imgui.Combo("Position", module.tmenu.overlay.position_index,module.tmenu.overlay.position_array,#module.tmenu.overlay.position) then + if module.tmenu.overlay.position_index == 5 then fgame.tgame.fps.bool[0] = false fvehicles.tvehicles.show.speed[0] = false fvehicles.tvehicles.show.health[0] = false diff --git a/lib/cheat-menu/modules/mission.lua b/lib/cheat-menu/modules/mission.lua index 95671414..0b6e6134 100755 --- a/lib/cheat-menu/modules/mission.lua +++ b/lib/cheat-menu/modules/mission.lua @@ -16,20 +16,19 @@ local module = {} -local tmissions = +module.tmission = { - search_text = imgui.new.char[64](fconfig.get('tmissions.search_text',"")), + array = {}, names = ftable.missions.table, - list = {}, + search_text = imgui.new.char[20](), } -for i = 0,#tmissions.names,1 do - if tmissions.names[i] ~= nil then - table.insert(tmissions.list,i) +for i = 0,#module.tmission.names,1 do + if module.tmission.names[i] ~= nil then + table.insert(module.tmission.array,i) end end -module.tmissions = tmissions function ShowMissionEntries(title,list,search_text) if search_text == nil then search_text = "" end @@ -37,7 +36,7 @@ function ShowMissionEntries(title,list,search_text) fcommon.DropDownMenu(title,function() imgui.Spacing() for _,i in pairs(list) do - if (ffi.string(search_text) == "") or ((string.upper(tmissions.names[i])):find(string.upper(ffi.string(search_text))) ~= nil) then + if (ffi.string(search_text) == "") or ((string.upper(module.tmission.names[i])):find(string.upper(ffi.string(search_text))) ~= nil) then MissionEntry(i) end end @@ -45,7 +44,7 @@ function ShowMissionEntries(title,list,search_text) end function MissionEntry(i) - if imgui.MenuItemBool(tmissions.names[i]) then + if imgui.MenuItemBool(module.tmission.names[i]) then if getGameGlobal(glob.ONMISSION) == 0 then clearWantedLevel(PLAYER_HANDLE) lockPlayerControl(true) @@ -126,15 +125,14 @@ function module.MissionMain() if imgui.BeginTabItem('Search') then imgui.Spacing() imgui.Columns(1) - if imgui.InputText('Search',tmissions.search_text,ffi.sizeof(tmissions.search_text)) then end - imgui.SameLine() - + if imgui.InputText('Search ',module.tmission.search_text,ffi.sizeof(module.tmission.search_text)) then + end imgui.Spacing() - imgui.Text("FoundEntries :(" .. ffi.string(tmissions.search_text) .. ")") + imgui.Text("FoundEntries :(" .. ffi.string(module.tmission.search_text) .. ")") imgui.Separator() imgui.Spacing() if imgui.BeginChild("MissionsEntries") then - ShowMissionEntries(nil,tmissions.list,tmissions.search_text) + ShowMissionEntries(nil,module.tmission.array,module.tmission.search_text) imgui.EndChild() end imgui.EndTabItem() diff --git a/lib/cheat-menu/modules/ped.lua b/lib/cheat-menu/modules/ped.lua index 3c350f15..fee5df3b 100755 --- a/lib/cheat-menu/modules/ped.lua +++ b/lib/cheat-menu/modules/ped.lua @@ -16,59 +16,54 @@ local module = {} -local tped = +module.tped = { - path = tcheatmenu.dir .. "peds\\", - images = {}, - type = + gang_wars = imgui.new.bool(fconfig.get('tped.gang_wars',false)), + images = {}, + models = {}, + names = ftable.peds.list, + path = tcheatmenu.dir .. "peds\\", + search_text = imgui.new.char[20](""), + selected = nil, + special = ftable.peds.special, + type = { - list = {}, - names = ftable.peds.types, - - selected = imgui.new.int(fconfig.get('tped.type.selected',0)), - }, - names = ftable.peds.list, - special = ftable.peds.special, - models = {}, - search_text = imgui.new.char[20](fconfig.get('tped.search_text',"")), - gangs = - { - wars = imgui.new.bool(false), + array = {}, + names = ftable.peds.types, + index = imgui.new.int(fconfig.get('tped.type.index',0)), }, - selected = nil, } -module.tped = tped -tped.type.list = imgui.new['const char*'][#tped.type.names](tped.type.names) +module.tped.type.array = imgui.new['const char*'][#module.tped.type.names](module.tped.type.names) -for i = 0,#tped.names,1 do - table.insert(tped.models,i) +for i = 0,#module.tped.names,1 do + table.insert(module.tped.models,i) end function module.GetName(model) - if tped.names[model] then return tped.names[model] else return "" end + if module.tped.names[model] then return module.tped.names[model] else return "" end end function module.SpawnPed(model) - if tped.names[model] ~= nil then - if tped.special[model] == nil then + if module.tped.names[model] ~= nil then + if module.tped.special[model] == nil then requestModel(model) loadAllModelsNow() x,y,z = getCharCoordinates(PLAYER_PED) - ped = createChar(tped.type.selected[0]+2,model,x,y,z) + ped = createChar(module.tped.type.index[0]+2,model,x,y,z) markModelAsNoLongerNeeded(model) markCharAsNoLongerNeeded(ped) else if hasSpecialCharacterLoaded(model) then unloadSpecialCharacter(model) end - loadSpecialCharacter(tped.special[model],1) + loadSpecialCharacter(module.tped.special[model],1) loadAllModelsNow() x,y,z = getCharCoordinates(PLAYER_PED) - ped = createChar(tped.type.selected[0]+2,290,x,y,z) - markModelAsNoLongerNeeded(tped.special[model]) + ped = createChar(module.tped.type.index[0]+2,290,x,y,z) + markModelAsNoLongerNeeded(module.tped.special[model]) markCharAsNoLongerNeeded(ped) end printHelpString("Ped ~g~Spawned") @@ -82,13 +77,13 @@ function SetDensity(title,id) if imgui.SliderInt(title,density,0,255) then setZoneGangStrength(getNameOfInfoZone(x,y,z),id,density[0]) clearSpecificZonesToTriggerGangWar() - setGangWarsActive(true) + setGangWarsActive(fped.tped.gang_wars[0]) end end function module.PedMain() - if imgui.BeginTabBar("Ped") then + if imgui.BeginTabBar("Ped") then imgui.Spacing() if imgui.BeginTabItem("Checkbox") then imgui.Columns(2,nil,false) @@ -98,9 +93,9 @@ function module.PedMain() fcommon.CheckBox({ address = 0x96915A,name = "Gang members everywhere"}) fcommon.CheckBox({ address = 0x96913F,name = "Have bounty on head"}) imgui.NextColumn() - fcommon.CheckBox({name = "Gang wars",var = tped.gangs.wars,func = function() - setGangWarsActive(tped.gangs.wars[0]) - if tped.gangs.wars[0] then fcommon.CheatActivated() else fcommon.CheatDeactivated() end + fcommon.CheckBox({name = "Gang wars",var = module.tped.gang_wars,func = function() + setGangWarsActive(module.tped.gang_wars[0]) + if module.tped.gang_wars[0] then fcommon.CheatActivated() else fcommon.CheatDeactivated() end end}) fcommon.CheckBox({ address = 0x969158,name = "Peds attack with rockets"}) fcommon.CheckBox({ address = 0x969175,name = "Peds riot"}) @@ -136,21 +131,19 @@ function module.PedMain() end if imgui.BeginTabItem("Spawn") then imgui.Spacing() - if imgui.Combo("Ped type", tped.type.selected,tped.type.list,#tped.type.names) then end - imgui.Text("List") - imgui.Separator() + if imgui.Combo("Ped type", module.tped.type.index,module.tped.type.array,#module.tped.type.names) then end imgui.Spacing() if imgui.BeginTabBar("Peds list") then if imgui.BeginTabItem("Gang") then if imgui.BeginChild("Gangs list Window") then - fcommon.ShowEntries("Ballas",{102,103,104},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Da nang boys",{121,122,123},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Grove street families",{105,106,107,269,270,271},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Los santos vagos",{108,109,110},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Mafia",{111,112,113,124,125,126,127},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Mountain cloud triad",{117,118,120},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("San fierro rifa",{173,174,175},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Varrios los aztecas",{114,115,116},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Ballas",{102,103,104},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Da nang boys",{121,122,123},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Grove street families",{105,106,107,269,270,271},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Los santos vagos",{108,109,110},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Mafia",{111,112,113,124,125,126,127},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Mountain cloud triad",{117,118,120},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("San fierro rifa",{173,174,175},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Varrios los aztecas",{114,115,116},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) imgui.EndChild() end imgui.EndTabItem() @@ -158,40 +151,40 @@ function module.PedMain() if imgui.BeginTabItem("Civilians") then if imgui.BeginChild("Civillians list Window") then - fcommon.ShowEntries("Antagonist",{290,291,292,293,294,295,296,297,298,299},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Beach",{18,45,138,139,140,154},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Bouncer",{163,164,165,166},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Boxer",{80,81},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Businessman",{17,141,147,148,150,177,227},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Country",{157,158,159,160,161,162,196,197,198,199,200},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Golf",{36,37},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Grl",{190,191,192,193,194,195},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Heckler",{258,259},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Hippie",{72,73},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Jogger",{90,96},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Karate student",{203,204},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Pol",{66,67},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Low class male",{32,33,34,128,132,133,202},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Low class female",{31,129,130,131,151,201},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Mountain biker",{51,52},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Rich male",{14,20,38,43,46,57,59,94,98,185,186,221,228,235,240,295},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Rich female",{9,12,40,53,55,88,91,169,215,216,219,224,231},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Roller blade",{92,99},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Street male",{15,22,44,48,58,60,95,101,142,170,188,222,229,236,241,242},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Street female",{10,13,39,41,54,56,69,76,93,218,225,226,232,233,246,256,257},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Tramp male",{78,79,134,135,136,137,212,213,230,239},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Tramp female",{77,256,257},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Elvis",{82,83,84},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Antagonist",{290,291,292,293,294,295,296,297,298,299},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Beach",{18,45,138,139,140,154},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Bouncer",{163,164,165,166},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Boxer",{80,81},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Businessman",{17,141,147,148,150,177,227},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Country",{157,158,159,160,161,162,196,197,198,199,200},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Golf",{36,37},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Grl",{190,191,192,193,194,195},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Heckler",{258,259},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Hippie",{72,73},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Jogger",{90,96},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Karate student",{203,204},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Pol",{66,67},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Low class male",{32,33,34,128,132,133,202},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Low class female",{31,129,130,131,151,201},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Mountain biker",{51,52},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Rich male",{14,20,38,43,46,57,59,94,98,185,186,221,228,235,240,295},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Rich female",{9,12,40,53,55,88,91,169,215,216,219,224,231},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Roller blade",{92,99},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Street male",{15,22,44,48,58,60,95,101,142,170,188,222,229,236,241,242},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Street female",{10,13,39,41,54,56,69,76,93,218,225,226,232,233,246,256,257},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Tramp male",{78,79,134,135,136,137,212,213,230,239},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Tramp female",{77,256,257},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Elvis",{82,83,84},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) imgui.EndChild() end imgui.EndTabItem() end if imgui.BeginTabItem("Criminals") then if imgui.BeginChild("Criminals list Window") then - fcommon.ShowEntries("Biker",{247,248},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Body guard",{24,25},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Criminal",{21,47,100,143,181,183,184,223,250},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Drug dealer",{28,29,30,154},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Biker",{247,248},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Body guard",{24,25},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Criminal",{21,47,100,143,181,183,184,223,250},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Drug dealer",{28,29,30,154},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) imgui.EndChild() end imgui.EndTabItem() @@ -199,25 +192,25 @@ function module.PedMain() if imgui.BeginTabItem("Jobs") then if imgui.BeginChild("Jobs list Window") then - fcommon.ShowEntries("Cab driver",{182,206,220,234,261,262},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Construction",{27,153,260},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Croupier",{11,171,172},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Clothes seller",{211,217},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Fire dighter",{277,278,279},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Law enforcement",{71,265,266,267,280,281,282,283,284,285,286,287,288},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Life guard",{97,251},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Medic",{274,275,276},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Prostitute",{63,64,75,85,87,152,178,207,237,238,243,245,249},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Shop seller",{205,155,156,167,168,176,177,179,180},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Valet",{189,252,},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) - fcommon.ShowEntries("Worker",{16,50,61,253,255},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Cab driver",{182,206,220,234,261,262},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Construction",{27,153,260},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Croupier",{11,171,172},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Clothes seller",{211,217},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Fire dighter",{277,278,279},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Law enforcement",{71,265,266,267,280,281,282,283,284,285,286,287,288},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Life guard",{97,251},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Medic",{274,275,276},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Prostitute",{63,64,75,85,87,152,178,207,237,238,243,245,249},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Shop seller",{205,155,156,167,168,176,177,179,180},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Valet",{189,252,},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Worker",{16,50,61,253,255},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) imgui.EndChild() end imgui.EndTabItem() end if imgui.BeginTabItem("Misc") then if imgui.BeginChild("Misc list Window") then - fcommon.ShowEntries("Misc",{0,1,2,7,19,23,26,35,49,62,68,70,76,144,145,146,209,210,214,263,268,272},110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true) + fcommon.ShowEntries("Misc",{0,1,2,7,19,23,26,35,49,62,68,70,76,144,145,146,209,210,214,263,268,272},110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true) imgui.EndChild() end imgui.EndTabItem() @@ -225,15 +218,15 @@ function module.PedMain() if imgui.BeginTabItem("Search") then imgui.Spacing() imgui.Columns(1) - if imgui.InputText("Search",tped.search_text,ffi.sizeof(tped.search_text)) then end + if imgui.InputText("Search",module.tped.search_text,ffi.sizeof(module.tped.search_text)) then end imgui.SameLine() imgui.Spacing() - imgui.Text("Foun entries :(" .. ffi.string(tped.search_text) .. ")") + imgui.Text("Foun entries :(" .. ffi.string(module.tped.search_text) .. ")") imgui.Separator() imgui.Spacing() if imgui.BeginChild("Ped entries") then - fcommon.ShowEntries(nil,tped.models,110,55,tped.images,tped.path,".jpg",module.SpawnPed,module.GetName,true,tped.search_text) + fcommon.ShowEntries(nil,module.tped.models,110,55,module.tped.images,module.tped.path,".jpg",module.SpawnPed,module.GetName,true,module.tped.search_text) imgui.EndChild() end imgui.EndTabItem() diff --git a/lib/cheat-menu/modules/player.lua b/lib/cheat-menu/modules/player.lua index e31bc99e..ecfa36a2 100755 --- a/lib/cheat-menu/modules/player.lua +++ b/lib/cheat-menu/modules/player.lua @@ -16,25 +16,23 @@ local module = {} -local tplayer = +module.tplayer = { + aimSkinChanger = imgui.new.bool(fconfig.get('tplayer.aimSkinChanger',false)), + cjBody = imgui.new.int(fconfig.get('tplayer.cjBody',0)), clothes = { - path = tcheatmenu.dir .. "clothes\\", images = {}, + path = tcheatmenu.dir .. "clothes\\", }, god = imgui.new.bool(fconfig.get('tplayer.god',false)), - aimSkinChanger = imgui.new.bool(fconfig.get('tplayer.aimSkinChanger',false)), - neverWanted = imgui.new.bool(fconfig.get('tplayer.neverWanted',false) ), - cjBody = imgui.new.int(fconfig.get('tplayer.cjBody',0)), + never_wanted = imgui.new.bool(false), skins = { - search_text = imgui.new.char[20](), + search_text = imgui.new.char[20](), }, } -module.tplayer = tplayer - function module.ChangePlayerModel(model) if fped.tped.names[model] ~= nil then if fped.tped.special[model] == nil then @@ -60,7 +58,7 @@ function module.ChangePlayerModel(model) if car ~= nil then taskWarpCharIntoCarAsDriver(PLAYER_PED,car) end - printHelpString("Skin changed") + printHelpString("~g~Skin~w~ changed") end end @@ -75,7 +73,7 @@ function HealthArmour() imgui.Columns(1) imgui.PushItemWidth(imgui.GetWindowWidth()-70) - if imgui.InputInt("Set",health) then + if imgui.InputInt("Set ##Health",health) then if health[0] > 100 then setFloatStat(24,health[0]*5.686) @@ -88,17 +86,17 @@ function HealthArmour() imgui.PopItemWidth() imgui.Spacing() - if imgui.Button("Minimum",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Minimum ##Health",imgui.ImVec2(fcommon.GetSize(3))) then setFloatStat(24,569.0) setCharHealth(PLAYER_PED,0) end imgui.SameLine() - if imgui.Button("Default",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Default ##Health",imgui.ImVec2(fcommon.GetSize(3))) then setFloatStat(24,569.0) setCharHealth(PLAYER_PED,100) end imgui.SameLine() - if imgui.Button("Maximum",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Maximum ##Health",imgui.ImVec2(fcommon.GetSize(3))) then setFloatStat(24,1450.0) setCharHealth(PLAYER_PED,255) end @@ -127,7 +125,7 @@ function HealthArmour() imgui.Spacing() imgui.PushItemWidth(imgui.GetWindowWidth()-70) - if imgui.InputInt("Set",armour) then + if imgui.InputInt("Set ##Armour",armour) then if armour[0] < 0 then armour[0] = 0 @@ -141,15 +139,15 @@ function HealthArmour() end imgui.PopItemWidth() imgui.Spacing() - if imgui.Button("Minimum",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Minimum ##Armour",imgui.ImVec2(fcommon.GetSize(3))) then damageChar(PLAYER_PED, getCharArmour(PLAYER_PED),true) end imgui.SameLine() - if imgui.Button("Default",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Default ##Armour",imgui.ImVec2(fcommon.GetSize(3))) then damageChar(PLAYER_PED, getCharArmour(PLAYER_PED),true) end imgui.SameLine() - if imgui.Button("Maximum",imgui.ImVec2(fcommon.GetSize(3))) then + if imgui.Button("Maximum ##Armour",imgui.ImVec2(fcommon.GetSize(3))) then addArmourToChar(PLAYER_PED, max_armour) end end) @@ -167,7 +165,7 @@ function module.ChangePlayerClothe(name,body_part) givePlayerClothesOutsideShop(PLAYER_HANDLE,0,0,body_part) givePlayerClothesOutsideShop(PLAYER_HANDLE,texture,model,body_part) buildPlayerModel(PLAYER_HANDLE) - printHelpString("Clothe changed") + printHelpString("Clothes changed") end function ShowClothes(label,path,body_part,search_text) @@ -180,7 +178,7 @@ function ShowClothes(label,path,body_part,search_text) table.insert( model_table,#model_table+1,string.sub( file,1,-5)) file = findNextFile(handle) end - fcommon.ShowEntries(label,model_table,100,80,tplayer.clothes.images,path,".jpg",fplayer.ChangePlayerClothe,fplayer.GetClotheName,true,nil,body_part,search_text) + fcommon.ShowEntries(label,model_table,100,80,module.tplayer.clothes.images,path,".jpg",fplayer.ChangePlayerClothe,fplayer.GetClotheName,true,nil,body_part,search_text) end @@ -227,8 +225,8 @@ end function SkinChangerMenu() imgui.Spacing() - fcommon.CheckBox({name = "Aim skin changer",var = tplayer.aimSkinChanger}) - fcommon.InformationTooltip("Aim skin changer tooltip") + fcommon.CheckBox({name = "Aim skin changer",var = module.tplayer.aimSkinChanger}) + fcommon.InformationTooltip("Aim ped with a gun & press enter") imgui.Spacing() if imgui.BeginTabBar("Skins") then @@ -321,15 +319,15 @@ function SkinChangerMenu() if imgui.BeginTabItem('Search') then imgui.Spacing() imgui.Columns(1) - if imgui.InputText("Search",tplayer.skins.search_text,ffi.sizeof(tplayer.skins.search_text)) then end + if imgui.InputText("Search",module.tplayer.skins.search_text,ffi.sizeof(module.tplayer.skins.search_text)) then end imgui.SameLine() imgui.Spacing() - imgui.Text("Found entries :(" .. ffi.string(tplayer.skins.search_text) .. ")") + imgui.Text("Found entries :(" .. ffi.string(module.tplayer.skins.search_text) .. ")") imgui.Separator() imgui.Spacing() if imgui.BeginChild("Skin Entries") then - fcommon.ShowEntries(nil,fped.tped.models,110,55,fped.tped.images,fped.tped.path,".jpg",fplayer.ChangePlayerModel,fped.GetName,true,tplayer.skins.search_text) + fcommon.ShowEntries(nil,fped.tped.models,110,55,fped.tped.images,fped.tped.path,".jpg",fplayer.ChangePlayerModel,fped.GetName,true,module.tplayer.skins.search_text) imgui.EndChild() end imgui.EndTabItem() @@ -347,7 +345,7 @@ function module.PlayerMain() imgui.Spacing() imgui.Columns(2,nil,false) fcommon.CheckBox({ address = 0x969179,name = "Aim while driving"}) - fcommon.CheckBox({ var = tplayer.god,name = "God mode"}) + fcommon.CheckBox({ var = module.tplayer.god,name = "God mode"}) fcommon.CheckBox({ address = 0x969161,name = "Higher cycle jumps"}) fcommon.CheckBox({ address = 0x969178,name = "Infinite ammo"}) fcommon.CheckBox({ address = 0x96916E,name = "Infinite oxygen"}) @@ -359,12 +357,14 @@ function module.PlayerMain() fcommon.CheckBox({ address = 0x96916C,name = "Mega jump"}) fcommon.CheckBox({ address = 0x969173,name = "Mega punch"}) fcommon.CheckBox({ address = 0x969174,name = "Never get hungry"}) - fcommon.CheckBox({name = "Never wanted",var = tplayer.neverWanted,func = function() + + module.tplayer.never_wanted[0] = readMemory(0x969171 ,1,false) + fcommon.CheckBox({name = "Never wanted",var = module.tplayer.never_wanted,func = function() callFunction(0x4396C0,1,0,false) - if tplayer.neverWanted[0] then + if module.tplayer.never_wanted[0] then fcommon.CheatActivated() else - fCheatDeactivated() + fcommon.CheatDeactivated() end end}) @@ -374,17 +374,17 @@ function module.PlayerMain() imgui.Separator() imgui.Spacing() imgui.Text("Body") - if imgui.RadioButtonIntPtr("Fat",tplayer.cjBody,1) then + if imgui.RadioButtonIntPtr("Fat",module.tplayer.cjBody,1) then callFunction(0x439110,1,1,false) fcommon.CheatActivated() end - if imgui.RadioButtonIntPtr("Muscle",tplayer.cjBody,2) then + if imgui.RadioButtonIntPtr("Muscle",module.tplayer.cjBody,2) then -- body not changing to muscular after changing to fat fix callFunction(0x439190,1,1,false) callFunction(0x439150,1,1,false) fcommon.CheatActivated() end - if imgui.RadioButtonIntPtr("Skinny",tplayer.cjBody,3) then + if imgui.RadioButtonIntPtr("Skinny",module.tplayer.cjBody,3) then callFunction(0x439190,1,1,false) fcommon.CheatActivated() end @@ -397,10 +397,9 @@ function module.PlayerMain() fcommon.UpdateStat({ name = "Fat",stat = 21}) HealthArmour() fcommon.UpdateStat({ name = "Lung capacity",stat = 225}) - fcommon.UpdateAddress({name = "Money",address = 0xB7CE50,size = 4,min = 0,max = 9999999}) + fcommon.UpdateAddress({name = "Money",address = 0xB7CE50,size = 4,min = -9999999,max = 9999999}) fcommon.UpdateStat({ name = "Muscle",stat = 23}) fcommon.UpdateStat({ name = "Respect",stat = 68,max = 2450}) - fcommon.UpdateStat({ name = "Sex appeal",stat = 25}) fcommon.UpdateStat({ name = "Stamina",stat = 22}) WantedLevelMenu() @@ -410,11 +409,12 @@ function module.PlayerMain() SkinChangerMenu() imgui.EndTabItem() end - if imgui.BeginTabItem("Clothe") then + if imgui.BeginTabItem("Clothes") then imgui.Spacing() if imgui.Button("Remove clothes",imgui.ImVec2(fcommon.GetSize(1))) then for i=0, 17 do givePlayerClothes(PLAYER_HANDLE,0,0,i) end buildPlayerModel(PLAYER_HANDLE) + printHelpString("Clothes ~r~removed") end imgui.Spacing() @@ -424,24 +424,24 @@ function module.PlayerMain() if imgui.BeginTabItem("List") then if imgui.BeginChild("Clothes") then - ShowClothes("Extras",tplayer.clothes.path .. "Extras\\",17) - ShowClothes("Glasses",tplayer.clothes.path .. "Glasses\\",15) - ShowClothes("Hats",tplayer.clothes.path .. "Hats\\",16) - ShowClothes("Heads",tplayer.clothes.path .. "Heads\\",1) - ShowClothes("Necklaces",tplayer.clothes.path .. "Necklaces\\",13) - ShowClothes("Shirts",tplayer.clothes.path .. "Shirts\\",0) - ShowClothes("Shoes",tplayer.clothes.path .. "Shoes\\",3) - ShowClothes("Tattoos back",tplayer.clothes.path .. "Tattoos back\\",8) - ShowClothes("Tattoos left chest",tplayer.clothes.path .. "Tattoos left chest\\",9) - ShowClothes("Tattoos left lower arm",tplayer.clothes.path .. "Tattoos left lower arm\\",4) - ShowClothes("Tattoos left upper arm",tplayer.clothes.path .. "Tattoos left upper arm\\",5) - ShowClothes("Tattoos lower back",tplayer.clothes.path .. "Tattoos lower back\\",12) - ShowClothes("Tattoos right chest",tplayer.clothes.path .. "Tattoos right chest\\",10) - ShowClothes("Tattoos right lower arm",tplayer.clothes.path .. "Tattoos right lower arm\\",7) - ShowClothes("Tattoos right upper arm",tplayer.clothes.path .. "Tattoos right upper arm\\",6) - ShowClothes("Tattoos stomach",tplayer.clothes.path .. "Tattoos stomach\\",11) - ShowClothes("Trousers",tplayer.clothes.path .. "Trousers\\",2) - ShowClothes("Watches",tplayer.clothes.path .. "Watches\\",14) + ShowClothes("Extras",fplayer.tplayer.clothes.path .. "Extras\\",17) + ShowClothes("Glasses",fplayer.tplayer.clothes.path .. "Glasses\\",15) + ShowClothes("Hats",fplayer.tplayer.clothes.path .. "Hats\\",16) + ShowClothes("Heads",fplayer.tplayer.clothes.path .. "Heads\\",1) + ShowClothes("Necklaces",fplayer.tplayer.clothes.path .. "Necklaces\\",13) + ShowClothes("Shirts",fplayer.tplayer.clothes.path .. "Shirts\\",0) + ShowClothes("Shoes",fplayer.tplayer.clothes.path .. "Shoes\\",3) + ShowClothes("Tattoos back",fplayer.tplayer.clothes.path .. "Tattoos back\\",8) + ShowClothes("Tattoos left chest",fplayer.tplayer.clothes.path .. "Tattoos left chest\\",9) + ShowClothes("Tattoos left lower arm",fplayer.tplayer.clothes.path .. "Tattoos left lower arm\\",4) + ShowClothes("Tattoos left upper arm",fplayer.tplayer.clothes.path .. "Tattoos left upper arm\\",5) + ShowClothes("Tattoos lower back",fplayer.tplayer.clothes.path .. "Tattoos lower back\\",12) + ShowClothes("Tattoos right chest",fplayer.tplayer.clothes.path .. "Tattoos right chest\\",10) + ShowClothes("Tattoos right lower arm",fplayer.tplayer.clothes.path .. "Tattoos right lower arm\\",7) + ShowClothes("Tattoos right upper arm",fplayer.tplayer.clothes.path .. "Tattoos right upper arm\\",6) + ShowClothes("Tattoos stomach",fplayer.tplayer.clothes.path .. "Tattoos stomach\\",11) + ShowClothes("Trousers",fplayer.tplayer.clothes.path .. "Trousers\\",2) + ShowClothes("Watches",fplayer.tplayer.clothes.path .. "Watches\\",14) imgui.EndChild() end imgui.EndTabItem() diff --git a/lib/cheat-menu/modules/tables/$index.lua b/lib/cheat-menu/modules/tables/$index.lua index dc6143a8..1ed9428b 100755 --- a/lib/cheat-menu/modules/tables/$index.lua +++ b/lib/cheat-menu/modules/tables/$index.lua @@ -17,7 +17,6 @@ local module = {} module.animation = require 'cheat-menu.modules.tables.animation' -module.interiors = require 'cheat-menu.modules.tables.interior' module.missions = require 'cheat-menu.modules.tables.mission' module.peds = require 'cheat-menu.modules.tables.ped' module.stats = require 'cheat-menu.modules.tables.stat' diff --git a/lib/cheat-menu/modules/tables/interior.lua b/lib/cheat-menu/modules/tables/interior.lua deleted file mode 100644 index de186dcf..00000000 --- a/lib/cheat-menu/modules/tables/interior.lua +++ /dev/null @@ -1,156 +0,0 @@ --- Cheat Menu - Cheat menu for Grand Theft Auto SanAndreas --- Copyright (C) 2019 Grinch_ - --- This program is free software: you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation, either version 3 of the License, or --- (at your option) any later version. - --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. - --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . - -local module = {} - -module.table = -{ - "ABATOIR", - "AMMUN1", - "CARMOD1", - "FDREST1", - "GF1", - "JETINT", - "LACS1", - "LAHS1B", - "MAFCAS", - "MAFCAS2", - "SMASHTV", - "SVVGHO1", - "SWEETS", - "TSDINER", - "WUZIBET", - "BARBERS", - "BDUPS1", - "CARMOD2", - "CARTER", - "GF2", - "LAHS1A", - "LASTRIP", - "RYDERS", - "SVVGHO2", - "VGHSB1", - "VGHSB3", - "BARBER2", - "BDUPS", - "BIKESCH", - "BROTHL1", - "CARLS", - "CARMOD3", - "CHANGER", - "CSSPRT", - "DRIVES", - "DRIVES2", - "GENOTB", - "GF3", - "LAHSB4", - "OGLOCS", - "PAPER", - "PDOMES", - "PDOMES2", - "POLICE3", - "SEXSHOP", - "S1TEST", - "STRIP2", - "STUDIO", - "TATTO3", - "AMMUN2", - "DINER1", - "DIRBIKE", - "GF4", - "LAHS2A", - "LAHSS6", - "SFHSM2", - "X711S2", - "CSDESGN", - "DINER2", - "FDPIZA", - "GANG", - "GF5", - "GYM1", - "LACRAK", - "LAHSB3", - "MADDOGS", - "MDDOGS", - "SFHSB1", - "SVHOT1", - "VGHSM2", - "AMMUN3", - "AMMUN5", - "BROTHEL", - "GF6", - "GYM2", - "LAHSB1", - "POLICE1", - "RCPLAY", - "REST2", - "SFHSB2", - "SFHSS2", - "SVCUNT", - "SVSFSM", - "X7_11S", - "8TRACK", - "AMMUN4", - "GYM3", - "LAHSB2", - "OFTEST", - "BURHOUS", - "SFHSS1", - "SVLAMD", - "FDCHICK", - "LAHS2B", - "SFHSB3", - "SVGNMT2", - "SVVGMD", - "DESHOUS", - "FDBURG", - "POLICE2", - "SVGNMT1", - "TRICAS", - "SVSFMD", - "VGHSM3", - "X711S3", - "BAR2", - "SVLASM", - "BARBER3", - "MOROOM", - "SVLABIG", - "CSEXL", - "AIRPOR2", - "AIRPORT", - "CSCHP", - "MOTEL1", - "SFHSM1", - "VGHSS1", - "VGSHM2", - "VGSHM3", - "VGSHS2", - "TATTOO", - "X7_11C", - "BAR1", - "DAMIN", - "FDDONUT", - "TATTO2", - "X7_11D", - "ATRIUME", - "ATRIUMX", - "CLOTHGP", - "GENWRHS", - "UFOBAR", - "X7_11B" -} - -return module \ No newline at end of file diff --git a/lib/cheat-menu/modules/teleport.lua b/lib/cheat-menu/modules/teleport.lua index 2cafe47e..65ec19e1 100755 --- a/lib/cheat-menu/modules/teleport.lua +++ b/lib/cheat-menu/modules/teleport.lua @@ -16,20 +16,16 @@ local module = {} --- Teleport table -local tteleport = +module.tteleport = { - shortcut = imgui.new.bool(fconfig.get('tteleport.shortcut',false)), - coords = imgui.new.char[24](fconfig.get('tteleport.coords',"")), - auto_z = imgui.new.bool(fconfig.get('tteleport.auto_z',false)), - insert_coords = imgui.new.bool(fconfig.get('tteleport.insert_coords',false)), - search_text = imgui.new.char[64](""), - coord_name = imgui.new.char[64](""), - show_add_entry_elements = false + auto_z = imgui.new.bool(fconfig.get('tteleport.auto_z',false)), + coords = imgui.new.char[24](fconfig.get('tteleport.coords',"")), + coord_name = imgui.new.char[64](""), + insert_coords = imgui.new.bool(fconfig.get('tteleport.insert_coords',false)), + search_text = imgui.new.char[64](""), + shortcut = imgui.new.bool(fconfig.get('tteleport.shortcut',false)), } -module.tteleport = tteleport - local coordinates = fcommon.LoadJson("coordinate") @@ -39,7 +35,7 @@ function module.Teleport(x, y, z,interior_id) _, x,y,z = getTargetBlipCoordinates() interior_id = 0 end - if tteleport.auto_z[0] then + if module.tteleport.auto_z[0] then z = getGroundZFor3dCoord(x, y, z) end @@ -68,28 +64,29 @@ end function module.TeleportMain() - if imgui.BeginTabBar("Teleport") then + if imgui.BeginTabBar("Teleport") then + if imgui.BeginTabItem("Teleport") then imgui.Spacing() imgui.Columns(2,nil,false) - fcommon.CheckBox({name = "Auto Z coordinates",var = fteleport.tteleport.auto_z,help_text ="The script would get Z coord automatically", }) - fcommon.CheckBox({name = "Insert coordinates",var = fteleport.tteleport.insert_coords,help_text ="Insert current coordinates"}) + fcommon.CheckBox({name = "Auto Z coordinates",var = module.tteleport.auto_z,help_text ="Script would get Z coord automatically\nCauses bugs sometimes", }) + fcommon.CheckBox({name = "Insert coordinates",var = module.tteleport.insert_coords,help_text ="Insert current coordinates"}) imgui.NextColumn() - fcommon.CheckBox({name = "Quick teleport",var = fteleport.tteleport.shortcut,help_text ="Teleport to marker using (X + Y) key combinartion"}) + fcommon.CheckBox({name = "Quick teleport",var = module.tteleport.shortcut,help_text ="Teleport to marker using (X + Y) key combinartion"}) imgui.Columns(1) - if imgui.InputText("Coordinates",tteleport.coords,ffi.sizeof(tteleport.coords)) then end + if imgui.InputText("Coordinates",module.tteleport.coords,ffi.sizeof(module.tteleport.coords)) then end - if tteleport.insert_coords[0] then + if module.tteleport.insert_coords[0] then local x,y,z = getCharCoordinates(PLAYER_PED) - imgui.StrCopy(tteleport.coords,string.format("%d, %d, %d", math.floor(x) , math.floor(y) , math.floor(z))) + imgui.StrCopy(module.tteleport.coords,string.format("%d, %d, %d", math.floor(x) , math.floor(y) , math.floor(z))) end fcommon.InformationTooltip("Enter XYZ coordinates.\nFormat : X,Y,Z") imgui.Dummy(imgui.ImVec2(0,10)) if imgui.Button("Teleport to coord",imgui.ImVec2(fcommon.GetSize(2))) then - local x,y,z = (ffi.string(tteleport.coords)):match("([^,]+),([^,]+),([^,]+)") + local x,y,z = (ffi.string(module.tteleport.coords)):match("([^,]+),([^,]+),([^,]+)") module.Teleport(x, y, z,0) end imgui.SameLine() @@ -101,20 +98,20 @@ function module.TeleportMain() if imgui.BeginTabItem("Search") then imgui.Spacing() imgui.Columns(1) - if imgui.InputText("Search",tteleport.search_text,ffi.sizeof(tteleport.search_text)) then end + if imgui.InputText("Search",module.tteleport.search_text,ffi.sizeof(module.tteleport.search_text)) then end fcommon.InformationTooltip("Right click over any of these entries to remove them.") imgui.SameLine() imgui.Spacing() - imgui.Text("Found entries :(" .. ffi.string(tteleport.search_text) .. ")") + imgui.Text("Found entries :(" .. ffi.string(module.tteleport.search_text) .. ")") imgui.Separator() imgui.Spacing() if imgui.BeginChild("Teleport entries") then for name, coord in pairs(coordinates) do local interior_id, x, y, z = coord:match("([^, ]+), ([^, ]+), ([^, ]+), ([^, ]+)") - if ffi.string(tteleport.search_text) == "" then + if ffi.string(module.tteleport.search_text) == "" then ShowTeleportEntry(name, tonumber(x), tonumber(y), tonumber(z),interior_id) else - if string.upper(name):find(string.upper(ffi.string(tteleport.search_text))) ~= nil then + if string.upper(name):find(string.upper(ffi.string(module.tteleport.search_text))) ~= nil then ShowTeleportEntry(name, tonumber(x), tonumber(y), tonumber(z),interior_id) end end @@ -126,20 +123,20 @@ function module.TeleportMain() if imgui.BeginTabItem("Custom") then imgui.Spacing() imgui.Columns(1) - if imgui.InputText("Location name",tteleport.coord_name,ffi.sizeof(tteleport.coords)) then end - if imgui.InputText("Coordinates",tteleport.coords,ffi.sizeof(tteleport.coords)) then end + if imgui.InputText("Location name",module.tteleport.coord_name,ffi.sizeof(module.tteleport.coords)) then end + if imgui.InputText("Coordinates",module.tteleport.coords,ffi.sizeof(module.tteleport.coords)) then end fcommon.InformationTooltip("Enter XYZ coordinates.\nFormat : X,Y,Z") - if tteleport.insert_coords[0] then + if module.tteleport.insert_coords[0] then local x,y,z = getCharCoordinates(PLAYER_PED) - imgui.StrCopy(tteleport.coords,string.format("%d, %d, %d", math.floor(x) , math.floor(y) , math.floor(z))) + imgui.StrCopy(module.tteleport.coords,string.format("%d, %d, %d", math.floor(x) , math.floor(y) , math.floor(z))) end imgui.Spacing() if imgui.Button("Save location",imgui.ImVec2(fcommon.GetSize(1))) then - if ffi.string(tteleport.coord_name) == "" then - imgui.StrCopy(tteleport.coord_name,"Untitled") + if ffi.string(module.tteleport.coord_name) == "" then + imgui.StrCopy(module.tteleport.coord_name,"Untitled") end - coordinates[ffi.string(tteleport.coord_name)] = string.format("%d, %s",getActiveInterior(), ffi.string(tteleport.coords)) + coordinates[ffi.string(module.tteleport.coord_name)] = string.format("%d, %s",getActiveInterior(), ffi.string(module.tteleport.coords)) fcommon.SaveJson("coordinate",coordinates) coordinates = fcommon.LoadJson("coordinate") printHelpString("Entry ~g~added") diff --git a/lib/cheat-menu/modules/update.lua b/lib/cheat-menu/modules/update.lua index 3f8ff2bb..3f83e9dd 100755 --- a/lib/cheat-menu/modules/update.lua +++ b/lib/cheat-menu/modules/update.lua @@ -17,6 +17,7 @@ local module = {} function module.CheckUpdates() + require("socket") local https = require("ssl.https") @@ -28,36 +29,24 @@ function module.CheckUpdates() local body, code, headers, status = https.request(link) - tcheatmenu.update.version_number = tonumber(body:match("script_version_number%((%d+)%)")) - - if not body or tcheatmenu.update.version_number == nil then + if not body then print(code) print(status) printHelpString("~r~Failed~w~ to check for update") else - if tcheatmenu.update.version_number ~= script.this.version_num then - tcheatmenu.update.available = true + tcheatmenu.update.version_number = tonumber(body:match("script_version_number%((%d+)%)")) + if tcheatmenu.update.version_number ~= nil then + if tcheatmenu.update.version_number ~= script.this.version_num then + tcheatmenu.update.available = true + else + printHelpString("Using latest version") + end else - printHelpString("Using ~g~latest~w~ version") + printHelpString("Couldn't connect to github") end end end -function module.DownloadUpdates() - require("socket") - local https = require("ssl.https") - local one, code, headers, status = https.request { - url = "https://github.com/inanahammad/Cheat-Menu/archive/master.zip", - protocol = "TLSv1.3", - options = "all", - verify = "none", - } - if not body then error(code) return end - local f = assert(io.open('master.zip', 'wb')) -- open in "binary" mode - f:write(body) - f:close() -end - return module \ No newline at end of file diff --git a/lib/cheat-menu/modules/vehicle.lua b/lib/cheat-menu/modules/vehicle.lua index 7c5e96da..0b0c33c4 100755 --- a/lib/cheat-menu/modules/vehicle.lua +++ b/lib/cheat-menu/modules/vehicle.lua @@ -15,29 +15,25 @@ -- along with this program. If not, see . local module = {} -local tvehicles = + +module.tvehicle = { - door_menu_button = imgui.new.int(0), - paintjobs = + aircraft = { - path = tcheatmenu.dir .. "vehicles\\paintjobs\\", - search_text = imgui.new.char[20](), - images = {}, - texture = nil + camera = imgui.new.bool(fconfig.get('tvehicle.aircraft.camera',false)), + index = fconfig.get('tvehicle.aircraft.index',2), + spawn_in_air = imgui.new.bool(fconfig.get('tvehicle.aircraft.spawn_in_air',true)), + zoom = { -5.0,-15.0,-20.0,-30.0,-40.0}, }, color = { - rgb = imgui.new.float[3](0.0,0.0,0.0), default = -1, + rgb = imgui.new.float[3](0.0,0.0,0.0), }, components = { - saved = false, - path = tcheatmenu.dir .. "vehicles\\components\\", images = {}, - value = imgui.new.int(0), list = {}, - selected = imgui.new.int(0), names = { "Default", @@ -60,7 +56,10 @@ local tvehicles = "windscreen_dummy", "boot_dummy" }, - + path = tcheatmenu.dir .. "vehicles\\components\\", + saved = false, + selected = imgui.new.int(0), + value = imgui.new.int(0), }, doors = { @@ -72,41 +71,37 @@ local tvehicles = "Rear right door", "All", }, - - aircraft = - { - camera = imgui.new.bool(fconfig.get('tvehicles.aircraft.camera',false)), - spawn_in_air = imgui.new.bool(fconfig.get('tvehicles.aircraft.spawn_in_air',true)), - zoom = { -5.0,-15.0,-20.0,-30.0,-40.0}, - index = fconfig.get('tvehicles.aircraft.index',2), - }, - search_text = imgui.new.char[20](), + door_menu_button = imgui.new.int(0), + heavy = imgui.new.bool(fconfig.get('tvehicle.heavy',false)), + hydraulic = imgui.new.bool(false), + images = {}, + lights = imgui.new.bool(fconfig.get('tvehicle.lights',false)), + lock_doors = imgui.new.bool(false), + lock_speed = imgui.new.bool(fconfig.get('tvehicle.lock_speed',false)), models = {}, - lights = + paintjobs = { - all = imgui.new.bool(fconfig.get('tvehicles.lights.all',false)), + path = tcheatmenu.dir .. "vehicles\\paintjobs\\", + search_text = imgui.new.char[20](), + images = {}, + texture = nil }, - lock_doors = imgui.new.bool(false), - images = {}, - quick_spawn = imgui.new.bool(fconfig.get('tvehicles.quick_spawn',false)), - spawn_inside = imgui.new.bool(fconfig.get('tvehicles.spawn_inside',true)), + no_damage = imgui.new.bool(fconfig.get('tvehicle.no_damage',false)), path = tcheatmenu.dir .. "vehicles\\", - visual_damage = imgui.new.bool(fconfig.get('tvehicles.visual_damage',false)), - heavy = imgui.new.bool(fconfig.get('tvehicles.heavy',false)), - hydraulic = imgui.new.bool(false), - no_damage = imgui.new.bool(fconfig.get('tvehicles.no_damage',false)), - stay_on_bike = imgui.new.bool(fconfig.get('tvehicles.stay_on_bike',false)), - speed = imgui.new.int(fconfig.get('tvehicles.speed',0)), - lock_speed = imgui.new.bool(fconfig.get('tvehicles.lock_speed',false)), + quick_spawn = imgui.new.bool(fconfig.get('tvehicle.quick_spawn',false)), + search_text = imgui.new.char[20](), + spawn_inside = imgui.new.bool(fconfig.get('tvehicle.spawn_inside',true)), + speed = imgui.new.int(fconfig.get('tvehicle.speed',0)), + stay_on_bike = imgui.new.bool(fconfig.get('tvehicle.stay_on_bike',false)), + visual_damage = imgui.new.bool(fconfig.get('tvehicle.visual_damage',false)), } -module.tvehicles = tvehicles -tvehicles.components.list = imgui.new['const char*'][#tvehicles.components.names](tvehicles.components.names) +module.tvehicle.components.list = imgui.new['const char*'][#module.tvehicle.components.names](module.tvehicle.components.names) module.IsValidModForVehicle = ffi.cast('bool(*)(int model, int cvehicle)',0x49B010) for i = 401,611,1 do - table.insert(tvehicles.models,i) + table.insert(module.tvehicle.models,i) end function module.CBaseModelInfo(name) @@ -133,7 +128,7 @@ function module.GiveVehicleToPlayer(model) deleteCar(car) end - if tvehicles.aircraft.spawn_in_air[0] and (isThisModelAHeli(model) or isThisModelAPlane(model)) then + if module.tvehicle.aircraft.spawn_in_air[0] and (isThisModelAHeli(model) or isThisModelAPlane(model)) then z = 400 end requestModel(model) @@ -141,7 +136,7 @@ function module.GiveVehicleToPlayer(model) car = createCar(model,x,y,z) markModelAsNoLongerNeeded(model) heading = getCharHeading(PLAYER_PED) - if tvehicles.spawn_inside[0] then + if module.tvehicle.spawn_inside[0] then warpCharIntoCar(PLAYER_PED,car) end setCarHeading(car,heading) @@ -160,7 +155,7 @@ function module.AddComponentToVehicle(component) requestVehicleMod(component) loadAllModelsNow() addVehicleMod(car,component) - fcommon.CheatActivated() + printHelpString("Component ~g~added") markModelAsNoLongerNeeded(component) end end @@ -176,13 +171,13 @@ function DoorMenu(func) else doors = 3 end - if imgui.Button(tvehicles.doors[7],imgui.ImVec2(fcommon.GetSize(1))) then + if imgui.Button(module.tvehicle.doors[7],imgui.ImVec2(fcommon.GetSize(1))) then for i=0,doors,1 do func(vehicle,i) end end for i=0,doors,1 do - if imgui.Button(tvehicles.doors[i+1],imgui.ImVec2(fcommon.GetSize(2))) then + if imgui.Button(module.tvehicle.doors[i+1],imgui.ImVec2(fcommon.GetSize(2))) then func(vehicle,i) end if i%2 ~= 1 then @@ -209,22 +204,22 @@ function module.ForEachCarComponent(func) end function module.AircraftCamera() - if tvehicles.aircraft.camera[0] == true then + if module.tvehicle.aircraft.camera[0] == true then while isCharInAnyHeli(PLAYER_PED) or isCharInAnyPlane(PLAYER_PED) do - if tvehicles.aircraft.camera[0] == false then break end + if module.tvehicle.aircraft.camera[0] == false then break end local vehicle = storeCarCharIsInNoSave(PLAYER_PED) local roll = getCarRoll(vehicle) - attachCameraToVehicle(vehicle,0.0,tvehicles.aircraft.zoom[tvehicles.aircraft.index],2.5,0.0,0.0,0.0,(roll*-1),2) + attachCameraToVehicle(vehicle,0.0,module.tvehicle.aircraft.zoom[module.tvehicle.aircraft.index],2.5,0.0,0.0,0.0,(roll*-1),2) if isKeyDown(tkeys.aircraft_zoom) then while isKeyDown(tkeys.aircraft_zoom) do wait(0) end - tvehicles.aircraft.index = tvehicles.aircraft.index + 1 - if tvehicles.aircraft.index > #tvehicles.aircraft.zoom then - tvehicles.aircraft.index = 0 + module.tvehicle.aircraft.index = module.tvehicle.aircraft.index + 1 + if module.tvehicle.aircraft.index > #module.tvehicle.aircraft.zoom then + module.tvehicle.aircraft.index = 0 end end wait(0) @@ -243,17 +238,17 @@ end function module.ApplyTexture(filename) lua_thread.create(function() - local fullpath = tvehicles.paintjobs.path .. filename .. ".png" - tvehicles.paintjobs.texture = assert(mad.load_png_texture(fullpath)) + local fullpath = module.tvehicle.paintjobs.path .. filename .. ".png" + module.tvehicle.paintjobs.texture = assert(mad.load_png_texture(fullpath)) module.ForEachCarComponent(function(mat,comp,car) local r, g, b, old_a = mat:get_color() - if tvehicles.components.selected[0] == 0 and (r == 0x3C and g == 0xFF and b == 0x00) or (r == 0xFF and g == 0x00 and b == 0xAF) then - mat:set_texture(tvehicles.paintjobs.texture) + if module.tvehicle.components.selected[0] == 0 and (r == 0x3C and g == 0xFF and b == 0x00) or (r == 0xFF and g == 0x00 and b == 0xAF) then + mat:set_texture(module.tvehicle.paintjobs.texture) end - if comp.name == tvehicles.components.names[tvehicles.components.selected[0]+1] then - mat:set_texture(tvehicles.paintjobs.texture) + if comp.name == module.tvehicle.components.names[module.tvehicle.components.selected[0]+1] then + mat:set_texture(module.tvehicle.paintjobs.texture) end - tvehicles.color.default = getCarColours(car) + module.tvehicle.color.default = getCarColours(car) end) end,filename) end @@ -287,10 +282,10 @@ function module.VehicleMain() fcommon.CheckBox({ address = 0x96914F,name = "Aggressive drivers"}) fcommon.CheckBox({ address = 0x969153,name = "Boats fly"}) fcommon.CheckBox({ address = 0x969160,name = "Cars fly"}) - fcommon.CheckBox({name = "Car heavy",var = tvehicles.heavy}) - if imgui.Checkbox("Car hydraulic",tvehicles.hydraulic) then + fcommon.CheckBox({name = "Car heavy",var = module.tvehicle.heavy}) + if imgui.Checkbox("Car hydraulic",module.tvehicle.hydraulic) then if isCharInAnyCar(PLAYER_PED) then - if module.tvehicles.hydraulic[0] then + if module.tvehicle.hydraulic[0] then setCarHydraulics(car,true) fcommon.CheatActivated() else @@ -300,7 +295,7 @@ function module.VehicleMain() end end fcommon.CheckBox({ address = 0x96917A,name = "Decreased traffic"}) - fcommon.CheckBox({name = "Dont fall off bike",var = tvehicles.stay_on_bike}) + fcommon.CheckBox({name = "Dont fall off bike",var = module.tvehicle.stay_on_bike}) fcommon.CheckBox({ address = 0x969152,name = "Drive on water"}) fcommon.CheckBox({ address = 0x969166,name = "Float away when hit"}) fcommon.CheckBox({ address = 0x96914E,name = "Green traffic lights"}) @@ -309,11 +304,11 @@ function module.VehicleMain() fcommon.CheckBox({ address = 0x969165,name = "Have nitro"}) - fcommon.CheckBox({name = "Lights on",var = tvehicles.lights.all,func = + fcommon.CheckBox({name = "Lights on",var = module.tvehicle.lights,func = function() if isCharInAnyCar(PLAYER_PED) then car = storeCarCharIsInNoSave(PLAYER_PED) - if module.tvehicles.lights.all[0] == true then + if module.tvehicle.lights[0] == true then forceCarLights(car,2) addOneOffSound(x,y,z,1052) else @@ -323,7 +318,7 @@ function module.VehicleMain() end end}) - fcommon.CheckBox({name = "Lock doors",var = tvehicles.lock_doors,func = + fcommon.CheckBox({name = "Lock doors",var = module.tvehicle.lock_doors,func = function() if isCharInAnyCar(PLAYER_PED) then if getCarDoorLockStatus(car) == 4 then @@ -336,9 +331,9 @@ function module.VehicleMain() end end}) - fcommon.CheckBox({name = "New aircraft camera",var = tvehicles.aircraft.camera}) - fcommon.CheckBox({name = "No damage",var = tvehicles.no_damage}) - fcommon.CheckBox({name = "No visual damage",var = tvehicles.visual_damage}) + fcommon.CheckBox({name = "New aircraft camera",var = module.tvehicle.aircraft.camera}) + fcommon.CheckBox({name = "No damage",var = module.tvehicle.no_damage}) + fcommon.CheckBox({name = "No visual damage",var = module.tvehicle.visual_damage}) fcommon.CheckBox({ address = 0x96914C,name = "Perfect handling"}) fcommon.CheckBox({ address = 0x969164,name = "Tank mode"}) fcommon.CheckBox({ address = 0x96914B,name = "Wheels only"}) @@ -364,19 +359,19 @@ function module.VehicleMain() if isCharInAnyCar(PLAYER_PED) and not (isCharOnAnyBike(PLAYER_PED) or isCharInAnyBoat(PLAYER_PED) or isCharInAnyHeli(PLAYER_PED) or isCharInAnyPlane(PLAYER_PED)) then - if imgui.RadioButtonIntPtr("Damage", tvehicles.door_menu_button,0) then end + if imgui.RadioButtonIntPtr("Damage", module.tvehicle.door_menu_button,0) then end imgui.SameLine() - if imgui.RadioButtonIntPtr("Fix", tvehicles.door_menu_button,1) then end + if imgui.RadioButtonIntPtr("Fix", module.tvehicle.door_menu_button,1) then end imgui.SameLine() - if imgui.RadioButtonIntPtr("Open", tvehicles.door_menu_button,2) then end + if imgui.RadioButtonIntPtr("Open", module.tvehicle.door_menu_button,2) then end imgui.SameLine() - if imgui.RadioButtonIntPtr("Pop", tvehicles.door_menu_button,3) then end + if imgui.RadioButtonIntPtr("Pop", module.tvehicle.door_menu_button,3) then end imgui.Spacing() imgui.Separator() imgui.Spacing() - if tvehicles.door_menu_button[0] == 0 then - if tvehicles.visual_damage[0] == false then + if module.tvehicle.door_menu_button[0] == 0 then + if module.tvehicle.visual_damage[0] == false then DoorMenu(function(vehicle,door) damageCarDoor(vehicle,door) end) @@ -384,17 +379,17 @@ function module.VehicleMain() imgui.Text("No visual damage enabled") end end - if tvehicles.door_menu_button[0] == 1 then + if module.tvehicle.door_menu_button[0] == 1 then DoorMenu(function(vehicle,door) fixCarDoor(vehicle,door) end) end - if tvehicles.door_menu_button[0] == 2 then + if module.tvehicle.door_menu_button[0] == 2 then DoorMenu(function(vehicle,door) openCarDoor(vehicle,door) end) end - if tvehicles.door_menu_button[0] == 3 then + if module.tvehicle.door_menu_button[0] == 3 then DoorMenu(function(vehicle,door) popCarDoor(vehicle,door,true) end) @@ -430,18 +425,18 @@ function module.VehicleMain() end) fcommon.DropDownMenu("Speed",function() imgui.Columns(2,nil,false) - fcommon.CheckBox({name = "Lock speed",var = tvehicles.lock_speed}) + fcommon.CheckBox({name = "Lock speed",var = module.tvehicle.lock_speed}) imgui.NextColumn() imgui.Columns(1) - if imgui.InputInt("Set",tvehicles.speed) then + if imgui.InputInt("Set",module.tvehicle.speed) then end if imgui.Button("Set speed",imgui.ImVec2(fcommon.GetSize(2))) then - if tvehicles.speed[0] > 500 then - tvehicles.speed[0] = 500 + if module.tvehicle.speed[0] > 500 then + module.tvehicle.speed[0] = 500 end if isCharInAnyCar(PLAYER_PED) then car = storeCarCharIsInNoSave(PLAYER_PED) - setCarForwardSpeed(car,tvehicles.speed[0]) + setCarForwardSpeed(car,module.tvehicle.speed[0]) end end imgui.SameLine() @@ -462,11 +457,11 @@ function module.VehicleMain() imgui.Spacing() imgui.Columns(2,nil,false) - fcommon.CheckBox({name = "Quick vehicle",var = tvehicles.quick_spawn,help_text = "Vehicle can be spawned from quick spawner using (Left Ctrl + Q). \n\nControls:\nEnter : Stop reading key press\nDelete : Erase full string\nBackspace : Erase last character"}) - fcommon.CheckBox({name = "Spawn inside",var = tvehicles.spawn_inside,help_text = "Spawn inside vehicle as driver"}) + fcommon.CheckBox({name = "Quick vehicle",var = module.tvehicle.quick_spawn,help_text = "Vehicle can be spawned from quick spawner using (Left Ctrl + Q). \n\nControls:\nEnter : Stop reading key press\nDelete : Erase full string\nBackspace : Erase last character"}) + fcommon.CheckBox({name = "Spawn inside",var = module.tvehicle.spawn_inside,help_text = "Spawn inside vehicle as driver"}) imgui.NextColumn() - fcommon.CheckBox({name = "Spawn aircraft in air",var = tvehicles.aircraft.spawn_in_air}) + fcommon.CheckBox({name = "Spawn aircraft in air",var = module.tvehicle.aircraft.spawn_in_air}) imgui.Columns(1) imgui.Spacing() @@ -475,24 +470,24 @@ function module.VehicleMain() if imgui.BeginTabItem("List") then if imgui.BeginChild("Vehicles") then - fcommon.ShowEntries("Airplanes",{592,577,511,512,593,520,553,476,519,460,513},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Helicopters",{548,425,417,487,488,497,563,447,469},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Boats",{472,473,493,595,484,430,453,452,446,454},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Bikes",{581,509,481,462,521,463,510,522,461,448,468,586},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("2 door & compact cars",{602,496,401,518,527,589,419,587,533,526,474,545,517,410,600,436,439,549,491},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("4 door & luxury cars",{445,604,507,585,466,492,546,551,516,467,426,547,405,580,409,550,566,540,421,529},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Civil service",{485,431,438,437,574,420,525,408,552},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Government vehicles",{416,433,427,490,528,407,544,523,470,596,598,599,597,432,601,428},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Heavy & utility truck",{499,609,498,524,532,578,486,406,573,455,403,423,414,443,515,514,531,456,588},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Light trucks & vans",{459,422,482,605,530,418,572,582,413,440,543,583,478,554},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("SUVs & wagons",{579,400,404,489,505,479,442,458},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Low riders",{536,575,534,567,535,576,412},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Muscle cars",{402,542,603,475},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("RC vehicles",{441,464,594,501,465,564},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Recreational",{568,424,504,457,483,508,571,500,444,556,557,471,495,539},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Street racers",{429,541,542,415,480,562,565,434,494,502,503,411,559,561,560,506,451,558,555,477},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Trailers",{435,450,584,591,606,607,608,610,611},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) - fcommon.ShowEntries("Trains",{449,537,538,569,570,590},75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Airplanes",{592,577,511,512,593,520,553,476,519,460,513},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Helicopters",{548,425,417,487,488,497,563,447,469},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Boats",{472,473,493,595,484,430,453,452,446,454},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Bikes",{581,509,481,462,521,463,510,522,461,448,468,586},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("2 door & compact cars",{602,496,401,518,527,589,419,587,533,526,474,545,517,410,600,436,439,549,491},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("4 door & luxury cars",{445,604,507,585,466,492,546,551,516,467,426,547,405,580,409,550,566,540,421,529},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Civil service",{485,431,438,437,574,420,525,408,552},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Government vehicles",{416,433,427,490,528,407,544,523,470,596,598,599,597,432,601,428},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Heavy & utility truck",{499,609,498,524,532,578,486,406,573,455,403,423,414,443,515,514,531,456,588},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Light trucks & vans",{459,422,482,605,530,418,572,582,413,440,543,583,478,554},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("SUVs & wagons",{579,400,404,489,505,479,442,458},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Low riders",{536,575,534,567,535,576,412},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Muscle cars",{402,542,603,475},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("RC vehicles",{441,464,594,501,465,564},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Recreational",{568,424,504,457,483,508,571,500,444,556,557,471,495,539},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Street racers",{429,541,542,415,480,562,565,434,494,502,503,411,559,561,560,506,451,558,555,477},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Trailers",{435,450,584,591,606,607,608,610,611},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) + fcommon.ShowEntries("Trains",{449,537,538,569,570,590},75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true) imgui.EndChild() end imgui.EndTabItem() @@ -500,15 +495,15 @@ function module.VehicleMain() if imgui.BeginTabItem("Search") then imgui.Spacing() imgui.Columns(1) - if imgui.InputText("Search",tvehicles.search_text,ffi.sizeof(tvehicles.search_text)) then end + if imgui.InputText("Search",module.tvehicle.search_text,ffi.sizeof(module.tvehicle.search_text)) then end imgui.SameLine() imgui.Spacing() - imgui.Text("Found entries :(" .. ffi.string(tvehicles.search_text) .. ")") + imgui.Text("Found entries :(" .. ffi.string(module.tvehicle.search_text) .. ")") imgui.Separator() imgui.Spacing() if imgui.BeginChild("Vehicle entries") then - fcommon.ShowEntries(nil,tvehicles.models,75,100,tvehicles.images,tvehicles.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true,tvehicles.search_text) + fcommon.ShowEntries(nil,module.tvehicle.models,75,100,module.tvehicle.images,module.tvehicle.path,".jpg", module.GiveVehicleToPlayer,getNameOfVehicleModel,true,module.tvehicle.search_text) imgui.EndChild() end imgui.EndTabItem() @@ -520,51 +515,51 @@ function module.VehicleMain() if imgui.BeginTabItem("Paint") then imgui.Spacing() imgui.Columns(1) - if imgui.InputText("Search",tvehicles.paintjobs.search_text,ffi.sizeof(tvehicles.paintjobs.search_text)) then end + if imgui.InputText("Search",module.tvehicle.paintjobs.search_text,ffi.sizeof(module.tvehicle.paintjobs.search_text)) then end imgui.SameLine() imgui.Spacing() - imgui.Combo("Component",tvehicles.components.selected,tvehicles.components.list,#tvehicles.components.names) - if imgui.ColorEdit3("Color",tvehicles.color.rgb) then + imgui.Combo("Component",module.tvehicle.components.selected,module.tvehicle.components.list,#module.tvehicle.components.names) + if imgui.ColorEdit3("Color",module.tvehicle.color.rgb) then module.ForEachCarComponent(function(mat,comp,car) local r, g, b, old_a = mat:get_color() fixCar(car) - if tvehicles.components.selected[0] == 0 and (r == 0x3C and g == 0xFF and b == 0x00) or (r == 0xFF and g == 0x00 and b == 0xAF) then - mat:set_color(tvehicles.color.rgb[0]*255, tvehicles.color.rgb[1]*255, tvehicles.color.rgb[2]*255, 255.0) - if tvehicles.paintjobs.texture ~= nil then - mat:set_texture(tvehicles.paintjobs.texture) + if module.tvehicle.components.selected[0] == 0 and (r == 0x3C and g == 0xFF and b == 0x00) or (r == 0xFF and g == 0x00 and b == 0xAF) then + mat:set_color(module.tvehicle.color.rgb[0]*255, module.tvehicle.color.rgb[1]*255, module.tvehicle.color.rgb[2]*255, 255.0) + if module.tvehicle.paintjobs.texture ~= nil then + mat:set_texture(module.tvehicle.paintjobs.texture) end end - if comp.name == tvehicles.components.names[tvehicles.components.selected[0]+1] then - mat:set_color(tvehicles.color.rgb[0]*255, tvehicles.color.rgb[1]*255, tvehicles.color.rgb[2]*255, 255.0) - if tvehicles.paintjobs.texture ~= nil then - mat:set_texture(tvehicles.paintjobs.texture) + if comp.name == module.tvehicle.components.names[module.tvehicle.components.selected[0]+1] then + mat:set_color(module.tvehicle.color.rgb[0]*255, module.tvehicle.color.rgb[1]*255, module.tvehicle.color.rgb[2]*255, 255.0) + if module.tvehicle.paintjobs.texture ~= nil then + mat:set_texture(module.tvehicle.paintjobs.texture) end end - tvehicles.color.default = getCarColours(car) + module.tvehicle.color.default = getCarColours(car) end) end imgui.Spacing() if imgui.Button("Reset color",imgui.ImVec2(fcommon.GetSize(2))) then module.ForEachCarComponent(function(mat,car) mat:reset_color() - tvehicles.color.default = -1 + module.tvehicle.color.default = -1 end) end imgui.SameLine() if imgui.Button("Reset texture",imgui.ImVec2(fcommon.GetSize(2))) then module.ForEachCarComponent(function(mat,car) mat:reset_texture() - tvehicles.paintjobs.texture = nil + module.tvehicle.paintjobs.texture = nil end) end imgui.Spacing() - imgui.Text("Found entries :(" .. ffi.string(tvehicles.paintjobs.search_text) .. ")") + imgui.Text("Found entries :(" .. ffi.string(module.tvehicle.paintjobs.search_text) .. ")") imgui.Separator() imgui.Spacing() - local mask = tvehicles.paintjobs.path .. "*.png" + local mask = module.tvehicle.paintjobs.path .. "*.png" local handle,file = findFirstFile(mask) local model_table = {} @@ -575,7 +570,7 @@ function module.VehicleMain() if imgui.BeginChild("Vehicle entries") then - fcommon.ShowEntries(nil,model_table,80,100,tvehicles.paintjobs.images,tvehicles.paintjobs.path,".png", module.ApplyTexture,module.GetTextureName,true,tvehicles.paintjobs.search_text) + fcommon.ShowEntries(nil,model_table,80,100,module.tvehicle.paintjobs.images,module.tvehicle.paintjobs.path,".png", module.ApplyTexture,module.GetTextureName,true,module.tvehicle.paintjobs.search_text) imgui.EndChild() end @@ -585,7 +580,7 @@ function module.VehicleMain() if imgui.BeginTabItem('Tune') then imgui.Spacing() if imgui.Button("Restore mods",imgui.ImVec2(150,25)) then - if isCharInAnyCar(PLAYER_PED) and tvehicles.components.saved then + if isCharInAnyCar(PLAYER_PED) and module.tvehicle.components.saved then callFunction(0x49B3C0,0,0) end end @@ -593,26 +588,26 @@ function module.VehicleMain() if imgui.Button("Save mods",imgui.ImVec2(150,25)) then if isCharInAnyCar(PLAYER_PED) then callFunction(0x49B280,0,0) - tvehicles.components.saved = true + module.tvehicle.components.saved = true end end fcommon.InformationTooltip("Left click to add component\nRight click to remove component") imgui.Spacing() if imgui.BeginChild("Tune") then imgui.Spacing() - fcommon.ShowEntries("Bullbar",{1100,1109,1110,1115,1116,1123,1125},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Exhaust",{1018,1019,1020,1021,1022,1028,1029,1034,1037,1043,1044,1045,1046,1059,1064,1065,1066,1089,1092,1104,1105,1113,1114,1126,1127,1129,1132,1135,1136},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Front bumper",{1117,1152,1153,1155,1157,1160,1165,1166,1169,1170,1171,1172,1173,1174,1175,1179,1181,1182,1185,1188,1189,1190,1191},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Front sign",{1111,1112},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) fcommon.ShowEntries("Hood",{1004,1005,1011,1012},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Lamps",{1013,1024},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Misc",{1086,1087},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Nitros",{1008,1009,1010},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Rear bumper",{1140,1141,1148,1149,1150,1151,1154,1156,1159,1161,1167,1168,1176,1177,1178,1180,1183,1184,1186,1187,1192,1193},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Roof",{1006,1032,1033,1035,1038,1053,1054,1055,1061,1067,1068,1088,1091,1103,1028,1130,1131},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Sideskirt",{1007,1017,1026,1027,1030,1031,1036,1039,1040,1041,1042,1047,1048,1051,1052,1056,1057,1062,1063,1069,1070,1071,1072,1090,1093,1094,1095,1099,1101,1102,1106,1107,1108,1118,1119,1120,1121,1122,1124,1133,1134,1137},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Spoiler",{1000,1001,1002,1003,1014,1015,1016,1023,1049,1050,1058,1060,1138,1139,1146,1147,1158,1162,1163,1164},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Vents",{1142,1143,1144,1145},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,false) - fcommon.ShowEntries("Wheels",{1025,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1096,1097,1098},75,100,tvehicles.components.images,tvehicles.components.path,".jpg", module.AddComponentToVehicle,nil,true) + fcommon.ShowEntries("Bullbar",{1100,1109,1110,1115,1116,1123,1125},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Exhaust",{1018,1019,1020,1021,1022,1028,1029,1034,1037,1043,1044,1045,1046,1059,1064,1065,1066,1089,1092,1104,1105,1113,1114,1126,1127,1129,1132,1135,1136},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Front bumper",{1117,1152,1153,1155,1157,1160,1165,1166,1169,1170,1171,1172,1173,1174,1175,1179,1181,1182,1185,1188,1189,1190,1191},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Front sign",{1111,1112},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) fcommon.ShowEntries("Hood",{1004,1005,1011,1012},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Lamps",{1013,1024},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Misc",{1086,1087},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Nitros",{1008,1009,1010},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Rear bumper",{1140,1141,1148,1149,1150,1151,1154,1156,1159,1161,1167,1168,1176,1177,1178,1180,1183,1184,1186,1187,1192,1193},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Roof",{1006,1032,1033,1035,1038,1053,1054,1055,1061,1067,1068,1088,1091,1103,1028,1130,1131},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Sideskirt",{1007,1017,1026,1027,1030,1031,1036,1039,1040,1041,1042,1047,1048,1051,1052,1056,1057,1062,1063,1069,1070,1071,1072,1090,1093,1094,1095,1099,1101,1102,1106,1107,1108,1118,1119,1120,1121,1122,1124,1133,1134,1137},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Spoiler",{1000,1001,1002,1003,1014,1015,1016,1023,1049,1050,1058,1060,1138,1139,1146,1147,1158,1162,1163,1164},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Vents",{1142,1143,1144,1145},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,false) + fcommon.ShowEntries("Wheels",{1025,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1096,1097,1098},75,100,module.tvehicle.components.images,module.tvehicle.components.path,".jpg", module.AddComponentToVehicle,nil,true) imgui.EndChild() end imgui.EndTabItem() diff --git a/lib/cheat-menu/modules/visual.lua b/lib/cheat-menu/modules/visual.lua index 04a73649..f67805d8 100755 --- a/lib/cheat-menu/modules/visual.lua +++ b/lib/cheat-menu/modules/visual.lua @@ -18,13 +18,13 @@ local module = {} local tvisual = { - zone_names = imgui.new.bool(true), car_names = imgui.new.bool(true), money = { - positive = imgui.new.char[20](fconfig.get('tvisual.money.positive',memory.tostring(readMemory(0x58F4C8,4,false)))), - negative = imgui.new.char[20](fconfig.get('tvisual.money.negative',memory.tostring(readMemory(0x58F50A,4,false)))), + negative = imgui.new.char[20](memory.tostring(readMemory(0x58F50A,4,false))), + positive = imgui.new.char[20](memory.tostring(readMemory(0x58F4C8,4,false))), }, + zone_names = imgui.new.bool(true), } module.tvisual = tvisual @@ -74,24 +74,21 @@ function module.VisualMain() local var = allocateMemory(4) ffi.copy(ffi.cast("char*", var), ffi.string(tvisual.money.positive)) writeMemory(0x58F4C8,4,var,false) - freeMemory(var) end if imgui.InputText("Negative",tvisual.money.negative,ffi.sizeof(tvisual.money.negative)) then local var = allocateMemory(4) ffi.copy(ffi.cast("char*", var), ffi.string(tvisual.money.negative)) writeMemory(0x58F50A,4,var,false) - freeMemory(var) end if imgui.Button("Reset to default",imgui.ImVec2(fcommon.GetSize(1))) then local var = allocateMemory(4) - ffi.copy(ffi.cast("char*", var), "-$%07d") + ffi.copy(ffi.cast("char(*)", var), "-$%07d") imgui.StrCopy(tvisual.money.negative,"-$%07d",ffi.sizeof(tvisual.money.negative)) writeMemory(0x58F4C8,4,var,false) - ffi.copy(ffi.cast("char*", var), "$%08d") + ffi.copy(ffi.cast("char(*)", var), "$%08d") imgui.StrCopy(tvisual.money.positive,"$%08d",ffi.sizeof(tvisual.money.positive)) writeMemory(0x58F50A,4,var,false) - freeMemory(var) end end) diff --git a/lib/cheat-menu/modules/weapon.lua b/lib/cheat-menu/modules/weapon.lua index 256f7769..3b044b51 100755 --- a/lib/cheat-menu/modules/weapon.lua +++ b/lib/cheat-menu/modules/weapon.lua @@ -16,24 +16,22 @@ local module = {} -local tweapon = +module.tweapon = { + fast_reload = imgui.new.bool(fconfig.get('tweapon.fast_reload',false)), images = {}, - path = tcheatmenu.dir .. "weapons\\", - quick_spawn = imgui.new.bool(fconfig.get('tweapon.quick_spawn',false)), - noreload = imgui.new.bool(false), - fast_reload = imgui.new.bool(false), - search_text = imgui.new.char[20](fconfig.get('tweapon.search_text',"")), models = {}, + no_reload = imgui.new.bool(fconfig.get('tweapon.no_reload',false)), + path = tcheatmenu.dir .. "weapons\\", ped = imgui.new.bool(fconfig.get('tweapon.ped',false)), + quick_spawn = imgui.new.bool(fconfig.get('tweapon.quick_spawn',false)), + search_text = imgui.new.char[20](""), } for i = 1,46,1 do - table.insert(tweapon.models,i) + table.insert(module.tweapon.models,i) end -module.tweapon = tweapon - function module.GetName(id) local flibweapons = nil if getMoonloaderVersion() < 27 then @@ -67,7 +65,7 @@ function module.GiveWeapon(weapon) requestModel(model) loadAllModelsNow() - if tweapon.ped[0] == true then + if module.tweapon.ped[0] == true then if fped.tped.selected ~= nil then giveWeaponToChar(fped.tped.selected,weapon,99999) fcommon.CheatActivated() @@ -87,7 +85,7 @@ function module.WeaponMain() imgui.Spacing() if imgui.Button("Remove current weapon",imgui.ImVec2(fcommon.GetSize(2))) then - if tweapon.ped[0] == true then + if module.tweapon.ped[0] == true then if fped.tped.selected ~= nil then removeWeaponFromChar(fped.tped.selected,getCurrentCharWeapon(fped.tped.selected)) fcommon.CheatActivated() @@ -102,7 +100,7 @@ function module.WeaponMain() end imgui.SameLine() if imgui.Button("Remove all weapons",imgui.ImVec2(fcommon.GetSize(2))) then - if tweapon.ped[0] == true then + if module.tweapon.ped[0] == true then if fped.tped.selected ~= nil then removeAllCharWeapons(fped.tped.selected) fcommon.CheatActivated() @@ -119,18 +117,17 @@ function module.WeaponMain() if imgui.BeginTabItem("Checkbox") then imgui.Spacing() imgui.Columns(2,nil,false) - fcommon.CheckBox({ name = "Fast reload",var = tweapon.fast_reload,func = function() - if tweapon.fast_reload[0] then - setPlayerFastReload(PLAUER_HANDLE,true) + fcommon.CheckBox({ name = "Fast reload",var = module.tweapon.fast_reload,func = function() + setPlayerFastReload(PLAYER_HANDLE,module.tweapon.fast_reload[0]) + if module.tweapon.fast_reload[0] then fcommon.CheatActivated() else - setPlayerFastReload(PLAUER_HANDLE,false) fcommon.CheatDeactivated() end end}) imgui.NextColumn() - fcommon.CheckBox({ name = "No reload + Inf ammo",var = tweapon.noreload,func = function() - if tweapon.noreload[0] then + fcommon.CheckBox({ name = "No reload + Inf ammo",var = module.tweapon.no_reload,func = function() + if module.tweapon.no_reload[0] then writeMemory( 7600773,1,144,1) writeMemory( 7600815,1,144,1) writeMemory( 7600816,2,37008,1) @@ -154,9 +151,9 @@ function module.WeaponMain() if imgui.BeginTabItem("Spawn") then imgui.Spacing() imgui.Columns(2,nil,false) - fcommon.CheckBox({ name = "Quick Weapon",var = tweapon.quick_spawn,help_text = "Weapon can be spawned from quick spawner using (Left Ctrl + Q). \n\nControls:\nEnter : Stop reading key press\nDelete : Erase full string\nBackspace : Erase last character"}) + fcommon.CheckBox({ name = "Quick Weapon",var = module.tweapon.quick_spawn,help_text = "Weapon can be spawned from quick spawner using (Left Ctrl + Q). \n\nControls:\nEnter : Stop reading key press\nDelete : Erase full string\nBackspace : Erase last character"}) imgui.NextColumn() - fcommon.CheckBox({name = "Ped",var = tweapon.ped,help_text = "Give weapon to ped.Aim with a gun to select."}) + fcommon.CheckBox({name = "Ped",var = module.tweapon.ped,help_text = "Give weapon to ped.Aim with a gun to select."}) imgui.Columns(1) imgui.Spacing() if imgui.BeginTabBar("Spawn") then @@ -164,30 +161,30 @@ function module.WeaponMain() imgui.Spacing() if imgui.BeginChild("Weapon list Window") then - fcommon.ShowEntries("Assault rifles",{30,31},65,65,tweapon.images,tweapon.path,".png",module.GiveWeapon,module.GetName,true) - fcommon.ShowEntries("Handguns",{22,23,24},65,65,tweapon.images,tweapon.path,".png",module.GiveWeapon,module.GetName,true) - fcommon.ShowEntries("Heavy weapons",{35,36,37,38},65,65,tweapon.images,tweapon.path,".png",module.GiveWeapon,module.GetName,true) - fcommon.ShowEntries("Melee",{1,2,3,4,6,7,8,9},65,65,tweapon.images,tweapon.path,".png",module.GiveWeapon,module.GetName,true) - fcommon.ShowEntries("Miscellaneous",{10,11,12,14,15,41,42,43,44,45,46},65,65,tweapon.images,tweapon.path,".png",module.GiveWeapon,module.GetName,true) - fcommon.ShowEntries("Projectiles",{16,17,18,39},65,65,tweapon.images,tweapon.path,".png",module.GiveWeapon,module.GetName,true) - fcommon.ShowEntries("Shotguns",{25,26,27},65,65,tweapon.images,tweapon.path,".png",module.GiveWeapon,module.GetName,true) - fcommon.ShowEntries("Sub machine guns",{28,29,32},65,65,tweapon.images,tweapon.path,".png",module.GiveWeapon,module.GetName,true) - fcommon.ShowEntries("Rifles",{33,34},65,65,tweapon.images,tweapon.path,".png",module.GiveWeapon,module.GetName,true) + fcommon.ShowEntries("Assault rifles",{30,31},65,65,module.tweapon.images,module.tweapon.path,".png",module.GiveWeapon,module.GetName,true) + fcommon.ShowEntries("Handguns",{22,23,24},65,65,module.tweapon.images,module.tweapon.path,".png",module.GiveWeapon,module.GetName,true) + fcommon.ShowEntries("Heavy weapons",{35,36,37,38},65,65,module.tweapon.images,module.tweapon.path,".png",module.GiveWeapon,module.GetName,true) + fcommon.ShowEntries("Melee",{1,2,3,4,6,7,8,9},65,65,module.tweapon.images,module.tweapon.path,".png",module.GiveWeapon,module.GetName,true) + fcommon.ShowEntries("Miscellaneous",{10,11,12,14,15,41,42,43,44,45,46},65,65,module.tweapon.images,module.tweapon.path,".png",module.GiveWeapon,module.GetName,true) + fcommon.ShowEntries("Projectiles",{16,17,18,39},65,65,module.tweapon.images,module.tweapon.path,".png",module.GiveWeapon,module.GetName,true) + fcommon.ShowEntries("Shotguns",{25,26,27},65,65,module.tweapon.images,module.tweapon.path,".png",module.GiveWeapon,module.GetName,true) + fcommon.ShowEntries("Sub machine guns",{28,29,32},65,65,module.tweapon.images,module.tweapon.path,".png",module.GiveWeapon,module.GetName,true) + fcommon.ShowEntries("Rifles",{33,34},65,65,module.tweapon.images,module.tweapon.path,".png",module.GiveWeapon,module.GetName,true) imgui.EndChild() end imgui.EndTabItem() end if imgui.BeginTabItem("Search") then imgui.Spacing() - if imgui.InputText("Search",tweapon.search_text,ffi.sizeof(tweapon.search_text)) then end + if imgui.InputText("Search",module.tweapon.search_text,ffi.sizeof(module.tweapon.search_text)) then end imgui.SameLine() imgui.Spacing() - imgui.Text("Found entries :(" .. ffi.string(tweapon.search_text) .. ")") + imgui.Text("Found entries :(" .. ffi.string(module.tweapon.search_text) .. ")") imgui.Separator() imgui.Spacing() if imgui.BeginChild("Weapon Entries") then - fcommon.ShowEntries(nil,tweapon.models,65,65,tweapon.images,tweapon.path,".png",module.GiveWeapon,module.GetName,true,tweapon.search_text) + fcommon.ShowEntries(nil,module.tweapon.models,65,65,module.tweapon.images,module.tweapon.path,".png",module.GiveWeapon,module.GetName,true,module.tweapon.search_text) imgui.EndChild() end imgui.EndTabItem()