RegisterCommand('setmoney', function(source, args, raw)
local player = tonumber(args[1])
local money = tonumber(args[2])
if args[1] then
if (player and GetPlayerName(player)) then
if money then
TriggerEvent("es:getPlayerFromId", player, function(user)
if(user)then
user.setMoney(money)
RconPrint("Money set")
TriggerClientEvent('chat:addMessage', player, {
args = {"^1SYSTEM", "Your money has been set to: ^2^*$" .. money}
})
end
end)
else
RconPrint("Invalid integer\n")
end
else
RconPrint("Player not ingame\n")
end
else
RconPrint("Usage: setmoney [user-id] [money]\n")
end
end, true)