local time = 1000 function loadModel(model) if not HasModelLoaded(model) then if Config.Debug then print("^5Debug^7: ^2Loading Model^7: '^6"..model.."^7'") end while not HasModelLoaded(model) do if time > 0 then time -= 1 RequestModel(model) else time = 1000 print("^5Debug^7: ^3LoadModel^7: ^2Timed out loading model ^7'^6"..model.."^7'") break end Wait(10) end end end function unloadModel(model) if Config.PrintDebug then print("^5Debug^7: ^2Removing Model^7: '^6"..model.."^7'") end SetModelAsNoLongerNeeded(model) end function makeProp(data, freeze, synced) loadModel(data.prop) local prop = CreateObject(data.prop, data.coords.x, data.coords.y, data.coords.z-1.03, synced or false, synced or false, false) SetEntityHeading(prop, data.coords.w) FreezeEntityPosition(prop, freeze or 0) if Config.PrintDebug then local coords = { string.format("%.2f", data.coords.x), string.format("%.2f", data.coords.y), string.format("%.2f", data.coords.z), (string.format("%.2f", data.coords.w or 0.0)) } print("^5Debug^7: ^1Prop ^2Created^7: '^6"..prop.."^7' | ^2Hash^7: ^7'^6"..(data.prop).."^7' | ^2Coord^7: ^5vec4^7(^6"..(coords[1]).."^7, ^6"..(coords[2]).."^7, ^6"..(coords[3]).."^7, ^6"..(coords[4]).."^7)") end return prop end function triggerNotify(title, message, type, src) if Config.Notify == "okok" then if not src then exports['okokNotify']:Alert(title, message, 6000, type) else TriggerClientEvent('okokNotify:Alert', src, title, message, 6000, type) end elseif Config.Notify == "qb" then if not src then TriggerEvent("QBCore:Notify", message, type) else TriggerClientEvent("QBCore:Notify", src, message, type) end elseif Config.Notify == "t" then if not src then exports['t-notify']:Custom({title = title, style = type, message = message, sound = true}) else TriggerClientEvent('t-notify:client:Custom', src, { style = type, duration = 6000, title = title, message = message, sound = true, custom = true}) end elseif Config.Notify == "infinity" then if not src then TriggerEvent('infinity-notify:sendNotify', message, type) else TriggerClientEvent('infinity-notify:sendNotify', src, message, type) end elseif Config.Notify == "rr" then if not src then exports.rr_uilib:Notify({msg = message, type = type, style = "dark", duration = 6000, position = "top-right", }) else TriggerClientEvent("rr_uilib:Notify", src, {msg = message, type = type, style = "dark", duration = 6000, position = "top-right", }) end elseif Config.Notify == "ox" then if not src then exports.ox_lib:notify({title = title, description = message, type = type or "success"}) else exports.ox_lib:notify({title = title, description = message, type = type or "success"}) end end end