mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Implemented adding chat suggestions, closes #512
This commit is contained in:
@@ -328,6 +328,15 @@ AddEventHandler('esx:createMissingPickups', function(missingPickups)
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:registerSuggestions')
|
||||
AddEventHandler('esx:registerSuggestions', function(registeredCommands)
|
||||
for name,command in pairs(registeredCommands) do
|
||||
if command.suggestion then
|
||||
TriggerEvent('chat:addSuggestion', ('/%s'):format(name), command.suggestion.help, command.suggestion.arguments)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:removePickup')
|
||||
AddEventHandler('esx:removePickup', function(id)
|
||||
ESX.Game.DeleteObject(pickups[id].obj)
|
||||
|
||||
Reference in New Issue
Block a user