• Gmod TTT Lua Help
    17 replies, posted
idk if this belongs in the help and support or here sry if this is the wrong one but this involves lua so i thought it might be in here i got pointshop on my server and i wanted to restrict categories it to certain ranks so i edited it to try to restrict it so no one under vip can use it but then i cant open it and im owner it doesn't show up in pointshop for me if this is the wrong one sry please and thank you for all your help [CODE]CATEGORY.Name = 'Guns' CATEGORY.Icon = 'bomb' CATEGORY.Order = -1 CATEGORY.AllowedUserGroups = { "vip", "vip+", "mod", "supermod", "admin", "superadmin", "co-owner", "owner", "FullPower" }[/CODE]
-snip- Try this: [lua] function CATEGORY:CanPlayerSee( ply ) return //Any check goes here end [/lua]
[QUOTE=JasonMan34;48908819]Category doesn't work with AllowedUserGroups, you need to use this: [lua] function CATEGORY:CanPlayerSee( ply ) return //Any check goes here end [/lua][/QUOTE] [url]http://pointshop.burt0n.net/categories/properties#allowed-user-groups[/url] You were saying?
ok wait so how am i supposed to make it work and geferon i beleive he was looking at this because i cant see it but idk if thats right i just want it fixed [url]http://pointshop.burt0n.net/categories/functions#can-player-see[/url]
Oh fuck EDIT I didnt see that function
????.....
ok well i just want a way to fix it so can anyone please help
[QUOTE=Roberito;48911111]ok well i just want a way to fix it so can anyone please help[/QUOTE] I mean really... [QUOTE=JasonMan34;48908819] [lua] function CATEGORY:CanPlayerSee( ply ) return //Any check goes here end [/lua][/QUOTE]
ok so what do i put just a big list of all the groups i want to be allowed to use it for that function?
First, this thread doesn't involve TTT. You are talking about the pointshop addon. Second, you guys aren't understanding his post. He wants to prevent the pointshop from ever opening for those who aren't of a certain status. Modifying the visibility of categories does not accomplish that.
ok oops im sorry for explaining my problem wrong i want to restrict categories to certain ranks but it wont work [editline]16th October 2015[/editline] and this is TTT server
[QUOTE=Roberito;48913763]ok oops im sorry for explaining my problem wrong i want to restrict categories to certain ranks but it wont work [editline]16th October 2015[/editline] and this is TTT server[/QUOTE] Again, the thread itself is about pointshop, not ttt - pointshop wasnt made JUST for ttt.
ok well im using it on a TTT server if that helps but can someone please just help me with this and forget everything else this has been up over 12 hrs
[QUOTE=Maravis;48913292]First, this thread doesn't involve TTT. You are talking about the pointshop addon. Second, you guys aren't understanding his post. He wants to prevent the pointshop from ever opening for those who aren't of a certain status. Modifying the visibility of categories does not accomplish that.[/QUOTE] He clearly wants only players from a certain group to see the 'Guns' category, he never said anything about the whole pointshop. [QUOTE=Roberito;48908687] i wanted to restrict [B][U]categories[/U][/B] it to certain ranks[/QUOTE] And as for your question, use [URL="http://wiki.garrysmod.com/page/table/HasValue"]table.HasValue[/URL], and use [URL="http://wiki.garrysmod.com/page/Player/GetUserGroup"]ply:GetUserGroup()[/URL] to get the rank. Another way to do would be creating a table with all the ranks, and setting which ones can or can't see it using "true" and "false" Ex: [lua]local ranks = { "owner" = true, "VIP" = true, "moderator" = false ... } function CATEGORY:CanPlayerSee( ply ) return ranks[ ply:GetUserGroup() ] end[/lua]
ok im gonna try this
didnt work
[QUOTE=Roberito;48919745]didnt work[/QUOTE] What exactly did you put in your code and what exactly didn't work? (Lua error)
woah im sry i didnt see this sooner ok well i cant find it cause i erased it but can you just help me with the normal one that ppl use
Sorry, you need to Log In to post a reply to this thread.