A Few Quick Questions

I have 3 questions:

The first: How do I allow VIPs to become any job they want even if the job is full

The second: How do I allow VIPs to bypass the job vote?

The third: How do I allow VIPs to spawn with armor for specific jobs?

Thanks

  1. No idea, sorry.



RequiresVote = function(ply, job) if ply:GetUserGroup() == "vip" then return false end end,




PlayerSpawn = function(ply) if ply:GetUserGroup() == "vip" then ply:SetArmor(50) end end,


Can you give me those custom checks but with the correct code to add more than one VIP group
Thanks for the help!



RequiresVote = function(ply, job) if ply:GetUserGroup() == "vip" or ply:GetUserGroup() == "some other vip rank" then return false end end,


OR



local vipgroups = {
["vip"] = true,
["anothervip"] = true
}

--

RequiresVote = function(ply, job) if vipgroups[ply:GetUserGroup()] then return false end end,



The second one requires more work on your part, but is better practice.

Would that go straight under hasLicence? as it is?
The second one is the one I am talking about
Thanks for the help


     
RequiresVote = function(ply, job) return CLIENT or table.HasValue({"superadmin", "VIP", "DONATOR"}, ply:GetNWString("usergroup"))
end,
})

Would this help? This one would suit my needs more with the table.HasValue bit. Just so I can add and take out specific groups
Again, Thanks for the help.

It goes wherever you want in the job table. It’s better to use keys rather than table.HasValue (as in, better code). You can add whatever you want to the vipgroups table, if you know what you’re doing.



local vipgroups = {
["vip"] = true,
["goldvip"] = true,
["platinumvip"]= true
--and so on
}


Don’t return CLIENT either.