Custom Jobs (lua)

Post Reply
Slyck
New to forums
New to forums
Posts: 2
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sun Jul 27, 2014 5:54 pm

Custom Jobs (lua)

Post by Slyck »

Hello, I have my server setup and I was happy that everything was working smothly, I don't know too much lua, but I decided to try to make custom jobs. I try to make a job that is for a certain rank (Donators and above) and it did not work, before that I made a job for myself and it worked nicely.

Here is the code for the job that worked.

TEAM_KOBALT = AddExtraTeam("Kobalt", {
color = Color(255, 51, 5, 255),
model = "models/player/daedric.mdl",
description = [[This job is for Slyck only! Leader of the Daedric Army]],
weapons = {"m9k_milkormgl", "m9k_rpg7", "m9k_m249lmg", "gdcw_m200i"},
command = "kobalt",
max = 1,
salary = 100,
admin = 0,
vote = false,
haslicense = true,
candemote = false,
mayorCanSetSalary = false,
customCheck = function(ply) return CLIENT or ply:SteamID("SteamId") == "STEAM_0:0:88422219" end,
CustomCheckFailMsg = "This is Slyck's custom job!"
})




Here is my one for donator and above that DIDN'T work.

TEAM_SWAT = AddExtraTeam("SWAT", {
color = Color(0, 0, 255, 255),
model = "models/player/specnaz/slow_specnaz.mdl",
description - [[ You are the Most Elite of the Police Force. You are used for extreme situations.]],
weapons = {"m9k_acr", "m9k_l85", "m9k_glock", "m9k_mp7", "arrest_stick", "unarrest_stick", "stunstick"},
command = "swat",
max = 3,
salary = 145,
admin = 0,
vote = false,
haslicense = true,
if ply:IsUserGroup("Donator", "moderator", "admin", "superadmin", "headadmin", "owner"),
})


I have no clue why it didn't work. I remove the "If ply:isUserGroup" And it still does not work... Please help I will really appreciate it.
Axe
New to forums
New to forums
Posts: 4
Joined: Wed Jul 30, 2014 1:32 am

Re: Custom Jobs (lua)

Post by Axe »

Try this :)
Untested, so tell me if I fluffed something up.

TEAM_SWAT = AddExtraTeam("SWAT", {
color = Color(0, 0, 255, 255),
model = "models/player/specnaz/slow_specnaz.mdl",
description - [[ You are the Most Elite of the Police Force. You are used for extreme situations.]],
weapons = {"m9k_acr", "m9k_l85", "m9k_glock", "m9k_mp7", "arrest_stick", "unarrest_stick", "stunstick"},
command = "swat",
max = 3,
salary = 145,
admin = 0,
vote = false,
haslicense = true,
customCheck = function(ply) if ply:IsUserGroup("donator", "moderator", "admin", "superadmin", "headadmin", "owner") then return true end,--remember, ulx is case sensitive, so watch your capitalization.
CustomCheckFailMsg = "This is a Donator Only Job!"--Change this to whatever you'd like.
})
Post Reply