• Certain ulx groups cant pickup vehicles
    3 replies, posted
So what I am trying to do here is I am trying with this code for groups that are in allowed groups to be able to pickup vehicles, now i tested this on dev server that hasnt got any addon, and it worked perfectly, but when i try it on a server which has tons of addons (one of them fpp, no sure if that restrict it but ive disable physgun protection, still my script wont work) it just wont work, does it have to do something with fpp? I've tryed disabling physgun protection and still same shit happens. Any way to make it so that code actually works without it being restricted by something as thats what i think it is, that code works fine but something else is restricting it, I think. Any ideas? This is the code: local allowed_groups = {     ["owner"] = true, ["coowner"] = true, ["headdev"] = true, ["superadmin"] = true, ["super admin"] = true, ["headadmin"] = true, ["admin"] = true, ["headmod"] = true, ["moderator"] = true, ["vipmoderator"] = true, ["viptrialmoddrifter"] = true, ["vipsuperadminkingpin"] = true, ["trialmod"] = true, ["eventmanager"] = true, ["builder"] = false, ["god"] = false, ["kingpin"] = false, ["outlaw"] = false, ["speedster"] = false, ["drifter"] = false, ["veteran+"] = false, ["veteran"] = false, ["member+"] = false,     ["member"] = false, ["user"] = false     -- ["groupname"] = true     -- last entry doesn't need comma } local function PlayerPickup(ply, ent)     if not allowed_groups[ply:GetUserGroup()] and (ent:GetClass():lower() == "prop_vehicle_jeep") then       return false end end hook.Add("PhysgunPickup", "Allow Player Pickup", PlayerPickup)
You have reversed the logic here, you want to allow certain people to pick up jeeps, not disallow all other people. Try this instead: local function PlayerPickup(ply, ent) if allowed_groups[ply:GetUserGroup()] and ent:GetClass():lower() == "prop_vehicle_jeep" then  return true end end With this you also have to make sure that FPP for example disallows it by default, otherwise you can do something like this: local function PlayerPickup(ply, ent) if ent:GetClass():lower() == "prop_vehicle_jeep" then return allowed_groups[ply:GetUserGroup()] end end
Thanks, will try it out.
Hello I have the same problem, where do i put this code ?
Sorry, you need to Log In to post a reply to this thread.