2

Hey there i have a question, i work on a panic button on fivem.

It works fine but how can i limit it that only certain jobs can really trigger that triggerServerEvent which triggers the dispatch to be send?

RegisterNetEvent("panicbuttonaj")
AddEventHandler("panicbuttonaj", function()
    


     local playerPos = GetEntityCoords(PlayerPedId()) 
                TriggerServerEvent(
                    "core_dispatch:addCall",
                    "10-90", -- Change to your liking
                    "Panicbutton", -- Change to your liking
                    {{icon = "fa-triangle-exclamation", info = 'Es wurde ein Panicbutton betÃĪtigt!'}}, -- FontAwesome Icon that shows in /dispatch
                    {playerPos[1], playerPos[2], playerPos[3]}, -- Grabs player position for alert, change if function already contains this.
                    "police", -- Job receiving alert
                    5000, -- Time alert stays on screen
                    140, -- Blip Icon
                    1 -- Blip Color
                )



end)

0 Answers0