We’ve -ed another update to FiveM production.
Summarized changelog
- There’s an option to select a custom port for the ‘Localhost’ button, thanks to @Disquse
- The ‘Direct connect’ tab now automatically saves the last server connected to. Thanks to @Disquse and michaelcerne for prototyping this!
- Support for minimap GFx overlays. See the example code below, it’s pending integration in the formal documentation site when that’s done.
- Support for a
populationPedCreating
event to allow manipulating population from script. - Mitigate servers running on low
numfile
ulimit values crashing by no longer trying to request/info.json
on clients. - Minor performance improvements and other fixes.
GFx overlays
local overlay = AddMinimapOverlay('popup_warning.gfx')
RequestStreamedTextureDict('popup_warning')
while (not HasMinimapOverlayLoaded(overlay)) or (not HasStreamedTextureDictLoaded('popup_warning')) do
Wait(0)
end
Wait(1500)
CallMinimapScaleformFunction(overlay, 'SHOW_POPUP_WARNING')
PushScaleformMovieFunctionParameterFloat(500.0)
PushScaleformMovieFunctionParameterString("ALERT")
PushScaleformMovieFunctionParameterString("wew")
PushScaleformMovieFunctionParameterString("~r~wtf")
PushScaleformMovieFunctionParameterBool(true)
PushScaleformMovieFunctionParameterInt(0)
PopScaleformMovieFunctionVoid()
-- overlayID, x, y, xscale, yscale, alpha
SetMinimapOverlayDisplay(overlay, -3000.0, -3000.0, 100.0, 100.0, 80.0)
-- resource.lua
file 'popup_warning.gfx' -- copy this from scaleform RPFs in the game folder to the resource
Population interception
CreateThread(function()
RequestModel('s_m_y_cop_01')
end)
AddEventHandler('populationPedCreating', function(x, y, z, model, setters)
Citizen.Trace(('making cop at %s %s %s plus a bit (was %s)\n'):format(tostring(x), tostring(y), tostring(z), tostring(model)))
setters.setModel('s_m_y_cop_01') -- you can use a hash as well
setters.setPosition(x, y, z + 5.5)
-- you can also CancelEvent() to skip creating the ped
end)