Welcome, Guest. Please login or register.
Did you miss your activation email?
November 10, 2024, 04:08:34 AM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: EntityTakeDamage and TTT
Pages: [1]
Author Topic: EntityTakeDamage and TTT  (Read 5670 times)
Tommynator
Poster

Posts: 173

Tommynator is a traitor!


« on: December 25, 2011, 10:10:44 AM »

Hey, could you please tell me why does EntityTakeDamage hook give wrong damage infos? This only happens on TTT. For example :


local function DamageTest(ent, inflictor, attacker, amount, dmginfo)
   if ent:IsPlayer() then
   print(tostring(dmginfo:GetDamage()))
   end
end
hook.Add("EntityTakeDamage", "EntityTakeDamageTest", DamageTest)


Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #1 on: December 25, 2011, 11:25:42 AM »

I believe a hook is run before a gamemode implementation of a function, ie. your hook gets called before TTT's EntityTakeDamage has happened.
Tommynator
Poster

Posts: 173

Tommynator is a traitor!


« Reply #2 on: December 25, 2011, 09:04:27 PM »

Oh, I didn't know this. Thanks!
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: EntityTakeDamage and TTT « 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.008 seconds with 17 queries.