Common Issue

To fix common issue by respawning, weapon loadout, etc.

Most issue can fix by clamp any script with ArenaAPI exportarrow-up-right This example try to clamp custom roleplay revive script by add ArenaAPI:IsPlayerInAnyArena() And also work with custom HUD like block weapon hotbar or speedo.

Citizen.CreateThread(fuunction()
    while true do
        if not exports.ArenaAPI:IsPlayerInAnyArena() then -- Don't check player dead while in lobby game
            if IsPedDeadOrDying(PlayerPedId()) then
                IsDeath = true
            end
        end
        Citizen.Wait(0)
    end
end)
Citizen.CreateThread(fuunction()
    while true do
        if not exports.ArenaAPI:IsPlayerInAnyArena() then -- Don't toggle speedo  while in lobby game
            if IsPedInAnyVehicle(PlayerPedId(), false)
                ShowSpeedo()
            else
                HideSpeedo()
            end
        end
        Citizen.Wait(0)
    end
end)

Custom Death Script

When your custom death script triggered it can block your client input or play screen effect that can make lobby game unplayable.

1

For example it's a script called qb-ambulancejobarrow-up-right

2

Find how is dead can triggered

Most script using isDead = truearrow-up-right

It is in function OnDeath() then find how it triggerarrow-up-right

3

Clamp trigger by using ArenaAPI

Learn by look at the code patten on code highlighting.

es_extended/blob/master/client/modules/death.luaarrow-up-right

esx_ambulancejob/client/main.luaarrow-up-right

vMenu

For vMenuarrow-up-right you need to make Respawn As Default MP Character to disable by default. Because it make you respawn out side vehicle. Set server command. (vMenu/config/permissions.cfg)

basic-gamemode

For game basic-gamemodearrow-up-right disable auto respawn. In [script_name]/config/client/event.lua

Custom Weapon Loadout

Some of roleplay base script has a custom weapon loadout that can make in lobby weapon disappear. You need to find how that script remove your weapon from game lobby.

1

For example it's a script called ox_inventoryarrow-up-right

Search for all files find something like RemoveWeaponFromPed or RemoveAllPedWeapons that is how the script can remove your weapon.

ox_inventory /client.lua:537arrow-up-right

ox_inventory /client.lua:1539arrow-up-right

ox_inventory/modules/weapon /client.lua:134arrow-up-right

Custom HUD

In [script_name]/config/client/event.lua you can put this event to any your scripts to do some thing when lobby started and ended like hide roleplay HUD.

Last updated