[Help] Use Special Abilities on server?

Is it possible to use the Special Abilities within a FiveM server? I haven’t been able to find any answers/questions about this so far.

It’s particularly Franklin’s ability that I want to use.

I tried creating this script, maybe it’s a complete miss:

Citizen.CreateThread(
    function()
        while true do
            Citizen.Wait(0)
            local playerPed = GetPlayerPed(-1)
            local vehicle = GetVehiclePedIsIn(playerPed, false)
            -- Set player model to Franklin and unlock Special Ability
            if IsControlJustReleased(0, 246) and IsControlPressed(0, 131) then
                local hash = GetHashKey("player_one")
                while not HasModelLoaded(hash) do
                    RequestModel(hash)
                    Citizen.Wait(0)
                end
                SetPlayerModel(PlayerId(), hash)
                SpecialAbilityUnlock(hash)
                SetModelAsNoLongerNeeded(hash)

                print("Special unlocked: " .. tostring(IsSpecialAbilityUnlocked()))
                print("Special enabled: " .. tostring(IsSpecialAbilityEnabled()))
                print("Special active: " .. tostring(IsSpecialAbilityActive()))
            elseif IsControlJustReleased(0, 246) then
                EnableSpecialAbility(playerPed, true)
                SetVehicleHudSpecialAbilityBarActive(vehicle, true)
                SpecialAbilityChargeLarge(playerPed, true, true)
                SpecialAbilityFillMeter(playerPed, true)

                print("Special unlocked: " .. tostring(IsSpecialAbilityUnlocked()))
                print("Special enabled: " .. tostring(IsSpecialAbilityEnabled()))
                print("Special active: " .. tostring(IsSpecialAbilityActive()))
            elseif IsControlJustReleased(0, 182) then
                SpecialAbilityDeactivate(playerPed)
                print("Special unlocked: " .. tostring(IsSpecialAbilityUnlocked()))
                print("Special enabled: " .. tostring(IsSpecialAbilityEnabled()))
                print("Special active: " .. tostring(IsSpecialAbilityActive()))
            end
        end
    end
)

Any help is greatly appreciated.

Bump
IsSpecialAbilityUnlocked(), IsSpecialAbilityEnabled() and IsSpecialAbilityActive() all return false

You can’t. Online wasn’t designed with that as a thing. The natives for special abilities is just for rocket vehicles more or less

Oh, that’s disappointing :confused: . Thanks for the answer.

1 Like

To enable franklin slo-mo

SetSpecialAbility(PlayerId(), 2, 0)
SpecialAbilityActivate(PlayerId(), 2)

to disable:

SetSpecialAbility(PlayerId(), 3, 0)
SpecialAbilityActivate(PlayerId(), 3)

seems to work for me!

1 Like

Well I got a car in my fivem server that has a nitro speciality and idk what line of code that could be to remove it, since its OP as hell on the server.