How can I override GM:EntityTakeDamage without creating an entirely new gamemode?
Erm, wut?
i.e
[code]function EntDamage( ent, inflictor, attacker, amount, dmginfo )
if ( ent:IsNPC() ) then
print("You hit an NPC!")
end
end
hook.Add("GM:EntityTakeDamage","sillyexample",EntDamage)
[/code]
Dude the hook doesn't have GM in it :P, take that out and it'll work if you're having an error.
[url]http://wiki.garrysmod.com/?title=Gamemode.EntityTakeDamage[/url] - if you haven't looked already :3
Thanks, I knew it was something stupidly simple like that. The wiki said to add GM though...
Well look up at the description on any function/hook it'll say what the actual hook is.
Only add GM in front if you are completely overwriting the function in a gamemode
Sorry, you need to Log In to post a reply to this thread.