QbCore AmbulanceJob

QbCore AmbulanceJob

Integrating statebag with QBcore Ambulancejob

This section uses statebag to ensure proper handling of the player’s state within the BattleRoyale. If you are unfamiliar with statebag or how to use it, please refer to the dedicated page that explains its usage.

If you're using the QBcore ambulancejob script, follow these steps to integrate the arena handling:

  1. Open the dead.lua file located in the client folder.

  2. Find the following line:

    Copy

     if not IsEntityAPed(victim) then return end 
  3. Directly below this line, add the following code:

    Copy

    if LocalPlayer.state.inRoyale then return end
  4. This ensures that the script does not handle reviving players inside the arena.

Next, open the main.lua file and locate the ApplyImmediateEffects function.

Inside this function, find the following line:

Copy

local armor = GetPedArmour(ped)
  1. Directly below it, insert:

    Copy

    if LocalPlayer.state.inRoyale then return end

    This modification prevents the application of any immediate effects if the player is inside the BattleRoyale

Atualizado