-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
25 lines (22 loc) · 1 KB
/
Copy pathserver.lua
File metadata and controls
25 lines (22 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
local ESX = exports['es_extended']:getSharedObject()
-- Register server event for help request
RegisterNetEvent('esl:requestHelp')
AddEventHandler('esl:requestHelp', function(helpType)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer then
MySQL.Async.execute('INSERT INTO ' .. Config.Database.TableName .. ' (player_id, help_type, request_time) VALUES (@player_id, @help_type, NOW())', {
['@player_id'] = xPlayer.identifier,
['@help_type'] = helpType
}, function(rowsChanged)
if rowsChanged > 0 then
print('Help request recorded for player ' .. xPlayer.identifier)
else
print('Failed to record help request for player ' .. xPlayer.identifier)
end
end)
end
end)
-- Command to open help menu
ESX.RegisterCommand('eslhelp', 'user', function(xPlayer, args, showError)
TriggerClientEvent('esl:openHelpMenu', xPlayer.source)
end, false, {help = 'Open Experience Studio Lite help menu'})