Skip to content

Instantly share code, notes, and snippets.

View throwarray's full-sized avatar
💭
(╯°□°)╯︵ [ ]

throwarray

💭
(╯°□°)╯︵ [ ]
View GitHub Profile
function LoadAnimationDictionary(animationD)
RequestAnimDict(animationD)
while not HasAnimDictLoaded(animationD) do
Citizen.Wait(1)
end
end
function RequestTextureDictionary (dict)
RequestStreamedTextureDict(dict)
local setGear = GetHashKey('SET_VEHICLE_CURRENT_GEAR') & 0xFFFFFFFF
local function SetVehicleCurrentGear(veh, gear)
Citizen.InvokeNative(setGear, veh, gear)
end
local nextGear = GetHashKey('SET_VEHICLE_NEXT_GEAR') & 0xFFFFFFFF
local function SetVehicleNextGear(veh, gear)
Citizen.InvokeNative(nextGear, veh, gear)
end
local function LoadScaleform(scaleform)
local scaleform = RequestScaleformMovie(scaleform)
if scaleform ~= 0 then
while not HasScaleformMovieLoaded(scaleform) do
Citizen.Wait(0)
end
end
return scaleform
end
@throwarray
throwarray / mugroom.lua
Created July 21, 2018 19:09
mugroom.lua
local function CreateNamedRenderTargetForModel(name, model)
local handle = 0
if not IsNamedRendertargetRegistered(name) then
RegisterNamedRendertarget(name, 0)
end
if not IsNamedRendertargetLinked(model) then
LinkNamedRendertarget(model)
end
if IsNamedRendertargetRegistered(name) then
handle = GetNamedRendertargetRenderId(name)
Citizen.CreateThread(function ()
local context = GetHashKey("MINI_PROSTITUTE_LOW_RESTRICTED_PASSENGER")
while true do
ped = PlayerPedId()
vehicle = GetVehiclePedIsIn(ped, false)
-- Ped is in vehicle
if DoesEntityExist(vehicle) then
local engine = GetIsVehicleEngineRunning(vehicle)
function LoadModel (model)
if not IsModelInCdimage(model) then return end
RequestModel(model)
while not HasModelLoaded(model) do Citizen.Wait(0) end
return model
end
local weapons = {}
function headsUp(text)
SetTextComponentFormat('STRING')
AddTextComponentString(text)
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
end
function RestoreAmmoForWeapon (weapons, weapon, waitTime)
local playerPed = PlayerPedId()