Welcome, Guest. Please login or register.
Did you miss your activation email?
November 26, 2024, 06:09:53 AM
Home Help Login Register
News: Trouble in Terrorist Town? Site here, forum here.

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: TTT Round End Hooks?
Pages: [1]
Author Topic: TTT Round End Hooks?  (Read 2976 times)
jimbodude
Poster

Posts: 36


« on: February 01, 2011, 06:31:15 PM »

Hey there,

I'm trying to award players with some money after the round ends, if they're part of the winning team. I'm using the following, but for some reason, it isn't called:


hook.Add( "RoundEndWithResult", "GiveDollars4", function( result, resulttext )
if type( result ) == "number" then -- the result is a team ID
for k,v in pairs(team.GetPlayers(result)) do -- result should print team numnber,
if v:IsUserGroup("vip") then
v:ChangeDollars(20)
v:ChatPrint("You won, you have gained 20 dollars for winning.")
else
v:ChangeDollars(10])
v:ChatPrint("You won, you have ginned 10 dollars for winning.")
end
end
else -- the result is a player
if result:IsUserGroup("vip") then
result:ChangeDollars(20)
result:ChatPrint("You won, you have gained 20 dollars for winning.")
else
result:ChangeDollars(10)
result:ChatPrint("You won, you have gained 10 dollars for winning.")
end
end
end)


Does TTT use a different hook for round end?

The functions themselves do work, as when I call them outside of this hook, they work just fine.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #1 on: February 01, 2011, 07:09:48 PM »

TTT does not use the Fretta round system. See info on TTT's round hooks here: http://ttt.badking.net/guides/hooks
jimbodude
Poster

Posts: 36


« Reply #2 on: February 01, 2011, 07:15:57 PM »

Ah thanks, exactly what I was looking for. Guess I should have taken a look there before posting.

Thanks again.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: TTT Round End Hooks? « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.009 seconds with 17 queries.