This is my first ever NUI script for FiveM, and I’m very proud how this turned out.
The spawn selector can be used with these resolutions:
1920x1080 2440x1440 3840x2160
If you want to add more resolution supports, please do so.
I have no plans to update this script, but if there’s something scuffed, I’ll fix it.
A personal note to the one who’s gonna use this script:
Please do not remove the copyright, as this is something I’m proud of. I have set the color so low that it isn’t really possible to see the copyright, but please just leave it as it is.
The script is open for anyone who wants to change or do whatever you want to do with it.
Trigger this when you are spawning your character:
I have set this to my multicharacter, so whenever you have selected a character if you have a mulitcharacter ofc. For kashacters, the line you want to look after is in client and around at line 170.
For triggering the event. Please read what I write.
If you have an kashacters multichar system, something 80% of ESX servers run on, please go to line around 170, to you see the event handler that looks something like this:
RegisterNetEvent('characters_cl:SpawnCharacter')
AddEventHandler('characters_cl:SpawnCharacter', function(spawn, isnew)
TriggerServerEvent('es:firstJoinProper')
TriggerEvent('es:allowedToSpawn')
if isnew then
IsChoosing = false
SendNUIMessage({
action = "displayback"
})
SetTimecycleModifier('default')
camera()
else
SetTimecycleModifier('default')
local pos = spawn
Citizen.Wait(900)
exports.spawnmanager:setAutoSpawn(false)
TriggerServerEvent('sharp-logs:server')
TriggerEvent("DoLongHudText", "Skatt er for øyeblikket satt til: 0%", 1)
SHARPCore.TriggerServerCallback('sharp-skin:getPlayerSkin', function(skin, jobSkin)
if skin == nil then
TriggerEvent('skinchanger:loadSkin', {sex = 0})
TriggerEvent('sharp-skin:openSaveableMenu')
else
TriggerEvent('skinchanger:loadSkin', skin)
end
end)
TriggerEvent("spawnselector:setNui", spawn) -- THIS FIRES EVENT FOR SPAWNSELECT
IsChoosing = false
DisplayHud(true)
DisplayRadar(true)
Wait(500)
TriggerEvent('sharp-emote:loadData')
end
end)
end)```