Making only certain ranks physgun cars
So im using this script to make it so that only certain players can physgun cars. Why is it that it works however it causes all the ranks that are allowed to physgun each other
-- ULX ONLY -- DISALLOW GROUPS GO HERE local DenyGroups = { "user", "trusted", "noaccess",
}
-- ALLOWED GROUPS GO HERE local AllowGroups = { "owner", "superadmin", "admin", "superadmins", "headofstaff", "admin+", "moderator", "trialmod",
}
local function VehPickup(ply, ent) if table.HasValue( DenyGroups, ply:GetNWString("usergroup") ) and (ent:GetClass():lower() == "prop_vehicle_jeep") then return false elseif table.HasValue( AllowGroups, ply:GetNWString("usergroup") ) then return true end end
hook.Add("PhysgunPickup", "Physgun.VehPickup", VehPickup)
ByLAST OF USat 2nd of August 2018 11:46:07
So im using this script to make it so that only certain players can physgun cars. Why is it that it works however it causes all the ranks that are allowed to physgun each other...
You're not checking if the entity is a vehicle or not
btw i found this somewhere on the enternet and i have no clue about coding. So can u just explain it to me more:)
Why are you doing this
This is not how you check for a usergroup, use
ply:GetUserGroup()
ByLAST OF USat 2nd of August 2018 12:18:09
btw i found this somewhere on the enternet and i have no clue about coding. So can u just explain it to me more:)
If you don't understand it I wouldn't use it. Either post a job or try breaking it down and understanding it, asking specific questions. We aren't here to hold your hand.
@billy when i replace ply:GetNWString("usergroup") with this ply:GetUserGroup() you can physgun cars
ByLAST OF USat 3rd of August 2018 06:57:03
@billy when i replace ply:GetNWString("usergroup") with this ply:GetUserGroup() you can physgun cars
Stop adding tons of new ranks in Ulx, admin or higher (inherited from admin) can use their physgun to pickup cars..
That is the easy way though, FPP is the real problem in this case