• DarkrP Doors
    1 replies, posted
How do i make it where only certain ulx ranks can own doors in darkrp
Grab the group they're in with: ply:GetNWString( "UserGroup" ); It is best to cache that group and only allow updating it every few seconds to avoid lag. Although if you're only doing a check on purchase of a door, you shouldn't have many issues. Find where doors are purchased, the hook for it, and restrict if not in group. General Learning Lua Help Thread: [url]http://facepunch.com/showthread.php?t=1337945[/url] Problems that don't need their own thread ( All simple questions / quickies should go here ): [url]http://facepunch.com/showthread.php?t=1348923[/url] DarkRP Help Thread ( [b]ALL[/b] DarkRP Questions go here ): [url]http://facepunch.com/showthread.php?t=1249475[/url] Looking to [b]HIRE[/b] a coder? Read this: [url]http://facepunch.com/showthread.php?t=1257110[/url] Coderhire Thread: [url]http://facepunch.com/showthread.php?t=1281665[/url] [url]http://wiki.darkrp.com/index.php/Hooks/server/playerbuydoor[/url] [lua]local VIP_TABLE = { admin = true; superadmin = true; }; hook.Add( "playerBuyDoor", "OnlySpecialGetDoors" function( _p, _ent local _group = string.lower( _p:GetNWString( "UserGroup" ) ); local _canbuy = VIP_TABLE[ _group ] || false return _canbuy, ( !_canbuy && "Only special people can buy" || "You are authorized to buy!" ), false; end );[/lua]
Sorry, you need to Log In to post a reply to this thread.