Pivity

Making only certain ranks physgun cars

Last read Never
#1

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)

Optimistic x 1
#2
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

#3

btw i found this somewhere on the enternet and i have no clue about coding. So can u just explain it to me more:)

#4

Why are you doing this

ply:GetNWString("usergroup")

This is not how you check for a usergroup, use

ply:GetUserGroup()

Agree x 3
#5
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.

#6

@billy when i replace ply:GetNWString("usergroup") with this ply:GetUserGroup() you can physgun cars

Dumb x 1
#7
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

Users viewing this thread
Nobody