Fixed errors to pay commands

This commit is contained in:
BreezyTheDev
2022-08-18 09:40:11 -07:00
committed by GitHub
parent b90b6bc75d
commit d3bf85bd5b

View File

@@ -53,18 +53,29 @@ end
if config["pay"] then
RegisterCommand("pay", function(source, args, rawCommand)
local player = source
local target = tonumber(args[1])
local amount = tonumber(args[2])
NDCore.Functions.TransferBank(amount, player, target)
local player = source
local target = tonumber(args[1])
local amount = tonumber(args[2])
if target and amount ~= nil then
NDCore.Functions.TransferBank(amount, player, target)
else
-- Wrong syntax, it's /pay <id> <amount>
TriggerClientEvent('chatMessage', source, '^1ERROR: Wrong usage. /pay <id> <amount>')
end
end, false)
end
if config["give"] then
RegisterCommand("give", function(source, args, rawCommand)
local player = source
local amount = tonumber(args[2])
NDCore.Functions.GiveCashToNearbyPlayer(player, amount)
local amount = tonumber(args[1])
if amount ~= nil then
NDCore.Functions.GiveCashToNearbyPlayer(player, amount)
else
-- Wrong syntax, it's /give <amount>
TriggerClientEvent('chatMessage', source, '^1ERROR: Wrong usage. /give <amount>')
end
end, false)
end