forked from Simnation/Main
ed
This commit is contained in:
parent
84031a9c3f
commit
3cc1d14b39
91 changed files with 2596 additions and 2913 deletions
|
@ -0,0 +1,39 @@
|
|||
lib.addCommand('giveadminkey', {
|
||||
help = 'Gives an admin a key to any vehicle by plate',
|
||||
params = {
|
||||
{
|
||||
name = 'id',
|
||||
type = 'number',
|
||||
help = 'Player ID To Grant Key To',
|
||||
},
|
||||
{
|
||||
name = 'plate',
|
||||
type = 'string',
|
||||
help = 'Vehicle Plate Number',
|
||||
},
|
||||
},
|
||||
restricted = 'group.admin'
|
||||
}, function(source, args, raw)
|
||||
local src = source
|
||||
local plate = string.upper(args.plate)
|
||||
if not plate then return NotifyPlayer(src, locale("AdminCommands.NoVehicleNearby"), "error", 6000) end
|
||||
local target = tonumber(args.id)
|
||||
if not target then target = src end
|
||||
local pedId = GetPlayerPed(target)
|
||||
if pedId == 0 then return NotifyPlayer(src, locale("AdminCommands.NoPlayerWithID"), "error", 6000) end
|
||||
AddKeyByPlate(target, plate)
|
||||
NotifyPlayer(target, locale("AdminCommands.KeyGranted"), "success")
|
||||
end)
|
||||
|
||||
lib.addCommand('givenearbykey', {
|
||||
help = 'Gives an admin a key to the closest vehicle',
|
||||
restricted = 'group.admin'
|
||||
}, function(source, raw)
|
||||
local src = source
|
||||
local coords = GetEntityCoords(GetPlayerPed(src))
|
||||
local vehicle = lib.getClosestVehicle(coords, 5)
|
||||
if not vehicle then return NotifyPlayer(src, locale("AdminCommands.NoVehicleNearby"), "error", 6000) end
|
||||
local netId = NetworkGetNetworkIdFromEntity(vehicle)
|
||||
AddKeyByNetId(src, netId)
|
||||
NotifyPlayer(src, locale("AdminCommands.KeyGranted"), "success", 6000)
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue