mirror of
https://github.com/gmod-integration/lua.git
synced 2025-08-02 22:44:11 +00:00
Update
This commit is contained in:
parent
5e8966be48
commit
17f4398daf
|
@ -1,7 +1,8 @@
|
||||||
-- https://github.com/GlorifiedPig/GlorifiedBanking
|
-- https://github.com/GlorifiedPig/GlorifiedBanking
|
||||||
|
|
||||||
function gmInte.postGlorifiedBankingTakeMoney(ply, amount, reason)
|
function gmInte.postGlorifiedBankingTakeMoney(ply, amount, reason)
|
||||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
if amount <= 0 then return end
|
||||||
|
if !ply:IsValid() || !ply:IsPlayer(ply) then print("bla") return end
|
||||||
gmInte.http.postLog("/servers/:serverID/players/" .. ply:SteamID64() .. "/ch-atm/take-money", {
|
gmInte.http.postLog("/servers/:serverID/players/" .. ply:SteamID64() .. "/ch-atm/take-money", {
|
||||||
["player"] = gmInte.getPlayerFormat(ply),
|
["player"] = gmInte.getPlayerFormat(ply),
|
||||||
["amount"] = math.Round(amount),
|
["amount"] = math.Round(amount),
|
||||||
|
@ -44,8 +45,16 @@ function gmInte.postGlorifiedBankingDepositMoney(ply, amount)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
hook.Add("GlorifiedBanking.FeeTaken", "gmInte:Player:GlorifiedBanking:TakeMoney", function(amount, ply, reason) gmInte.postGlorifiedBankingTakeMoney(ply, amount, reason) end)
|
hook.Add("GlorifiedBanking.FeeTaken", "gmInte:Player:GlorifiedBanking:TakeMoney", function(ply, amount) gmInte.postGlorifiedBankingTakeMoney(ply, amount, "Fee Taken") end)
|
||||||
hook.Add("GlorifiedBanking.PlayerInterestReceived", "gmInte:Player:GlorifiedBanking:PlayerInterestReceived", function(amount, ply, reason) gmInte.postGlorifiedBankingReceiveMoney(ply, amount, reason) end)
|
hook.Add("GlorifiedBanking.PlayerInterestReceived", "gmInte:Player:GlorifiedBanking:PlayerInterestReceived", function(ply, amount) gmInte.postGlorifiedBankingReceiveMoney(ply, amount, "Interest Received") end)
|
||||||
hook.Add("GlorifiedBanking.PlayerTransfer", "gmInte:Player:GlorifiedBanking:SendMoney", function(ply, amount, plyReceiver) gmInte.postGlorifiedBankingSendMoney(ply, amount, plyReceiver) end)
|
hook.Add("GlorifiedBanking.PlayerTransfer", "gmInte:Player:GlorifiedBanking:SendMoney", function(ply, plyReceiver, amount) gmInte.postGlorifiedBankingSendMoney(ply, amount, plyReceiver) end)
|
||||||
hook.Add("GlorifiedBanking.PlayerWithdrawal", "gmInte:Player:GlorifiedBanking:WithdrawMoney", function(ply, amount) gmInte.postGlorifiedBankingWithdrawMoney(ply, amount) end)
|
hook.Add("GlorifiedBanking.PlayerWithdrawal", "gmInte:Player:GlorifiedBanking:WithdrawMoney", function(ply, amount) gmInte.postGlorifiedBankingWithdrawMoney(ply, amount) end)
|
||||||
hook.Add("GlorifiedBanking.PlayerDeposit", "gmInte:Player:GlorifiedBanking:DepositMoney", function(ply, amount) gmInte.postGlorifiedBankingDepositMoney(ply, amount) end)
|
hook.Add("GlorifiedBanking.PlayerDeposit", "gmInte:Player:GlorifiedBanking:DepositMoney", function(ply, amount) gmInte.postGlorifiedBankingDepositMoney(ply, amount) end)
|
||||||
|
|
||||||
|
hook.Add("GlorifiedBanking.PlayerBalanceUpdated", "gmInte:Player:GlorifiedBanking:BalanceUpdated", function(ply, iOldBank, iNewBank)
|
||||||
|
if iOldBank > iNewBank then
|
||||||
|
gmInte.postGlorifiedBankingTakeMoney(ply, iOldBank - iNewBank, "Balance Updated")
|
||||||
|
elseif iOldBank < iNewBank then
|
||||||
|
gmInte.postGlorifiedBankingReceiveMoney(ply, iNewBank - iOldBank, "Balance Updated")
|
||||||
|
end
|
||||||
|
end)
|
Loading…
Reference in New Issue
Block a user