Setting Donators

Apperantly, I found out that everyone can pickup everyone with physics gun.
Read up in some forums and found out it was Fadmin.
So I set Fadmin to false but now the Donator Rank doesnt work because the job programm was made with Fadmin functions!
For example:
TEAM_NINJA = DarkRP.createJob(“Ninja”, {
color = Color(255, 229, 1, 255),
model = {“models/player/p2_chell.mdl”, “models/player/soldier_stripped.mdl”},
description = [[Wanna know? Read the rules!]],
weapons = {“spiderman’s_swep”, “m9k_knife”},
command = “/ninja”,
max = 3,
salary = 60,
admin = 0,
vote = false,
hasLicense = false,
candemote = true,
category = “Donator Jobs”,
customCheck = function(ply) return ply:CheckGroup(“SeniorAdmin”, “Donator”, “SuperAdmin”, “superadmin”, “Owner”) or ply:IsAdmin() end,
CustomCheckFailMsg = “You need to be a donator to become a Ninja!”
})

Because Fadmin is now disabled,
This two:
customCheck = function(ply) return ply:CheckGroup(“SeniorAdmin”, “Donator”, “SuperAdmin”, “superadmin”, “Owner”) or ply:IsAdmin() end,
CustomCheckFailMsg = “You need to be a donator to become a Ninja!”
Doesn’t work anymore,
Any options? Fixing WITH fadmin moving players with PhysicsGun/Making other Donator function?

What is ply:CheckGroup do?
Post the code of this function

An easier way to do it is



local VIP = { -- VIP ranks
    "founder",
    "superadmin",
    "vip"

}

function IsVIP( ply )
    local Rank = ply:GetUserGroup()

    if( table.HasValue( VIP, Rank) ) then
        return true
    else
        return false
    end
end


and then to check for vip on the job use this custom check



     customCheck =  function(ply) return IsVIP( ply ) end,
     CustomCheckFailMsg = "VIP Job Only",



For god sake, don’t do [lua]if( thing ) end[/lua]

Keep it [lua]if ( thing ) end[/lua]

Also why do you localize [lua]ply:GetUserGroup()[/lua] it’s not like it more readable and it’s only used once so.

Do it like this

[lua]
local VIP = { – VIP ranks
“founder”,
“superadmin”,
“vip”
}

function IsVIP( ply )
if ( table.HasValue( VIP, ply:GetUserGroup() ) ) then
return true
else
return false
end
end
[/lua]

Or you can make it shorter and more optimized with



local VIP = {
    ["founder"] = true,
    ["superadmin"] = true,
    ["vip"] = true,
}

function IsVIP( ply )
    return VIP[ply:GetUserGroup()] or false
end


Am I putting it in the Jobs file? or any other file?
Also I did checkgroup because it works on ULX

Put it in the jobs file, as the table VIP is localized.

[ERROR] Lua is unable to understand file “darkrp_customthings/jobs.lua” because its author made a mistake around line number 69.

69 Line: local VIP = {
70 [“SeniorAdmin”] = true,
71 [“superadmin”] = true,
72 [“Donator”] = true,
73 [“SuperAdmin”] = true,
74 [“Owner”] = true,

u need a } at the end

There is at line 75 I just didnt copy

Post the whole file.

Tried changing it now there is no lua errors but it doesnt work
Example of what I have:
at the start of the file I have
local VIP = { – VIP ranks
[“SeniorAdmin”] = true,
[“superadmin”] = true,
[“Donator”] = true,
[“SuperAdmin”] = true,
[“Owner”] = true,
}

function IsVIP( ply )
local Rank = ply:GetUserGroup()

if( table.HasValue( VIP, Rank) ) then
    return true
else
    return false
end

end

then later on:

TEAM_DONATORFREERUNNER = DarkRP.createJob(“Donator Freerunner”, {
color = Color(0, 0, 0, 255),
model = {“models/player/p2_chell.mdl”},
description = [[Wanna know? Read the rules!]],
weapons = {“climb_swep2”},
command = “/donatorfreerunner”,
max = 2,
salary = 60,
admin = 0,
vote = false,
hasLicense = false,
candemote = true,
– CustomCheck
medic = false,
chief = false,
mayor = false,
hobo = false,
cook = false,
category = “Donator Jobs”,
customCheck = function(ply) return IsVIP( ply ) end,
CustomCheckFailMsg = “Donator Job Only”,
})

[editline]16th August 2016[/editline]

Users receive this:
[DarkRP] gamemodes/darkrp/gamemode/modules/base/cl_gamemode_functions.lua:23: attempt to index local ‘jobTable’ (a nil value)

  1. Call - gamemodes/darkrp/gamemode/modules/base/cl_gamemode_functions.lua:23
  2. unknown - gamemodes/darkrp/gamemode/modules/base/cl_gamemode_functions.lua:62

[editline]16th August 2016[/editline]

in gamemodes/darkrp/gamemode/modules/base/cl_gamemode_functions.lua
lines 20-28 its written
function GM:ShowSpare2()
local jobTable = LocalPlayer():getJobTable()

if jobTable.ShowSpare2 then
    return jobTable.ShowSpare2(LocalPlayer())
end

DarkRP.toggleF4Menu()

end

[editline]16th August 2016[/editline]

and ofcourse as its written its not letting them open f4, for me somehow it DOES

[editline]16th August 2016[/editline]

Even if I move them to my rank it doesnt work for them,
w&f just happend?
any help?

The last item in an array does not need a comma.

tried it, also didn’t work