Merge pull request #32 from BreezyTheDev/patch-1

feat(commands): /pay & /give
This commit is contained in:
Andyyy7666
2022-09-07 12:23:03 +02:00
committed by GitHub

View File

@@ -51,6 +51,35 @@ if config["/twt"] then
end, false)
end
if config["pay"] then
RegisterCommand("pay", function(source, args, rawCommand)
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[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
function hasDarkWebPermission(player, players, args)
for _, department in pairs(config["/darkweb"].canNotSee) do
if players[player].job == department then
@@ -87,4 +116,4 @@ if config["/911"].enabled then
local player = source
TriggerClientEvent("ND_Chat:911", -1, GetEntityCoords(GetPlayerPed(player)), table.concat(args, " "))
end, false)
end
end