PAC3 Restricting Help

Hello, I installed pac3 on my server, and I wanted to restrict it so that only vips and up would be able to use it.

I put this code in garrysmod/lua/autorun/server and named it pac3restriction.lua:

[lua] hook.Add(“PrePACConfigApply”, “vips only”, function(ply, outfit_data)
if not ply:Isvip() then
return false, “You need to donate!”
end
end)

[/lua]

For some reason it still let’s users use it, am I putting it in the wrong file or something? Any help would be appreciated.

Show us your “Isvip” function.

I don’t know how to do that, but the ulx rank is called “vip”

[lua]Player:IsUserGroup(“vip”)[/lua]

So would the correct code be this?

[lua]

hook.Add(“PrePACConfigApply”, “vips only”, function(ply, outfit_data)
if not Player:IsUserGroup(“vip”) then
return false, “You need to donate!”
end
end)

[/lua]

Yes but you should use CheckUserGroup if you have ranks above VIP that should also get permission.

And Player should be ply

So the absolute final code would be:

[lua]

hook.Add(“PrePACConfigApply”, “vip and up only”, function(ply, outfit_data)
if not ply:CheckUserGroup(“vip”) then
return false, “You need to donate!”
end
end)

[/lua]

Update: It still doesn’t work, users are able to use PAC3.

wh1t3rabbit was along the right lines.
I believe the function is CheckGroup, not CheckUserGroup.

[editline]6th April 2015[/editline]

For your purposes however, I imagine IsUserGroup should be fine too

This is laughable and probably illegal. Why would anyone donate to use pac when they can go to any other server and use it?

Wouldn’t say it’s illegal - the guy is providing a service, for people to play on if they choose to. They have the option to have more in-game privileges if they choose to pay. Still a bit of a dick move though.
That being said, you gotta do what you gotta do to make money. Server costs and all.

I’d make it for users too, but people always find a way to minge with it. I’ve seen people set their model to giant 50 foot robots… So I’ve resorted to this. Can’t trust people anymore.

It’s documented on the Github with this example so. It’s mainly for DarkRP servers, not your typical Sandbox.

As long as you file your Form 1099-B

Not everyone comes from America you know so these rules are not always going to apply.

Well, I read that thing you posted,
and in my opinion, I believe that,
oh uh sorry idk I got distracted

I have:

[lua]

hook.Add(“PrePACConfigApply”, “vip and up only”, function(ply, outfit_data)
if not ply:IsUserGroup(“vip”) then
return false, “You need to donate!”
end
end)

[/lua]

and it’s still not working! I don’t get it, this should be perfect right?

It works for vip’s but nobody else above vip.

Then add the groups above VIP then?

**

If the groups inherit from vip then you can use CheckGroup instead of IsUserGroup. If they don’t inherit from vip then you need to do multiple checks separated by or.

This is an Old post but how would one add multiple user groups?