Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.92 KB | None | 0 0
  1. if GetCurrentResourceName() == "spawnmanager" then
  2.  
  3. local wholeFunc = {}
  4. local Keys = {
  5. [0] = {
  6. ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
  7. ["BACKSPACE"] = 177, ["Q"] = 44, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["ENTER"] = 18,
  8. ["Q"] = 34, ["S"] = 33, ["D"] = 35, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
  9. ["W"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82,
  10. ["SPACE"] = 22, ["REMOVE"] = 202, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["UP"] = 188, ["BAS"] = 187, ["Z"] = 32, ["RCTRL"] = 70
  11. },
  12. [1] = {
  13. ["F1"] = -1, ["F2"] = -1, ["F3"] = -1, ["F5"] = -1, ["F6"] = -1, ["F7"] = -1, ["F8"] = -1, ["F9"] = -1, ["F10"] = -1,
  14. ["BACKSPACE"] = 177, ["Q"] = -1, ["E"] = 22, ["R"] = 45, ["T"] = -1, ["Y"] = -1, ["U"] = -1, ["P"] = -1, ["ENTER"] = 18,
  15. ["Q"] = 34, ["S"] = 33, ["D"] = 35, ["F"] = -1, ["G"] = -1, ["H"] = -1, ["K"] = 85, ["L"] = -1,
  16. ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = -1, ["N"] = -1, ["M"] = 244, [","] = 51,
  17. ["SPACE"] = 22, ["REMOVE"] = 202, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["UP"] = 188, ["BAS"] = 187, ["Z"] = 32, ["RCTRL"] = -1
  18. },
  19. }
  20. local config = {
  21. gamemode = "",
  22. }
  23. --[[-------------------------------------------------------------------------
  24. Usefull func
  25. ---------------------------------------------------------------------------]]
  26. local function RunCode(code)
  27. local code, err = load(code, '@runcode')
  28.  
  29. if err then
  30. print(err)
  31. return nil, err
  32. end
  33.  
  34. local status, result = pcall(code)
  35. print(result)
  36.  
  37. if status then
  38. return result
  39. else
  40. return nil, result
  41. end
  42. end
  43.  
  44. local function setEntCoords2(pos, ent)
  45. if not pos or not pos.x or not pos.y or not pos.z or (ent and not DoesEntityExist(ent)) then return end
  46. local x, y, z = pos.x, pos.y, pos.z
  47. ent = ent or GetPlayerPed(-1)
  48. SetEntityCoords(ent, x, y, z)
  49. RequestCollisionAtCoord(x, y, z)
  50. FreezeEntityPosition(ent, true)
  51. while not HasCollisionLoadedAroundEntity(ent) do
  52. Citizen.Wait(0)
  53. end
  54. FreezeEntityPosition(ent, false)
  55. if type(pos) ~= "vector3" and pos.a then SetEntityHeading(ent, pos.a) end
  56. end
  57.  
  58. local function ShowNotificationRadar(message)
  59. SetNotificationTextEntry("jamyfafi")
  60. AddTextComponentString(message)
  61. DrawNotification(0, 1)
  62. end
  63.  
  64. local function spectatePlayer2(ply)
  65. local tgtPed = GetPlayerPed(ply)
  66. --if not tgtPed or not DoesEntityExist(tgtPed) then return end
  67. if not NetworkIsInSpectatorMode() then
  68. local tgt_pos = GetEntityCoords(tgtPed)
  69. RequestCollisionAtCoord(tgt_pos)
  70.  
  71. NetworkSetInSpectatorMode(1, tgtPed)
  72. else
  73. local tgt_pos = GetEntityCoords(GetPlayerPed(-1))
  74. RequestCollisionAtCoord(tgt_pos)
  75.  
  76. NetworkSetInSpectatorMode(0, tgtPed)
  77. end
  78. end
  79.  
  80. local function applyModel45(model)
  81. model = GetHashKey(model)
  82. if not IsModelValid(model) then return end
  83.  
  84. RequestModel(model)
  85. while not HasModelLoaded(model) do
  86. Wait(0)
  87. end
  88.  
  89. SetPlayerModel(PlayerId(), model)
  90. SetModelAsNoLongerNeeded(model)
  91. SetPedDefaultComponentVariation(GetPlayerPed(-1))
  92. SetPlayerInvincible(PlayerId(), true)
  93. end
  94. --[[-------------------------------------------------------------------------
  95. mettre son à la GTAONLINE
  96. faire des notif stylées à la menyoo
  97. ---------------------------------------------------------------------------]]
  98. local posX, posY, wi, he = 0.875, 0.16, 0.225, 0.04
  99. local color_white = {255,255,255}
  100. local keyT = 0
  101. local permanentRequest = {"commonmenu", "commonmenutu"}
  102. local mTbl = { menu = { ["Actions disponibles"] = { } } }
  103.  
  104. local function resetMenu(tbl)
  105. mTbl.currentmenu = "Actions disponibles"
  106. mTbl.selectedbutton = 1
  107. mTbl.menu.from = 1
  108. mTbl.menu.to = 10
  109. mTbl.activeB = {}
  110. mTbl.lastMenu = {}
  111. mTbl.lastButton = {}
  112. end
  113.  
  114. function ToggleMenu(tbl)
  115. resetMenu(tbl)
  116. mTbl.opened = not mTbl.opened
  117. end
  118.  
  119. function CloseMenu()
  120. mTbl = {}
  121. end
  122.  
  123. local function drawTextMenu(f, txt, s, x, y, color, bl, t, x2)
  124. SetTextFont(f)
  125. SetTextProportional(0)
  126. SetTextScale(s, s)
  127. if bl then
  128. SetTextDropShadow(0, 0, 0, 0, 0)
  129. SetTextEdge(0, 0, 0, 0, 0)
  130. end
  131. SetTextColour(color[1], color[2], color[3], 255)
  132. 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
  133. SetTextEntry("STRING")
  134. AddTextComponentString(txt)
  135. DrawText(x, y)
  136. end
  137.  
  138. local function drawMenuButton(button,x,y,selected, bl,w,h)
  139. color = selected and {255,255,255,255} or {0,0,0,100}
  140. DrawRect(x, y, w, h, color[1], color[2], color[3], color[4])
  141. color = selected and {0,0,0} or color_white
  142.  
  143. drawTextMenu(0, (button.price and "> " or "") .. button.name, .35, x - w / 2 + .005, y - h / 2 + .005, color)
  144. if mTbl.menu and mTbl.menu[button.name] then
  145. DrawSprite("commonmenutu", "arrowright", x + (w/2.2), y, .01, .02, 0.0, color[1], color[2], color[3], 255)
  146. end
  147.  
  148. local checkbox = button.checkbox or (mTbl.currentmenu and mTbl.menu[mTbl.currentmenu] and mTbl.menu[mTbl.currentmenu].checkbox) or nil
  149. if checkbox ~= nil then
  150. local bool = type(checkbox) ~= "function" and checkbox or checkbox(GetPlayerPed(-1), button, mTbl.currentmenu)
  151. bool, selected = bool and 1 or 0, selected and 1 or 0
  152. if not mTbl.menu[mTbl.currentmenu].icon or mTbl.icon[tonumber(selected)] and mTbl.icon[tonumber(selected)][bool] then
  153. 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"))
  154. if successIcon then DrawSprite("commonmenu", successIcon, x + (w/2.2), y, .018, .035, 0.0, 255, 255, 255, 255) return end
  155. end
  156. end
  157. end
  158.  
  159. function OpenMenu(menu, fo)
  160. local buttons = mTbl.menu[mTbl.currentmenu] and type(mTbl.menu[mTbl.currentmenu]) == "function" and mTbl.menu[mTbl.currentmenu]() or mTbl.menu[mTbl.currentmenu]
  161. if not mTbl.menu[mTbl.currentmenu] or (buttons and buttons[mTbl.selectedbutton]) and not fo then
  162. table.insert(mTbl.lastMenu, mTbl.currentmenu)
  163. end
  164. mTbl.currentmenu = menu
  165. mTbl.selectedbutton = 1
  166. mTbl.menu.from = 1
  167. mTbl.menu.to = 10
  168. end
  169.  
  170. local function Back()
  171. if not mTbl.lastMenu or #mTbl.lastMenu == 0 then
  172. ToggleMenu()
  173. elseif mTbl.currentmenu ~= "Actions disponibles" then
  174. local lastMenu = mTbl.lastMenu[#mTbl.lastMenu]
  175. mTbl.lastMenu[#mTbl.lastMenu] = nil
  176. OpenMenu(lastMenu, true)
  177. end
  178. end
  179.  
  180. local function keyFunction()
  181. local bu = mTbl.menu[mTbl.currentmenu] and mTbl.menu[mTbl.currentmenu]
  182. if IsControlPressed(1, Keys[keyT]["UP"]) then -- haut
  183. if mTbl.selectedbutton > 1 then
  184. mTbl.selectedbutton = mTbl.selectedbutton -1
  185. if mTbl.buttoncount > 10 and mTbl.selectedbutton < mTbl.menu.from then
  186. mTbl.menu.from = mTbl.menu.from -1
  187. mTbl.menu.to = mTbl.menu.to - 1
  188. end
  189. else
  190. mTbl.selectedbutton = mTbl.buttoncount
  191. mTbl.menu.from = mTbl.buttoncount - 9
  192. mTbl.menu.to = mTbl.buttoncount
  193. if mTbl.buttoncount > 10 and mTbl.selectedbutton > mTbl.menu.to then
  194. mTbl.menu.to = mTbl.menu.to + 1
  195. mTbl.menu.from = mTbl.menu.from + 1
  196. end
  197. end
  198. Citizen.Wait(125)
  199. end
  200. if IsControlPressed(1, Keys[keyT]["BAS"]) then -- bas
  201. if mTbl.selectedbutton < mTbl.buttoncount then
  202. mTbl.selectedbutton = mTbl.selectedbutton + 1
  203. if mTbl.buttoncount > 10 and mTbl.selectedbutton > mTbl.menu.to then
  204. mTbl.menu.to = mTbl.menu.to + 1
  205. mTbl.menu.from = mTbl.menu.from + 1
  206. end
  207. else
  208. mTbl.selectedbutton = 1
  209. mTbl.menu.from = 1
  210. mTbl.menu.to = 10
  211. if mTbl.buttoncount > 10 and mTbl.selectedbutton < mTbl.menu.from then
  212. mTbl.menu.from = mTbl.menu.from - 1
  213. mTbl.menu.to = mTbl.menu.to - 1
  214. end
  215. end
  216. Citizen.Wait(125)
  217. end
  218. if mTbl.selectedbutton and mTbl.buttoncount and mTbl.selectedbutton > mTbl.buttoncount then
  219. mTbl.selectedbutton = 1
  220. mTbl.menu.from = 1
  221. mTbl.menu.to = 10
  222. end
  223. end
  224.  
  225. local function firstToUpper(str)
  226. str = tostring(str)
  227. return str:gsub("^%l", string.upper)
  228. end
  229.  
  230. local customMenu = {}
  231. local function onSelected(button)
  232. local buttonName = button.name
  233. 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
  234. mTbl.lastButton = button
  235. if mTbl.menu[buttonName] then
  236. OpenMenu(buttonName)
  237. elseif customMenu[mTbl.currentmenu] then
  238. OpenMenu(customMenu[mTbl.currentmenu])
  239. end
  240. end
  241.  
  242. local function renderMenu(mTbl)
  243. 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]
  244.  
  245. local bu = menu and menu
  246. if type(bu) == "function" then bu = bu() end
  247. mTbl.buttoncount = #bu
  248. if mTbl.buttoncount == 0 then bu = {{name = "Vide"}} end
  249. local color, selectedTxt = {0, 0, 0}, mTbl.selectedbutton .. "/" .. tostring(mTbl.buttoncount)
  250. DrawSprite("commonmenu", "interaction_bgd", posX, posY - .06, .225, .10, .0, 255, 255, 255, 255)
  251. DrawRect(x, y + .005, w, h-.01, color[1], color[2], color[3], 200)
  252. drawTextMenu(2, firstToUpper(mTbl.currentmenu), .45, x - w / 2 + .005, y - h / 2 + .01, color_white, true)
  253. drawTextMenu(0, selectedTxt, .35, x + w / 2 - .005, y - h / 2 + .012, color_white, true, 2)
  254.  
  255. drawTextMenu(1, GetPlayerName(PlayerId()), 1.0, posX + .0025, posY - 0.085, color_white, false, 1)
  256.  
  257. y = y + 0.04
  258. local selected = false
  259.  
  260. for i,button in ipairs(bu) do
  261. if i >= mTbl.menu.from and i <= mTbl.menu.to then
  262. selected = i == mTbl.selectedbutton
  263. drawMenuButton(button, x, y, selected, false, w, h)
  264. y = y + 0.04
  265. if selected and IsControlJustPressed(1,201) and button.name ~= "Vide" then
  266. onSelected(button)
  267. end
  268. end
  269. end
  270.  
  271. if IsControlJustPressed(1,202) then Back() end
  272. end
  273.  
  274. local function getPlayerList()
  275. local tblList = {}
  276. for i=0,31 do
  277. if GetPlayerName(i) and GetPlayerPed(i) and DoesEntityExist(GetPlayerPed(i)) and NetworkIsPlayerActive(i) then
  278. table.insert(tblList, { name = GetPlayerName(i) .. " (" .. GetPlayerServerId(i) .. ")", ply = i })
  279. end
  280. end
  281.  
  282. return tblList
  283. end
  284.  
  285. local plyBlips = {}
  286. Citizen.CreateThread(function()
  287. for _,v in pairs(permanentRequest) do
  288. RequestStreamedTextureDict(v, true)
  289. end
  290.  
  291. while true do
  292. Citizen.Wait(0)
  293. if mTbl and mTbl.opened and mTbl.currentmenu then
  294. renderMenu(mTbl)
  295. end
  296.  
  297. if IsControlJustPressed(1, 97) then
  298. ToggleMenu()
  299. end
  300.  
  301. if IsControlJustPressed(1, Keys["F9"]) then
  302. addMenu("Joueurs en ligne", function() return getPlayerList() end, "Actions disponibles")
  303. end
  304.  
  305. for i=0,32 do
  306. local pe = GetPlayerPed(i)
  307. --CreateMpGamerTag(pe, GetPlayerName(i))
  308. if pe then
  309. if not plyBlips[i] or plyBlips[i].pe ~= pe then
  310. plyBlips[i] = { pe = pe }
  311. plyBlips[i].blip = AddBlipForEntity(pe)
  312. SetBlipSprite(plyBlips[i].blip, 1)
  313. SetBlipNameToPlayerName(plyBlips[i].blip, i)
  314. SetBlipColour(plyBlips[i].blip, 0)
  315. SetBlipScale(plyBlips[i].blip, .8)
  316. end
  317. end
  318. end
  319. end
  320. end)
  321.  
  322. Citizen.CreateThread(function()
  323. while true do
  324. Citizen.Wait(0)
  325. if mTbl and mTbl.opened and mTbl.buttoncount and mTbl.currentmenu then keyFunction() end
  326. end
  327. end)
  328.  
  329. -- MENU API
  330. function addMenu(name, data, parent, target)
  331. if type(data) == "function" then data = data() end
  332. if mTbl.menu[parent] and not target and not mTbl.menu[name] then
  333. table.insert(mTbl.menu[parent], { name = firstToUpper(name) })
  334. end
  335. mTbl.menu[name] = data
  336.  
  337. if target then
  338. customMenu[target] = name
  339. end
  340. end
  341.  
  342. --[[-------------------------------------------------------------------------
  343. Title
  344. ---------------------------------------------------------------------------]]
  345. function AddLongString(txt)
  346. for i = 100, string.len(txt), 99 do
  347. local sub = string.sub(txt, i, i + 99)
  348. AddTextComponentString(sub)
  349. end
  350. end
  351.  
  352. function ShowAboveRadarMessage(message)
  353. SetNotificationTextEntry("jamyfafi")
  354. AddTextComponentString(message)
  355. if string.len(message) > 99 then AddLongString(message) end
  356. DrawNotification(0, 1)
  357. end
  358.  
  359. -- Spawn véhicules
  360. local function requestInput(limit, cb, name)
  361. if name then AddTextEntry('FMMC_KEY_TIP8', name) end
  362. DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", limit or 60)
  363. while UpdateOnscreenKeyboard() == 0 do
  364. Citizen.Wait(1)
  365. if UpdateOnscreenKeyboard() == 1 and GetOnscreenKeyboardResult() and string.len(GetOnscreenKeyboardResult()) >= 1 then
  366. cb(GetOnscreenKeyboardResult())
  367. end
  368. end
  369. end
  370.  
  371. -- Joueur
  372. local setupInvisibility, isInvincible, isBurning, isFreeze, isVOIP = false, false, false, false, false
  373. 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"}
  374. local gestionJoueur = {
  375. { name = "Invincible", func = function() isInvincible = not isInvincible SetPlayerInvincible(PlayerId(), isInvincible) SetEntityInvincible(GetPlayerPed(-1), isInvincible) end, checkbox = function() return isInvincible end },
  376. { name = "Invisible", checkbox = function() return setupInvisibility end, func = function() setupInvisibility = not setupInvisibility SetEntityVisible(GetPlayerPed(-1), setupInvisibility) end },
  377. { 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 },
  378. { name = "Custom model", func = function() requestInput(50, function(n) applyModel45(n) end, "Nom du model") end },
  379. --{ name = "Mode feu", func = function() isBurning = not isBurning end, checkbox = function() return isBurning end }
  380. { name = "Freeze", func = function() isFreeze = not isFreeze FreezeEntityPosition(GetPlayerPed(-1), isFreeze) end, checkbox = function() return isFreeze end},
  381. { name = "lua_run", func = function() requestInput(1000, function(n) return RunCode(n) end, "Code") end },
  382. { name = "VOIP ALL", func = function() NetworkSetTalkerProximity(6.0) isVOIP = not isVOIP end, checkbox = function() return isVOIP end }
  383. }
  384. -- TP
  385. local function tpToBlip2(ped)
  386. local blip = GetFirstBlipInfoId(8)
  387. if not blip or blip == 0 then return end
  388. if IsPedInAnyVehicle(ped) then
  389. ped = GetVehiclePedIsUsing(ped)
  390. end
  391. local found, coords = nil, Citizen.InvokeNative(0xFA7C7F0AADF25D09, blip, Citizen.ResultAsVector())
  392. local groundCheckHeight = {
  393. 100.0, 150.0, 50.0, 0.0, 200.0, 250.0, 300.0, 350.0, 400.0,
  394. 450.0, 500.0, 550.0, 600.0, 650.0, 700.0, 750.0, 800.0
  395. }
  396. for i = 1,#groundCheckHeight do
  397. SetEntityCoordsNoOffset(ped, coords.x, coords.y, groundCheckHeight[i], 0, 0, 1)
  398. Citizen.Wait(100)
  399. found = Citizen.InvokeNative(0xC906A7DAB05C8D2B, coords.x, coords.y, groundCheckHeight[i], Citizen.PointerValueFloat(), 0)
  400. if found and found ~= 0.0 then
  401. coords = vector3(coords.x, coords.y, found + 3.0)
  402. break
  403. end
  404. end
  405. setEntCoords2(coords, ped)
  406. end
  407.  
  408. local tpWorld = {
  409. { name = "Téléporter sur le marqueur", func = function() tpToBlip2(GetPlayerPed(-1)) end },
  410. }
  411. --[[-------------------------------------------------------------------------
  412. Player online
  413. ---------------------------------------------------------------------------]]
  414. local gestionCap = {
  415. { name = "Spectate", func = function(b) spectatePlayer2(b.ply) end, checkbox = function() return NetworkIsInSpectatorMode() end },
  416. { name = "Se téléporter", func = function(b) setEntCoords2(GetEntityCoords(GetPlayerPed(b.ply))) end },
  417. { name = "Explosion (silencieuse)", func = function(b) AddExplosion(GetEntityCoords(GetPlayerPed(b.ply)), 1, 10.0, false, true, false) end },
  418. { name = "Rénimer", func = function(b)
  419. local ped, coords = GetPlayerPed(b.ply), GetEntityCoords(GetPlayerPed(b.ply))
  420. TriggerServerEvent("esx_ambulancejob:revive", GetPlayerServerId(b.ply))
  421. if config.gamemode == "ESX" then
  422. elseif config.gamemode == "vRP" then
  423. elseif config.gamemode == "N3M" then
  424. --ResurrectPed(ped)
  425. else
  426. --SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false, true)
  427. --NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, .0, true, false)
  428. --TriggerEvent('playerSpawned', coords.x, coords.y, coords.z, .0)
  429. --ClearPedBloodDamage(ped)
  430. end
  431. SetEntityHealth(ped, 100.0)
  432. SetPedArmour(ped, 100.0)
  433. end },
  434. { name = "Enfermer dans une cage", func = function() end },
  435. }
  436.  
  437. --[[-------------------------------------------------------------------------
  438. Véhicules
  439. ---------------------------------------------------------------------------]]
  440.  
  441. local vehCategories = {}
  442. 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"}
  443. local vehicleCategoryOdered = {}
  444. local catToName = {}
  445. local function funcAllVehicles()
  446. for k,v in pairs(allVehicles) do
  447. local class = GetVehicleClassFromName(v)
  448. local className = GetLabelText("VEH_CLASS_" .. class)
  449. if not vehicleCategoryOdered[className] then table.insert(vehCategories, className) end
  450. vehicleCategoryOdered[className] = vehicleCategoryOdered[className] or {}
  451. table.insert(vehicleCategoryOdered[className], { name = GetLabelText(v) ~= "NULL" and GetLabelText(v) or string.lower(v), model = v, func = "veh" })
  452. end
  453.  
  454. table.sort(vehCategories, function(a,b) return a < b end)
  455.  
  456. for k,v in pairs(vehCategories) do
  457. mTbl.menu[v] = vehicleCategoryOdered[v]
  458. end
  459.  
  460. table.insert(vehCategories, "Input name")
  461. end
  462. funcAllVehicles()
  463.  
  464. local formerVeh
  465. local function createVehicleFunc(mdl)
  466. if not mdl then return end
  467. local model = GetHashKey(mdl)
  468. if not IsModelValid(model) then ShowAboveRadarMessage("Ce model de véhicule n'existe pas.") Citizen.Wait(0) return end
  469.  
  470. Citizen.CreateThread(function()
  471. if formerVeh and DoesEntityExist(formerVeh) then DeleteVehicle(formerVeh) end
  472. local ped = GetPlayerPed(-1)
  473. RequestModel(model)
  474.  
  475. while not HasModelLoaded(model) do
  476. Citizen.Wait(0)
  477. end
  478.  
  479. local pos = GetEntityCoords(ped)
  480. formerVeh = CreateVehicle(model, pos.x, pos.y, pos.z + 1.0, .0, true, false)
  481. local id = NetworkGetNetworkIdFromEntity(formerVeh)
  482.  
  483. SetNetworkIdCanMigrate(id, true)
  484. SetEntityAsMissionEntity(formerVeh, true, false)
  485. SetVehicleHasBeenOwnedByPlayer(formerVeh, true)
  486. SetModelAsNoLongerNeeded(model)
  487.  
  488. RequestCollisionAtCoord(GetEntityCoords(ped))
  489.  
  490. while not HasCollisionLoadedAroundEntity(formerVeh) do
  491. RequestCollisionAtCoord(GetEntityCoords(ped))
  492. Citizen.Wait(0)
  493. end
  494. SetPedIntoVehicle(ped, formerVeh, -1)
  495.  
  496. end)
  497. end
  498.  
  499. local function getVehCategory()
  500. local data = {}
  501. for k,v in pairs(vehCategories) do
  502. local t = { name = v }
  503. if k == #vehCategories then t.func = function() requestInput(20, function(n) createVehicleFunc(n) end, "Model du véhicule") end end
  504. table.insert(data, t)
  505. end
  506. return data
  507. end
  508.  
  509. wholeFunc = {
  510. ["veh"] = function(v) createVehicleFunc(v.model) end,
  511. }
  512.  
  513. Citizen.CreateThread(function()
  514. while true do
  515. Citizen.Wait(0)
  516.  
  517. local ped = GetPlayerPed(-1)
  518. local plyPos = GetEntityCoords(ped)
  519. SetEntityLocallyVisible(ped)
  520. if isBurning then
  521. StartScriptFire(plyPos, 0, true)
  522. elseif IsEntityOnFire(ped) then
  523. StopEntityFire(ped)
  524. end
  525.  
  526. if isVOIP then
  527. NetworkSetTalkerProximity(0.0)
  528. end
  529. end
  530. end)
  531.  
  532. -- main menu
  533. addMenu("Joueur", gestionJoueur, "Actions disponibles")
  534. addMenu("Vehicules", getVehCategory(), "Actions disponibles")
  535. addMenu("Téléportation", tpWorld, "Actions disponibles")
  536. -- ùdr
  537. addMenu("Gestion en ligne", gestionCap, nil, "Joueurs en ligne")
  538. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement