Main/resources/[standalone]/utility_lib/client/native_min.lua

1 line
56 KiB
Lua
Raw Normal View History

2025-06-07 08:51:21 +02:00
_G["xPlayer"],_G["source"],_G["developer"]={},GetPlayerServerId(PlayerId()),function()end;local a,b,c,d,e,f,g,h,i,j,k,l,m,o,p,q,r,s,t=AddTextEntry,BeginTextCommandDisplayHelp,EndTextCommandDisplayHelp,SetNotificationTextEntry,AddTextComponentSubstringPlayerName,DrawNotification,GetEntityCoords,World3dToScreen2d,SetTextScale,SetTextFont,SetTextEntry,SetTextCentre,AddTextComponentString,DrawText,DoesEntityExist,GetDistanceBetweenCoords,GetPlayerPed,TriggerEvent,TriggerServerEvent;local u=GetCurrentResourceName()local v={["ESC"]=322,["F1"]=288,["F2"]=289,["F3"]=170,["F5"]=166,["F6"]=167,["F7"]=168,["F8"]=169,["F9"]=56,["F10"]=57,["~"]=243,["1"]=157,["2"]=158,["3"]=160,["4"]=164,["5"]=165,["6"]=159,["7"]=161,["8"]=162,["9"]=163,["-"]=84,["="]=83,["BACKSPACE"]=177,["TAB"]=37,["Q"]=44,["W"]=32,["E"]=38,["R"]=45,["T"]=245,["Y"]=246,["U"]=303,["P"]=199,["["]=39,["]"]=40,["ENTER"]=18,["CAPS"]=137,["A"]=34,["S"]=8,["D"]=9,["F"]=23,["G"]=47,["H"]=74,["K"]=311,["L"]=182,["LEFTSHIFT"]=21,["Z"]=20,["X"]=73,["C"]=26,["V"]=0,["B"]=29,["N"]=249,["M"]=244,[","]=82,["."]=81,["LEFTCTRL"]=36,["LEFTALT"]=19,["SPACE"]=22,["RIGHTCTRL"]=70,["HOME"]=213,["PAGEUP"]=10,["PAGEDOWN"]=11,["DELETE"]=178,["LEFT"]=174,["RIGHT"]=175,["TOP"]=27,["DOWN"]=173,["NENTER"]=201,["N4"]=108,["N5"]=60,["N6"]=107,["N+"]=96,["N-"]=97,["N7"]=117,["N8"]=61,["N9"]=118}DevModeStatus=false;UtilityLibLoaded=true;local w={Cache={PlayerPedId=PlayerPedId(),Marker={},Object={},Dialogue={},Blips={},N3d={},Events={},Guards={},Scenes={},SetData={},Frozen={},FlowDetector={},Textures={},Settings={},EntityStack={},Loop={},SliceGroups={}}}UtilityNet={}Citizen.CreateThreadNow(function()if UFAPI then if u=="utility_lib"then _G["Utility"]=w else _G["UtilityLibrary"]=w end else _G["Utility"]=w end end)UseDelete=function(x)w.Cache.Settings.UseDelete=x end;On=function(type,y,z)RegisterNetEvent("Utility:On:"..(z and"!"or"")..type)local A=AddEventHandler("Utility:On:"..(z and"!"or"")..type,y)table.insert(w.Cache.Events,A)return A end;_G.old_TaskVehicleDriveToCoord=TaskVehicleDriveToCoord;TaskVehicleDriveToCoord=function(ped,B,C,D,E)old_TaskVehicleDriveToCoord(ped,B,C,D or 10.0,0,GetEntityModel(B),2883621,E or 1.0)end;_G.old_DisableControlAction=DisableControlAction;DisableControlAction=function(F,G,H)H=H~=nil and H or true;if v[string.upper(F)]then return old_DisableControlAction(0,v[string.upper(F)],G)else return old_DisableControlAction(F,G,H)end end;DisableControlForSeconds=function(G,I)local J=I;Citizen.CreateThread(function()while J>0 do Citizen.Wait(1000)J=J-1 end;return end)Citizen.CreateThread(function()while J>0 do DisableControlAction(v[string.upper(G)])Citizen.Wait(1)end;return end)end;_G.old_IsControlJustPressed=IsControlJustPressed;IsControlJustPressed=function(K,L,M)if type(K)=="number"then local N=K;local G=L;return old_IsControlJustPressed(N,G)end;developer("^2Created^0","key map",K)local O="keyboard"K=K:lower()if K:find("mouse_")or K:find("iom_wheel")then O="mouse_button"elseif K:find("_index")then O="pad_digitalbutton"elseif K:find("iom_axis")then O="pad_axis"end;RegisterKeyMapping('utility '..u..' '..K,M or'',O,K)local P=nil;Citizen.CreateThread(function()Citizen.Wait(500)P=RegisterNetEvent("Utility:Pressed_"..u.."_"..K,L)table.insert(w.Cache.Events,P)end)end;ShowNotification=function(Q)d('STRING')e(Q)f(false,true)end;ButtonNotification=function(Q)if string.match(Q,"{.*}")then Q=string.multigsub(Q,{"{A}","{B}","{C}","{D}","{E}","{F}","{G}","{H}","{L}","{M}","{N}","{O}","{P}","{Q}","{R}","{S}","{T}","{U}","{V}","{W}","{X}","{Y}","{Z}"},{"~INPUT_VEH_FLY_YAW_LEFT~","~INPUT_SPECIAL_ABILITY_SECONDARY~","~INPUT_LOOK_BEHIND~","~INPUT_MOVE_LR~","~INPUT_CONTEXT~","~INPUT_ARREST~","~INPUT_DETONATE~","~INPUT_VEH_ROOF~","~INPUT_CELLPHONE_CAMERA_FOCUS_LOCK~","~INPUT_INTERACTION_MENU~","~INPUT_REPLAY_ENDPOINT~","~INPUT_FRONTEND_PAUSE~","~INPUT_FRONTEND_LB~","~INPUT_RELOAD~","~INPUT_MOVE_DOWN_ONLY~","~INPUT_MP_TEXT_CHAT_ALL~","~INPUT_REPLAY_SCREENSHOT~","~INPUT_NEXT_CAMERA~","~INPUT_MOVE_UP_ONLY~","~INPUT_VEH_HOTWIRE_LEFT~","~INPUT_VEH_DUCK~","~INPUT_MP_TEXT_CHAT_TEAM~","~INPUT_HUD_SPEC