Como instalar o Spawn Selector Pro
Etapa 1: Uso geral
- Arraste e solte o recurso chamado CL-SpawnSelectorPRO na pasta de recursos do seu servidor.
- Execute a tabela SQL chamada “cl_spawnselector”.
- Configure as permissões para o editor no arquivo config.lua.
- Ao criar um novo local usando o editor, certifique-se de adicionar os dados necessários ao config.lua em Config.Locations.
Etapa 2: Remover dependência
- Abra fxmanifest.lua no recurso qb-multicharacter.
- Remova a dependência de qb-spawn, normalmente encontrada na linha 36.
Etapa 3: Modificar a Prisão
- Navegue até o recurso qb-prison.
- Em qb-prison > client > main.lua, encontre o evento “prison:client:Enter” (Linha 207).
- Substitua o evento existente pelo evento atualizado fornecido abaixo:
RegisterNetEvent('prison:client:Enter', function(time)
local invokingResource = GetInvokingResource()
if invokingResource and invokingResource ~= 'CL-SpawnSelector' and invokingResource ~= 'qb-policejob' and invokingResource ~= 'qb-ambulancejob' and invokingResource ~= GetCurrentResourceName() then
-- Use QBCore.Debug here for a quick and easy way to print to the console to grab your attention with this message
QBCore.Debug({('Player with source %s tried to execute prison:client:Enter manually or from another resource which is not authorized to call this, invokedResource: %s'):format(GetPlayerServerId(PlayerId()), invokingResource)})
return
end
QBCore.Functions.Notify( Lang:t("error.injail", {Time = time}), "error")
TriggerEvent("chatMessage", "SYSTEM", "warning", "Your property has been seized, you'll get everything back when your time is up..")
DoScreenFadeOut(500)
while not IsScreenFadedOut() do
Wait(10)
end
local RandomStartPosition = Config.Locations.spawns[math.random(1, #Config.Locations.spawns)]
SetEntityCoords(PlayerPedId(), RandomStartPosition.coords.x, RandomStartPosition.coords.y, RandomStartPosition.coords.z - 0.9, 0, 0, 0, false)
SetEntityHeading(PlayerPedId(), RandomStartPosition.coords.w)
Wait(500)
TriggerEvent('animations:client:EmoteCommandStart', {RandomStartPosition.animation})
inJail = true
jailTime = time
local tempJobs = {}
local i = 1
for k in pairs(Config.Locations.jobs) do
tempJobs[i] = k
i += 1
end
currentJob = tempJobs[math.random(1, #tempJobs)]
CreateJobBlip(true)
TriggerServerEvent("prison:server:SetJailStatus", jailTime)
TriggerServerEvent("prison:server:SaveJailItems", jailTime)
TriggerServerEvent("InteractSound_SV:PlayOnSource", "jail", 0.5)
CreateCellsBlip()
Wait(2000)
DoScreenFadeIn(1000)
QBCore.Functions.Notify( Lang:t("error.do_some_work", {currentjob = Config.Jobs[currentJob] }), "error")
end)
Além disso, adicione and invokingResource ~= 'CL-SpawnSelector' para a linha 209.
Essas etapas devem garantir a instalação e integração adequadas do recurso CL-SpawnSelectorPRO no seu ambiente de servidor.




Avaliações
Não há avaliações ainda.