Skip to content

Commit

Permalink
feat: optional playerId of givekeys command (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
artur-michalak authored Jun 17, 2024
1 parent 1fabd0b commit 1b210e1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ lib.addCommand(locale('addcom.givekeys'), {
name = locale('addcom.givekeys_id'),
type = 'playerId',
help = locale('addcom.givekeys_id_help'),
optional = true
},
{
name = locale('addcom.givekeys_plate'),
Expand All @@ -29,10 +30,6 @@ lib.addCommand(locale('addcom.givekeys'), {
restricted = false,
}, function (source, args)
local id = args[locale('addcom.givekeys_id')]
if id and not exports.qbx_core:GetPlayer(id) then
return exports.qbx_core:Notify(source, locale('notify.player_offline'), 'error')
end

TriggerClientEvent('qb-vehiclekeys:client:GiveKeys', source, id, args[locale('addcom.givekeys_plate')])
end)

Expand Down

0 comments on commit 1b210e1

Please sign in to comment.