-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathserver.lua
41 lines (36 loc) · 1.21 KB
/
server.lua
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
lib.addCommand('freeze', {
help = 'Freeze the player',
params = {
{
name = 'target',
type = 'playerId',
help = 'Target player\'s server id',
},
},
restricted = 'group.admin'
}, function(source, args, raw)
local entity = GetPlayerPed(args.target)
if entity ~= 0 then
TriggerClientEvent('ox_commands:freeze', args.target, true, true)
return TriggerClientEvent('ox_commands:notify', source, { type = 'success', description = 'success' })
end
lib.notify(source, { type = 'error', description = 'invalid_target' })
end)
lib.addCommand('thaw', {
help = 'Unfreeze the player',
params = {
{
name = 'target',
type = 'playerId',
help = 'Target player\'s server id',
},
},
restricted = 'group.admin'
}, function(source, args, raw)
local entity = GetPlayerPed(args.target)
if entity ~= 0 then
TriggerClientEvent('ox_commands:freeze', args.target, false, true)
return TriggerClientEvent('ox_commands:notify', source, { type = 'success', description = 'success' })
end
lib.notify(source, { type = 'error', description = 'invalid_target' })
end)