• Making an entity USE prop protected
    5 replies, posted
I use Falco's Prop Protection, and I only want the players buddies to be able to press e(+use) on my entity. I can't figure out how to do this, as there are no examples anywhere. Can somebody help me?
You would have to run this hook... [url]http://wiki.garrysmod.com/?title=Gamemode.PlayerUse[/url] ... and do a check inside of it. return true if you want it to get used and return false if not.
I dunno how it would make it check for buddies list though.
You'd have to see how FPP stores a player's buddy list and access it. I've never seen it so I'm not sure.
RAGE /falconpuncheswall
You will have to define player. player.Buddies should have the players buddy list stored in it. EDIT* untested but should work. [LUA] function CheckUseBuddyList ( ply, entity ) if(entity.Owner and entity.Owner.Buddies)then for k,v in pairs(entity.Owner.Buddies)do if(v==ply)then return true end end return false end return true end hook.Add( "PlayerUse", "CheckUseBuddyList", CheckUseBuddyList ) [/LUA]
Sorry, you need to Log In to post a reply to this thread.