diff --git a/ND_Chat/source/server.lua b/ND_Chat/source/server.lua index 4ed9b2c..1344c9b 100644 --- a/ND_Chat/source/server.lua +++ b/ND_Chat/source/server.lua @@ -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 + TriggerClientEvent('chatMessage', source, '^1ERROR: Wrong usage. /pay ') + 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 + TriggerClientEvent('chatMessage', source, '^1ERROR: Wrong usage. /give ') + end end, false) end