• A playermodel hook
    2 replies, posted
I am trying to figure out how to code my TTT defibulators to not revive people who have killed themselves through jihad and our jihad changes the player model to a burnt corpse. So I was wondering if there was something for Gmod that was like ply.Model() so I can write a code to do this.
Use something like [lua]local tr = trace-code from weapon to detect the body you're looking at... local _ragdoll = tr.Entity; local _model = _ragdoll:GetModel( ); if ( _model == "models/humans/corpse1.mdl" || _model == "models/player/corpse1.mdl" ) then return; end if ( _model == "models/player/charple.mdl" ) then return; end if ( _model == "models/player/skeleton.mdl" ) then return; end[/lua] charple.mdl is the burned corpse, skeleton is skeleton, corpse1 I believe is another burned one with missing limbs, but don't quote me on that one.
Alright I will mess with that. Thank you! [editline]5th April 2014[/editline] Yup after some fiddling I got it to work. So now people who have jihaded cannot be revived
Sorry, you need to Log In to post a reply to this thread.