Hi! I want to log when an admin uses ClearPedTasks. When I created a function it didn’t work. Is there any event or something? Thanks
hello did you find something ?
Well, where do admins use ClearPedTasks
? Should be a menu right? Just implement a logging function whenever they click to use ClearPedTasks
You need to intercept the event on the server, here’s an example (you would put this on a server script):
AddEventHandler('clearPedTasksEvent', function(sender, ev)
Citizen.Trace("Player: " .. GetPlayerName(sender) .. " used clearPedTasks.")
Citizen.Trace("Ped ID: " .. ev.pedId .. " Immediately: " .. tostring(ev.immediately))
-- Cancel the event if you want by uncommenting the line below
-- CancelEvent()
end)
The event will only be dispatched if CLEAR_PED_TASKS
is executed on remote network objects (network objects that aren’t owned by you).