General > Developers Corner
Can someone help me change this code?
(1/1)
MangeGamerZ:
Hello I'm using someones script that blocks People from picking up Vehicle but i want it to use ULX Ranks can someone help me Change it??
--- Code: ---function limitVicPickup(ply, ent)
if(ent:IsVehicle()) then -- Checks if the entity being picked up is a vehicle
if not (ply:IsSuperAdmin()) then -- if the player picking the entity up isn't superadmin
return false -- Don't let the player pick it up
end
end
end
hook.Add("PhysgunPickup", "limitVehiclePickup", limitVicPickup) -- Registers the hook so the function gets called
--- End code ---
JamminR:
Straight Gmod LUA
Player:GetUserGroup
or slightly better due to less writing needed
Player:IsUserGroup
or even super-duper MOAR better to prevent having to write 5 "or" statements looking for each group specifically you want checked that already inherit each other, our very own ULib group check
Player:CheckGroup
[?] The Last Centurion:
Using table.HasValue and then checking the User's group using that table, like how DarkRP customChecks work(Multiple groups, Example 2) would probably work. I'm new to LUA but I try.
Navigation
[0] Message Index
Go to full version