@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
if (store.claimedToday(p)) return;
double amount = cfg.getDouble("daily");
economy.depositPlayer(p, amount);
p.sendMessage(msg("reward", amount));
store.markClaimed(p);
}
[Info("DailyKits", "TheeCobra", "1.4.0")]
class DailyKits : RustPlugin
{
[ChatCommand("kit")]
void KitCommand(BasePlayer player)
{
if (!HasPerm(player, "kits.use"))
return;
GiveKit(player, config.DefaultKit);
}
}
util.AddNetworkString("shop_buy")
net.Receive("shop_buy", function(_, ply)
local id = net.ReadUInt(8)
local item = Shop.Items[id]
if not item then return end
if not ply:canAfford(item.price) then
return Shop.Notify(ply, "no_funds")
end
ply:addMoney(-item.price)
item:Give(ply)
end)
local QBCore = exports['qb-core']:GetCoreObject()
RegisterNetEvent('cobra-jobs:payout', function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player or not Jobs.OnDuty(src) then
return
end
Player.Functions.AddMoney('bank', Config.Pay)
end)