Pivity

DarkRP Jobs whitelisted to STEAMID's

Last read Never
#1

I'm not too good with GLua, so I'm wondering if someone would know how I could do this:

TEAM_TEST = DarkRP.createJob("test", {
    color = Color(104, 0, 255, 255),
    model = {"models/player/combine_super_soldier.mdl"},
    description = [[]],
    weapons = {},
    command = "test",
    max = 10,
    salary = 15,
    admin = 0,
    vote = false,
    hasLicense = true,
    candemote = false,
    customCheck = function(ply) return CLIENT or DONATOR end,
    CustomCheckFailMsg = "This job is donator only."
     })

so I'm trying to make the variable called "DONATOR" be a list of SteamID's and what I've been trying to do so far is:

DONATOR = {ply:SteamID() == "STEAM_0:1:00000000" or ply:SteamID() == "STEAM_0:1:00000001"}

plus some other variations of this code too, but nothing seems to work, I just cant seem to figure out how I can make a variable with a list of STEAMID's of donators so I don't need to enter them individually for each job and to not to use a ULX rank for it too.

Hopefully I've kinda explained this well enough and someone might be able to help me out :)

#2

Something like this is what your looking for. Have DONATORS be a table of SteamID's, and just check if that players SteamID is in that table.

DONATORS = {
    ["STEAM_0:1:80376292"] = true,
    ["STEAM_0:0:74947369"] = true
}

TEAM_TEST = DarkRP.createJob("test", {
    color = Color(104, 0, 255, 255),
    model = {"models/player/combine_super_soldier.mdl"},
    description = [[]],
    weapons = {},
    command = "test",
    max = 10,
    salary = 15,
    admin = 0,
    vote = false,
    hasLicense = true,
    candemote = false,
    customCheck = function (ply) return CLIENT or DONATORS[ply:SteamID()] end,
    CustomCheckFailMsg = "This job is donator only."
})

If you have some Donation system, you can also insert SteamIDs into that table, or have it read from a Database, or even just have it check the players usergroup to actually fetch your donators.

#3

Thanks :) , I'll give that a shot soon and see if it works out

Users viewing this thread
Nobody