mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-18 06:16:02 +01:00
Fixed errors to pay commands
This commit is contained in:
@@ -53,18 +53,29 @@ end
|
|||||||
|
|
||||||
if config["pay"] then
|
if config["pay"] then
|
||||||
RegisterCommand("pay", function(source, args, rawCommand)
|
RegisterCommand("pay", function(source, args, rawCommand)
|
||||||
local player = source
|
local player = source
|
||||||
local target = tonumber(args[1])
|
local target = tonumber(args[1])
|
||||||
local amount = tonumber(args[2])
|
local amount = tonumber(args[2])
|
||||||
NDCore.Functions.TransferBank(amount, player, target)
|
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, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
if config["give"] then
|
if config["give"] then
|
||||||
RegisterCommand("give", function(source, args, rawCommand)
|
RegisterCommand("give", function(source, args, rawCommand)
|
||||||
local player = source
|
local player = source
|
||||||
local amount = tonumber(args[2])
|
local amount = tonumber(args[1])
|
||||||
NDCore.Functions.GiveCashToNearbyPlayer(player, amount)
|
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, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user