Radio convars are placed in the server.cfg file located in your main directory. With these in the server.cfg, you are able to change the animation (from the default) during PTT.
For more informaion on FiveM server convars, see this CFX document. To browse GTA5 default animations that can be utilized in the below convars, visit this page.
setr scnp25:anim:aiming:anim "mic_chatter"
setr scnp25:anim:aiming:dict "mp_facial"
setr scnp25:anim:radio:anim "generic_radio_enter"
setr scnp25:anim:radio:dict "random@arrests"
setr scnp25:anim:vehicle:anim "generic_radio_enter"
setr scnp25:anim:vehicle:dict "random@arrests"
Server version must be R06.15.0 or higher for this feature.
If you’re a third-party developer building an animation menu to integrate with our system, or an end-user looking to connect with another third-party script, please refer to the example code below for guidance on how to hook into it. For specific information on each event please see the API Documentation.
TriggerEvent("radioExternal:setAnimHandler","handleRadioAnimation")
AddEventHandler("handleRadioAnimation",function(pttStatus,animationStarted)
print("Animation Start")
print("PTT Status: ["..pttStatus.."]")
if(pttStatus == "ptt")
-- Normal PTT, just do the radio emote
exports["rpemotes-reborn"]:EmoteCommandStart("radio")
elseif(pttStatus == "ptt_veh")
-- Make sure to salute if you're driving and talking on the radio
exports["rpemotes-reborn"]:EmoteCommandStart("salute")
elseif(pttStatus == "ptt_aim")
-- Make sure to shrug while aiming
exports["rpemotes-reborn"]:EmoteCommandStart("shrug")
elseif(pttStatus == "ptt_clear")
-- Clear animation when PTT is released
exports["rpemotes-reborn"]:EmoteCancel()
end
-- Send confirmation to SCN script
animationStarted()
end)
Server version must be R06.18.0 or higher for this feature.