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.
. Thanks for the answer.