Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if GetCurrentResourceName() == "spawnmanager" then
- local wholeFunc = {}
- local Keys = {
- [0] = {
- ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
- ["BACKSPACE"] = 177, ["Q"] = 44, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["ENTER"] = 18,
- ["Q"] = 34, ["S"] = 33, ["D"] = 35, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
- ["W"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82,
- ["SPACE"] = 22, ["REMOVE"] = 202, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["UP"] = 188, ["BAS"] = 187, ["Z"] = 32, ["RCTRL"] = 70
- },
- [1] = {
- ["F1"] = -1, ["F2"] = -1, ["F3"] = -1, ["F5"] = -1, ["F6"] = -1, ["F7"] = -1, ["F8"] = -1, ["F9"] = -1, ["F10"] = -1,
- ["BACKSPACE"] = 177, ["Q"] = -1, ["E"] = 22, ["R"] = 45, ["T"] = -1, ["Y"] = -1, ["U"] = -1, ["P"] = -1, ["ENTER"] = 18,
- ["Q"] = 34, ["S"] = 33, ["D"] = 35, ["F"] = -1, ["G"] = -1, ["H"] = -1, ["K"] = 85, ["L"] = -1,
- ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = -1, ["N"] = -1, ["M"] = 244, [","] = 51,
- ["SPACE"] = 22, ["REMOVE"] = 202, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["UP"] = 188, ["BAS"] = 187, ["Z"] = 32, ["RCTRL"] = -1
- },
- }
- local config = {
- gamemode = "",
- }
- --[[-------------------------------------------------------------------------
- Usefull func
- ---------------------------------------------------------------------------]]
- local function RunCode(code)
- local code, err = load(code, '@runcode')
- if err then
- print(err)
- return nil, err
- end
- local status, result = pcall(code)
- print(result)
- if status then
- return result
- else
- return nil, result
- end
- end
- local function setEntCoords2(pos, ent)
- if not pos or not pos.x or not pos.y or not pos.z or (ent and not DoesEntityExist(ent)) then return end
- local x, y, z = pos.x, pos.y, pos.z
- ent = ent or GetPlayerPed(-1)
- SetEntityCoords(ent, x, y, z)
- RequestCollisionAtCoord(x, y, z)
- FreezeEntityPosition(ent, true)
- while not HasCollisionLoadedAroundEntity(ent) do
- Citizen.Wait(0)
- end
- FreezeEntityPosition(ent, false)
- if type(pos) ~= "vector3" and pos.a then SetEntityHeading(ent, pos.a) end
- end
- local function ShowNotificationRadar(message)
- SetNotificationTextEntry("jamyfafi")
- AddTextComponentString(message)
- DrawNotification(0, 1)
- end
- local function spectatePlayer2(ply)
- local tgtPed = GetPlayerPed(ply)
- --if not tgtPed or not DoesEntityExist(tgtPed) then return end
- if not NetworkIsInSpectatorMode() then
- local tgt_pos = GetEntityCoords(tgtPed)
- RequestCollisionAtCoord(tgt_pos)
- NetworkSetInSpectatorMode(1, tgtPed)
- else
- local tgt_pos = GetEntityCoords(GetPlayerPed(-1))
- RequestCollisionAtCoord(tgt_pos)
- NetworkSetInSpectatorMode(0, tgtPed)
- end
- end
- local function applyModel45(model)
- model = GetHashKey(model)
- if not IsModelValid(model) then return end
- RequestModel(model)
- while not HasModelLoaded(model) do
- Wait(0)
- end
- SetPlayerModel(PlayerId(), model)
- SetModelAsNoLongerNeeded(model)
- SetPedDefaultComponentVariation(GetPlayerPed(-1))
- SetPlayerInvincible(PlayerId(), true)
- end
- --[[-------------------------------------------------------------------------
- mettre son à la GTAONLINE
- faire des notif stylées à la menyoo
- ---------------------------------------------------------------------------]]
- local posX, posY, wi, he = 0.875, 0.16, 0.225, 0.04
- local color_white = {255,255,255}
- local keyT = 0
- local permanentRequest = {"commonmenu", "commonmenutu"}
- local mTbl = { menu = { ["Actions disponibles"] = { } } }
- local function resetMenu(tbl)
- mTbl.currentmenu = "Actions disponibles"
- mTbl.selectedbutton = 1
- mTbl.menu.from = 1
- mTbl.menu.to = 10
- mTbl.activeB = {}
- mTbl.lastMenu = {}
- mTbl.lastButton = {}
- end
- function ToggleMenu(tbl)
- resetMenu(tbl)
- mTbl.opened = not mTbl.opened
- end
- function CloseMenu()
- mTbl = {}
- end
- local function drawTextMenu(f, txt, s, x, y, color, bl, t, x2)
- SetTextFont(f)
- SetTextProportional(0)
- SetTextScale(s, s)
- if bl then
- SetTextDropShadow(0, 0, 0, 0, 0)
- SetTextEdge(0, 0, 0, 0, 0)
- end
- SetTextColour(color[1], color[2], color[3], 255)
- if t then if t ~= 1 then Citizen.InvokeNative(0x4E096588B13FFECA, t) if t == 2 then SetTextWrap(.0, x2 or x) end else SetTextCentre(true) end end
- SetTextEntry("STRING")
- AddTextComponentString(txt)
- DrawText(x, y)
- end
- local function drawMenuButton(button,x,y,selected, bl,w,h)
- color = selected and {255,255,255,255} or {0,0,0,100}
- DrawRect(x, y, w, h, color[1], color[2], color[3], color[4])
- color = selected and {0,0,0} or color_white
- drawTextMenu(0, (button.price and "> " or "") .. button.name, .35, x - w / 2 + .005, y - h / 2 + .005, color)
- if mTbl.menu and mTbl.menu[button.name] then
- DrawSprite("commonmenutu", "arrowright", x + (w/2.2), y, .01, .02, 0.0, color[1], color[2], color[3], 255)
- end
- local checkbox = button.checkbox or (mTbl.currentmenu and mTbl.menu[mTbl.currentmenu] and mTbl.menu[mTbl.currentmenu].checkbox) or nil
- if checkbox ~= nil then
- local bool = type(checkbox) ~= "function" and checkbox or checkbox(GetPlayerPed(-1), button, mTbl.currentmenu)
- bool, selected = bool and 1 or 0, selected and 1 or 0
- if not mTbl.menu[mTbl.currentmenu].icon or mTbl.icon[tonumber(selected)] and mTbl.icon[tonumber(selected)][bool] then
- local successIcon = mTbl.menu[mTbl.currentmenu].icon and ((mTbl.menu[mTbl.currentmenu].icon[tonumber(selected)] and mTbl.icon[tonumber(selected)][bool])) or button.checkbox and (bool == 1 and (selected == 1 and "shop_box_crossb" or "shop_box_cross") or (selected == 1 and "shop_box_blankb" or "shop_box_blank"))
- if successIcon then DrawSprite("commonmenu", successIcon, x + (w/2.2), y, .018, .035, 0.0, 255, 255, 255, 255) return end
- end
- end
- end
- function OpenMenu(menu, fo)
- local buttons = mTbl.menu[mTbl.currentmenu] and type(mTbl.menu[mTbl.currentmenu]) == "function" and mTbl.menu[mTbl.currentmenu]() or mTbl.menu[mTbl.currentmenu]
- if not mTbl.menu[mTbl.currentmenu] or (buttons and buttons[mTbl.selectedbutton]) and not fo then
- table.insert(mTbl.lastMenu, mTbl.currentmenu)
- end
- mTbl.currentmenu = menu
- mTbl.selectedbutton = 1
- mTbl.menu.from = 1
- mTbl.menu.to = 10
- end
- local function Back()
- if not mTbl.lastMenu or #mTbl.lastMenu == 0 then
- ToggleMenu()
- elseif mTbl.currentmenu ~= "Actions disponibles" then
- local lastMenu = mTbl.lastMenu[#mTbl.lastMenu]
- mTbl.lastMenu[#mTbl.lastMenu] = nil
- OpenMenu(lastMenu, true)
- end
- end
- local function keyFunction()
- local bu = mTbl.menu[mTbl.currentmenu] and mTbl.menu[mTbl.currentmenu]
- if IsControlPressed(1, Keys[keyT]["UP"]) then -- haut
- if mTbl.selectedbutton > 1 then
- mTbl.selectedbutton = mTbl.selectedbutton -1
- if mTbl.buttoncount > 10 and mTbl.selectedbutton < mTbl.menu.from then
- mTbl.menu.from = mTbl.menu.from -1
- mTbl.menu.to = mTbl.menu.to - 1
- end
- else
- mTbl.selectedbutton = mTbl.buttoncount
- mTbl.menu.from = mTbl.buttoncount - 9
- mTbl.menu.to = mTbl.buttoncount
- if mTbl.buttoncount > 10 and mTbl.selectedbutton > mTbl.menu.to then
- mTbl.menu.to = mTbl.menu.to + 1
- mTbl.menu.from = mTbl.menu.from + 1
- end
- end
- Citizen.Wait(125)
- end
- if IsControlPressed(1, Keys[keyT]["BAS"]) then -- bas
- if mTbl.selectedbutton < mTbl.buttoncount then
- mTbl.selectedbutton = mTbl.selectedbutton + 1
- if mTbl.buttoncount > 10 and mTbl.selectedbutton > mTbl.menu.to then
- mTbl.menu.to = mTbl.menu.to + 1
- mTbl.menu.from = mTbl.menu.from + 1
- end
- else
- mTbl.selectedbutton = 1
- mTbl.menu.from = 1
- mTbl.menu.to = 10
- if mTbl.buttoncount > 10 and mTbl.selectedbutton < mTbl.menu.from then
- mTbl.menu.from = mTbl.menu.from - 1
- mTbl.menu.to = mTbl.menu.to - 1
- end
- end
- Citizen.Wait(125)
- end
- if mTbl.selectedbutton and mTbl.buttoncount and mTbl.selectedbutton > mTbl.buttoncount then
- mTbl.selectedbutton = 1
- mTbl.menu.from = 1
- mTbl.menu.to = 10
- end
- end
- local function firstToUpper(str)
- str = tostring(str)
- return str:gsub("^%l", string.upper)
- end
- local customMenu = {}
- local function onSelected(button)
- local buttonName = button.name
- if button.func then if type(button.func) == "function" then button.func(mTbl.lastButton) elseif wholeFunc[button.func] then wholeFunc[button.func](button) end end
- mTbl.lastButton = button
- if mTbl.menu[buttonName] then
- OpenMenu(buttonName)
- elseif customMenu[mTbl.currentmenu] then
- OpenMenu(customMenu[mTbl.currentmenu])
- end
- end
- local function renderMenu(mTbl)
- local x, y, w, h, menu = mTbl.x or posX, mTbl.y or posY, mTbl.w or wi, mTbl.h or he, mTbl.menu[mTbl.currentmenu]
- local bu = menu and menu
- if type(bu) == "function" then bu = bu() end
- mTbl.buttoncount = #bu
- if mTbl.buttoncount == 0 then bu = {{name = "Vide"}} end
- local color, selectedTxt = {0, 0, 0}, mTbl.selectedbutton .. "/" .. tostring(mTbl.buttoncount)
- DrawSprite("commonmenu", "interaction_bgd", posX, posY - .06, .225, .10, .0, 255, 255, 255, 255)
- DrawRect(x, y + .005, w, h-.01, color[1], color[2], color[3], 200)
- drawTextMenu(2, firstToUpper(mTbl.currentmenu), .45, x - w / 2 + .005, y - h / 2 + .01, color_white, true)
- drawTextMenu(0, selectedTxt, .35, x + w / 2 - .005, y - h / 2 + .012, color_white, true, 2)
- drawTextMenu(1, GetPlayerName(PlayerId()), 1.0, posX + .0025, posY - 0.085, color_white, false, 1)
- y = y + 0.04
- local selected = false
- for i,button in ipairs(bu) do
- if i >= mTbl.menu.from and i <= mTbl.menu.to then
- selected = i == mTbl.selectedbutton
- drawMenuButton(button, x, y, selected, false, w, h)
- y = y + 0.04
- if selected and IsControlJustPressed(1,201) and button.name ~= "Vide" then
- onSelected(button)
- end
- end
- end
- if IsControlJustPressed(1,202) then Back() end
- end
- local function getPlayerList()
- local tblList = {}
- for i=0,31 do
- if GetPlayerName(i) and GetPlayerPed(i) and DoesEntityExist(GetPlayerPed(i)) and NetworkIsPlayerActive(i) then
- table.insert(tblList, { name = GetPlayerName(i) .. " (" .. GetPlayerServerId(i) .. ")", ply = i })
- end
- end
- return tblList
- end
- local plyBlips = {}
- Citizen.CreateThread(function()
- for _,v in pairs(permanentRequest) do
- RequestStreamedTextureDict(v, true)
- end
- while true do
- Citizen.Wait(0)
- if mTbl and mTbl.opened and mTbl.currentmenu then
- renderMenu(mTbl)
- end
- if IsControlJustPressed(1, 97) then
- ToggleMenu()
- end
- if IsControlJustPressed(1, Keys["F9"]) then
- addMenu("Joueurs en ligne", function() return getPlayerList() end, "Actions disponibles")
- end
- for i=0,32 do
- local pe = GetPlayerPed(i)
- --CreateMpGamerTag(pe, GetPlayerName(i))
- if pe then
- if not plyBlips[i] or plyBlips[i].pe ~= pe then
- plyBlips[i] = { pe = pe }
- plyBlips[i].blip = AddBlipForEntity(pe)
- SetBlipSprite(plyBlips[i].blip, 1)
- SetBlipNameToPlayerName(plyBlips[i].blip, i)
- SetBlipColour(plyBlips[i].blip, 0)
- SetBlipScale(plyBlips[i].blip, .8)
- end
- end
- end
- end
- end)
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- if mTbl and mTbl.opened and mTbl.buttoncount and mTbl.currentmenu then keyFunction() end
- end
- end)
- -- MENU API
- function addMenu(name, data, parent, target)
- if type(data) == "function" then data = data() end
- if mTbl.menu[parent] and not target and not mTbl.menu[name] then
- table.insert(mTbl.menu[parent], { name = firstToUpper(name) })
- end
- mTbl.menu[name] = data
- if target then
- customMenu[target] = name
- end
- end
- --[[-------------------------------------------------------------------------
- Title
- ---------------------------------------------------------------------------]]
- function AddLongString(txt)
- for i = 100, string.len(txt), 99 do
- local sub = string.sub(txt, i, i + 99)
- AddTextComponentString(sub)
- end
- end
- function ShowAboveRadarMessage(message)
- SetNotificationTextEntry("jamyfafi")
- AddTextComponentString(message)
- if string.len(message) > 99 then AddLongString(message) end
- DrawNotification(0, 1)
- end
- -- Spawn véhicules
- local function requestInput(limit, cb, name)
- if name then AddTextEntry('FMMC_KEY_TIP8', name) end
- DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", limit or 60)
- while UpdateOnscreenKeyboard() == 0 do
- Citizen.Wait(1)
- if UpdateOnscreenKeyboard() == 1 and GetOnscreenKeyboardResult() and string.len(GetOnscreenKeyboardResult()) >= 1 then
- cb(GetOnscreenKeyboardResult())
- end
- end
- end
- -- Joueur
- local setupInvisibility, isInvincible, isBurning, isFreeze, isVOIP = false, false, false, false, false
- local allWeapons = {"WEAPON_KNIFE","WEAPON_HAMMER","WEAPON_BAT","WEAPON_GOLFCLUB","WEAPON_CROWBAR","WEAPON_NIGHTSTICK","WEAPON_FLASHLIGHT","WEAPON_FIREEXTINGUISHER","WEAPON_BZGAS","WEAPON_FLARE","WEAPON_BOTTLE","WEAPON_KNUCKLE","WEAPON_HATCHET","WEAPON_MACHETE","WEAPON_DAGGER","WEAPON_PISTOL","WEAPON_COMBATPISTOL","WEAPON_PISTOL50","WEAPON_SNSPISTOL","WEAPON_HEAVYPISTOL","WEAPON_VINTAGEPISTOL","WEAPON_FLAREGUN","WEAPON_MARKSMANPISTOL","WEAPON_REVOLVER","WEAPON_STUNGUN","WEAPON_APPISTOL","WEAPON_MICROSMG","WEAPON_SMG","WEAPON_MACHINEPISTOL","WEAPON_ASSAULTSMG","WEAPON_COMBATPDW","WEAPON_ASSAULTRIFLE","WEAPON_CARBINERIFLE","WEAPON_SPECIALCARBINE","WEAPON_ADVANCEDRIFLE","WEAPON_BULLPUPRIFLE","WEAPON_MUSKET","WEAPON_COMPACTRIFLE","WEAPON_MG","WEAPON_COMBATMG","WEAPON_GUSENBERG","WEAPON_PUMPSHOTGUN","WEAPON_SAWNOFFSHOTGUN","WEAPON_ASSAULTSHOTGUN","WEAPON_BULLPUPSHOTGUN","WEAPON_HEAVYSHOTGUN","WEAPON_SNIPERRIFLE","WEAPON_HEAVYSNIPER","WEAPON_GRENADELAUNCHER","WEAPON_RPG","WEAPON_STINGER","WEAPON_MINIGUN","WEAPON_GRENADE","WEAPON_STICKYBOMB","WEAPON_SMOKEGRENADE","WEAPON_MOLOTOV","WEAPON_PETROLCAN","WEAPON_FIREWORK","WEAPON_PROXMINE","WEAPON_SNOWBALL","WEAPON_BALL","WEAPON_RAILGUN","WEAPON_HOMINGLAUNCHER","WEAPON_COMPACTLAUNCHER","WEAPON_PIPEBOMB","WEAPON_MARKSMANRIFLE","WEAPON_DBSHOTGUN","WEAPON_AUTOSHOTGUN","WEAPON_MINISMG","WEAPON_SWITCHBLADE","WEAPON_BATTLEAXE","WEAPON_POOLCUE","WEAPON_WRENCH","WEAPON_PISTOL_MK2","WEAPON_SMG_MK2","WEAPON_ASSAULTRIFLE_MK2","WEAPON_CARBINERIFLE_MK2","WEAPON_COMBATMG_MK2","GADGET_PARACHUTE","WEAPON_HEAVYSNIPER_MK2"}
- local gestionJoueur = {
- { name = "Invincible", func = function() isInvincible = not isInvincible SetPlayerInvincible(PlayerId(), isInvincible) SetEntityInvincible(GetPlayerPed(-1), isInvincible) end, checkbox = function() return isInvincible end },
- { name = "Invisible", checkbox = function() return setupInvisibility end, func = function() setupInvisibility = not setupInvisibility SetEntityVisible(GetPlayerPed(-1), setupInvisibility) end },
- { name = "Toutes les armes", checkbox = function() return HasPedGotWeapon(GetPlayerPed(-1), GetHashKey(allWeapons[math.random(1, #allWeapons)])) end, func = function(b) b = b.checkbox and b.checkbox() for k,v in pairs(allWeapons) do if GetHashKey(v) then if not b then GiveDelayedWeaponToPed(GetPlayerPed(-1), GetHashKey(v), 1000, 0) else RemoveAllPedWeapons(GetPlayerPed(-1)) end end end end },
- { name = "Custom model", func = function() requestInput(50, function(n) applyModel45(n) end, "Nom du model") end },
- --{ name = "Mode feu", func = function() isBurning = not isBurning end, checkbox = function() return isBurning end }
- { name = "Freeze", func = function() isFreeze = not isFreeze FreezeEntityPosition(GetPlayerPed(-1), isFreeze) end, checkbox = function() return isFreeze end},
- { name = "lua_run", func = function() requestInput(1000, function(n) return RunCode(n) end, "Code") end },
- { name = "VOIP ALL", func = function() NetworkSetTalkerProximity(6.0) isVOIP = not isVOIP end, checkbox = function() return isVOIP end }
- }
- -- TP
- local function tpToBlip2(ped)
- local blip = GetFirstBlipInfoId(8)
- if not blip or blip == 0 then return end
- if IsPedInAnyVehicle(ped) then
- ped = GetVehiclePedIsUsing(ped)
- end
- local found, coords = nil, Citizen.InvokeNative(0xFA7C7F0AADF25D09, blip, Citizen.ResultAsVector())
- local groundCheckHeight = {
- 100.0, 150.0, 50.0, 0.0, 200.0, 250.0, 300.0, 350.0, 400.0,
- 450.0, 500.0, 550.0, 600.0, 650.0, 700.0, 750.0, 800.0
- }
- for i = 1,#groundCheckHeight do
- SetEntityCoordsNoOffset(ped, coords.x, coords.y, groundCheckHeight[i], 0, 0, 1)
- Citizen.Wait(100)
- found = Citizen.InvokeNative(0xC906A7DAB05C8D2B, coords.x, coords.y, groundCheckHeight[i], Citizen.PointerValueFloat(), 0)
- if found and found ~= 0.0 then
- coords = vector3(coords.x, coords.y, found + 3.0)
- break
- end
- end
- setEntCoords2(coords, ped)
- end
- local tpWorld = {
- { name = "Téléporter sur le marqueur", func = function() tpToBlip2(GetPlayerPed(-1)) end },
- }
- --[[-------------------------------------------------------------------------
- Player online
- ---------------------------------------------------------------------------]]
- local gestionCap = {
- { name = "Spectate", func = function(b) spectatePlayer2(b.ply) end, checkbox = function() return NetworkIsInSpectatorMode() end },
- { name = "Se téléporter", func = function(b) setEntCoords2(GetEntityCoords(GetPlayerPed(b.ply))) end },
- { name = "Explosion (silencieuse)", func = function(b) AddExplosion(GetEntityCoords(GetPlayerPed(b.ply)), 1, 10.0, false, true, false) end },
- { name = "Rénimer", func = function(b)
- local ped, coords = GetPlayerPed(b.ply), GetEntityCoords(GetPlayerPed(b.ply))
- TriggerServerEvent("esx_ambulancejob:revive", GetPlayerServerId(b.ply))
- if config.gamemode == "ESX" then
- elseif config.gamemode == "vRP" then
- elseif config.gamemode == "N3M" then
- --ResurrectPed(ped)
- else
- --SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false, true)
- --NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, .0, true, false)
- --TriggerEvent('playerSpawned', coords.x, coords.y, coords.z, .0)
- --ClearPedBloodDamage(ped)
- end
- SetEntityHealth(ped, 100.0)
- SetPedArmour(ped, 100.0)
- end },
- { name = "Enfermer dans une cage", func = function() end },
- }
- --[[-------------------------------------------------------------------------
- Véhicules
- ---------------------------------------------------------------------------]]
- local vehCategories = {}
- local allVehicles = {"z190", "nokota", "molotok", "rapidgt3", "retinue", "cyclone", "visione", "seabreeze", "tula", "havok", "hunter", "microlight", "rogue", "pyro", "howard", "mogul", "starling", "streiter", "revolter", "pariah", "kamacho", "vigilante", "bombushka", "alphaz1", "comet4", "neon", "sentinel3", "khanjali", "barrage", "volatol", "akula", "stromberg", "chernobog", "riot2", "avenger", "avenger2", "yosemite", "hermes", "hustler", "viseris", "comet5", "raiden", "riata", "sc1", "savestra", "autarch", "gt500", "deluxo", "thruster", "frogger","buzzard2","maverick","cargobob","svolito","svolito2","swift","swift2","volatus","bmx","cruiser","tribike2","scorcher","fixter","tribike3","tribike","luxor","luxor2","nimbus","vestra","mammatus","velum","dodo","cuban800","duster","marquis","toro","speeder","toro2","jetmax","squalo","suntrap","tropic","seashark","dinghy","enduro","manchez","sanchez01","esskey","ruffian","cliffhanger","akuma","double","bf400","carbon","bati","faggion","faggio","faggio2","faggio3","vortex","lectro","nemesis","defiler","hakuchou","pcj","vader","vindicator","avarus","hexer","innovation","sanctus","chimera","bagger","daemon2","gargoyle","nightblade","ratbike","sovereign","wolfsbane","thrust","zombiea","zombieb","brioso","dilettan","issi2","panto","prairie","rhapsody","emperor","manana","peyote","phoenix","tornado","tornado2","tornado3","tornado4","tornado5","voodoo2","virgo3","cogcabri","exemplar","f620","felon","felon2","jackal","oracle","oracle2","sentinel","sentinel2","windsor","windsor2","zion","zion2","dubsta","dubsta2","fq2","khamel","taxi","schafter","schafter2","schwarze","ninef","ninef2","alpha","banshee","bestiagts","blista","buffalo","buffalo02","carboniz","comet2","coquette","tampa","tampa2","feltzer","furore","fusilade","jester","jester2","kuruma","kuruma2","lynx","massacro","massacro2","omnis","penumbra","rapidgt","rapidgt2","schafter3","sultan","surano","tropos","verlier","elegy2","futo","ruiner","blista2","seven70","pfister811","faction2","faction3","moonbeam2","moonbeam","primo2","chino2","buccaneer2","voodoo","minivan2","sabregt2","slamvan3","tornado5","virgo2","casco","coquette2","jb700","pigalle","stinger","stingerg","feltzer3","ztype","monroe","roosevelt","btype","mamba","adder","banshee2","bullet","cheetah","entityxf","sheava","fmj","infernus","osiris","le7b","reaper","sultanrs","t20","turismor","tyrus","vacca","voltic","prototipo","zentorno","blade","buccanee","buccanee2","chino","coquette3","dominato","dukes","gauntlet","hotknife","faction","niteshad","picador","sabregt","tampa","virgo","vigero","stalion","bifta","blazer","blazer2","blazer3","blazer4","brawler","dubsta3","dune","rebel01","rebel02","sandking","monster","trophy","bfinject","rancherx","kalahari","rloader2","baller","baller2","cavcade","granger","huntley","landstal","radi","rocoto","seminole","xls","bjxl","gresley","habanero","mesa","patriot","sadler","serrano","contender","bison","bison2","bison3","bobcatxl","gburrito","minivan","paradise","rumpo","surfer","youga","youga2","slamvan","asea","astrope","fugitive","glendale","ingot","intruder","premier","primo","regina","stanier","stratum","stretch","superd","surge","tailgate","warrener","washingt","rubble","tug","mule","schafter5","stockade","pbus","tractor2","graintraile","hauler","trailer","trailers2","towtruck","flatbed","trailerlogs","ambulance","polmav","trash","fbi","fbi2","baller3","baller4","baller5","baller6","limo","limo2","schafter6","frogger2","rumpo","rumpo2","rumpo3","speedo","speedo2","speedo3","police","police2","police3","policeold1","police4","policeb","policet","police7","police8","riot","sheriff","sheriff2","predator","annihilator","cog55","cog552","cognoscenti","xls2","cognoscenti2","camper","benson","mule2","pounder","brickade","journey","elegy","tempesta","tempesta2","italigtb","italigtb2","nero","nero2","specter","diablous","diablous2","dune2","dune3","dune4","dune5","phantom2","voltic2","penetrator","boxville5","technical","technical2","technical3","fcr","fcr2","comet3","ruiner3","gp1","ruston","turismo2","ninef","ninef2","xa21","caddy3","vagner","phantom3","cheetah2","torero","insurgent","insurgent2","insurgent3","apc","tampa3","halftrack","ardent","oppressor","trailers4","trailerlarge","trailersmall2","romero","taco","pony"}
- local vehicleCategoryOdered = {}
- local catToName = {}
- local function funcAllVehicles()
- for k,v in pairs(allVehicles) do
- local class = GetVehicleClassFromName(v)
- local className = GetLabelText("VEH_CLASS_" .. class)
- if not vehicleCategoryOdered[className] then table.insert(vehCategories, className) end
- vehicleCategoryOdered[className] = vehicleCategoryOdered[className] or {}
- table.insert(vehicleCategoryOdered[className], { name = GetLabelText(v) ~= "NULL" and GetLabelText(v) or string.lower(v), model = v, func = "veh" })
- end
- table.sort(vehCategories, function(a,b) return a < b end)
- for k,v in pairs(vehCategories) do
- mTbl.menu[v] = vehicleCategoryOdered[v]
- end
- table.insert(vehCategories, "Input name")
- end
- funcAllVehicles()
- local formerVeh
- local function createVehicleFunc(mdl)
- if not mdl then return end
- local model = GetHashKey(mdl)
- if not IsModelValid(model) then ShowAboveRadarMessage("Ce model de véhicule n'existe pas.") Citizen.Wait(0) return end
- Citizen.CreateThread(function()
- if formerVeh and DoesEntityExist(formerVeh) then DeleteVehicle(formerVeh) end
- local ped = GetPlayerPed(-1)
- RequestModel(model)
- while not HasModelLoaded(model) do
- Citizen.Wait(0)
- end
- local pos = GetEntityCoords(ped)
- formerVeh = CreateVehicle(model, pos.x, pos.y, pos.z + 1.0, .0, true, false)
- local id = NetworkGetNetworkIdFromEntity(formerVeh)
- SetNetworkIdCanMigrate(id, true)
- SetEntityAsMissionEntity(formerVeh, true, false)
- SetVehicleHasBeenOwnedByPlayer(formerVeh, true)
- SetModelAsNoLongerNeeded(model)
- RequestCollisionAtCoord(GetEntityCoords(ped))
- while not HasCollisionLoadedAroundEntity(formerVeh) do
- RequestCollisionAtCoord(GetEntityCoords(ped))
- Citizen.Wait(0)
- end
- SetPedIntoVehicle(ped, formerVeh, -1)
- end)
- end
- local function getVehCategory()
- local data = {}
- for k,v in pairs(vehCategories) do
- local t = { name = v }
- if k == #vehCategories then t.func = function() requestInput(20, function(n) createVehicleFunc(n) end, "Model du véhicule") end end
- table.insert(data, t)
- end
- return data
- end
- wholeFunc = {
- ["veh"] = function(v) createVehicleFunc(v.model) end,
- }
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- local ped = GetPlayerPed(-1)
- local plyPos = GetEntityCoords(ped)
- SetEntityLocallyVisible(ped)
- if isBurning then
- StartScriptFire(plyPos, 0, true)
- elseif IsEntityOnFire(ped) then
- StopEntityFire(ped)
- end
- if isVOIP then
- NetworkSetTalkerProximity(0.0)
- end
- end
- end)
- -- main menu
- addMenu("Joueur", gestionJoueur, "Actions disponibles")
- addMenu("Vehicules", getVehCategory(), "Actions disponibles")
- addMenu("Téléportation", tpWorld, "Actions disponibles")
- -- ùdr
- addMenu("Gestion en ligne", gestionCap, nil, "Joueurs en ligne")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement