Skip to content

Commit

Permalink
Update hook names to match changes made for TTT-2/TTT2#1451
Browse files Browse the repository at this point in the history
  • Loading branch information
pkillboredom committed Mar 28, 2024
1 parent a4c5a10 commit f6ceb96
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lua/autorun/server/ttt2Stats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ if SERVER then
end)

-- Hook TTT2CanTransferCredits; inserts a new row into ttt2stats_credit_transactions when a player transfers credits to another player
hook.Add("TTT2TransferedCredits", "ttt2stats_TTT2TransferedCredits", function(sender, recipient, credits, isRecipientDead)
hook.Add("TTT2OnTransferCredits", "ttt2stats_TTT2OnTransferCredits", function(sender, recipient, credits, isRecipientDead)
if GetConVar("ttt2stats_debug"):GetBool() then
print("DEBUG-TTT2STATS: TTT2TransferedCredits hook called. Sender: " .. sender:Nick() .. " Recipient: " .. recipient:Nick() .. " Credits: " .. credits .. " isRecipientDead: " .. tostring(isRecipientDead))
print("DEBUG-TTT2STATS: TTT2OnTransferCredits hook called. Sender: " .. sender:Nick() .. " Recipient: " .. recipient:Nick() .. " Credits: " .. credits .. " isRecipientDead: " .. tostring(isRecipientDead))
if roundID == -1 then
print("DEBUG-TTT2STATS: TTT2OnGiveFoundCredits hook called before a round has started. Skipping.")
return
Expand All @@ -322,10 +322,10 @@ if SERVER then
sql.Query("INSERT INTO ttt2stats_credit_transactions (round_id,transaction_type,trans_time,credit_amount,source,destination,source_new_balance,dest_new_balance) VALUES (" .. sql.SQLStr(roundID) .. "," .. sql.SQLStr(transaction_type) .. "," .. sql.SQLStr(trans_time) .. "," .. sql.SQLStr(credits) .. "," .. sql.SQLStr(sourceSteamId) .. "," .. sql.SQLStr(destSteamId) .. "," .. sql.SQLStr(source_new_balance) .. "," .. sql.SQLStr(dest_new_balance) .. ");")
end)

-- Hook TTT2ReceivedKillCredits; inserts a new row into ttt2stats_credit_transactions when a player receives credits for killing another player
hook.Add("TTT2ReceivedKillCredits", "ttt2stats_TTT2ReceivedKillCredits", function(victim, attacker, creditsAmount)
-- Hook TTT2OnReceiveKillCredits; inserts a new row into ttt2stats_credit_transactions when a player receives credits for killing another player
hook.Add("TTT2OnReceiveKillCredits", "ttt2stats_TTT2OnReceiveKillCredits", function(victim, attacker, creditsAmount)
if GetConVar("ttt2stats_debug"):GetBool() then
print("DEBUG-TTT2STATS: TTT2ReceivedKillCredits hook called.")
print("DEBUG-TTT2STATS: TTT2OnReceiveKillCredits hook called.")
if roundID == -1 then
print("DEBUG-TTT2STATS: TTT2OnGiveFoundCredits hook called before a round has started. Skipping.")
return
Expand All @@ -343,10 +343,10 @@ if SERVER then
sql.Query(queryText)
end)

-- Hook TTT2ReceivedTeamAwardCredits; inserts a new row into ttt2stats_credit_transactions when a player receives credits from a team award.
hook.Add("TTT2ReceivedTeamAwardCredits", "ttt2stats_TTT2ReceivedTeamAwardCredits", function(ply, creditsAmount)
-- Hook TTT2OnReceiveTeamAwardCredits; inserts a new row into ttt2stats_credit_transactions when a player receives credits from a team award.
hook.Add("TTT2OnReceiveTeamAwardCredits", "ttt2stats_TTT2OnReceiveTeamAwardCredits", function(ply, creditsAmount)
if GetConVar("ttt2stats_debug"):GetBool() then
print("DEBUG-TTT2STATS: TTT2ReceivedTeamAwardCredits hook called.")
print("DEBUG-TTT2STATS: TTT2OnReceiveTeamAwardCredits hook called.")
if roundID == -1 then
print("DEBUG-TTT2STATS: TTT2OnGiveFoundCredits hook called before a round has started. Skipping.")
return
Expand Down

0 comments on commit f6ceb96

Please sign in to comment.