Ulysses
General => Developers Corner => Topic started by: petturoidakko on March 27, 2015, 04:48:45 PM
-
So suddendly some of our custom jobs stopped showing on F4menu, but you can still use command example /swat in chat to become one of those jobs.
})
TEAM_SWAT = DarkRP.createJob("SWAT", {
color = Color(25, 25, 170, 255),
model = "models/gign remasteredhd.mdl",
description = [[More experienced than the average CP.
You guys are called in to prevent raids.]],
weapons = {"m9k_m16a4_acog", "weapon_shield", "m9k_m61_frag", "m9k_knife", "arrest_stick", "unarrest_stick", "stunstick", "door_ram", "weaponchecker","weapon_taser"},
command = "swat",
max = 5,
salary = 85,
admin = 0,
vote = false,
hasLicense = true,
hasRadio = true,
canTalkToGlobal = true,
candemote = false,
customCheck = function(ply) return ply:IsUserGroup("donator") or ply:IsUserGroup("donor mod") or ply:IsUserGroup("donor admin") or ply:IsUserGroup("superadmin") end,
CustomCheckFailMsg = "You need to be a donator to become a SWAT."
})
that is the code we use for ex: swat.
cant find anything wrong with it.
Our ulx groups are like that
donator
donor mod
superadmin
admin
no uppercase letters
-
First, for simplicity, you can use ply:IsSuperAdmin instead of ply:IsUserGroup("superadmin") just for the laziness all coders have and are there any errors printed to console when you load the server? Are you using stock F4? Are any other jobs with these same ranks having these problems or is it just SWAT?
-
First, for simplicity, you can use ply:IsSuperAdmin instead of ply:IsUserGroup("superadmin") just for the laziness all coders have and are there any errors printed to console when you load the server? Are you using stock F4? Are any other jobs with these same ranks having these problems or is it just SWAT?
Well not with these groups, but example superadmin job is working completly fine.
but you cant use ply:IsSuperAdmin like ply:IsDonator right?
-
My money is on the spaces in your ULX Groups. From my knowledge, ULX doesn't like spaces.
Also, you can use ply:IsAdmin (which allows anyone who inherits admin to use it.) or ply:IsSuperAdmin (which allows anyone who inherits superadmin to use it.)
-
My money is on the spaces in your ULX Groups. From my knowledge, ULX doesn't like spaces.
Also, you can use ply:IsAdmin (which allows anyone who inherits admin to use it.) or ply:IsSuperAdmin (which allows anyone who inherits superadmin to use it.)
But I dont understand why it does not work as it worked fine, but suddendly stopped working.
-
It Might Be The Custum Cheak
-
Where are you putting the code??? If it's in the darkrp files then that's the problem you need to have darkrp modification!
-
Where are you putting the code??? If it's in the darkrp files then that's the problem you need to have darkrp modification!
we got darkrp modification, and I just realized the jobs work, like you can type the chat command to become one, they just wont show up in F4 menu.
-
I know next to nothing about DarkRP, so I can't give you any help there. I would, however, not recommend using IsSuperAdmin() just to keep everything the same. It will function the same either way, but using two different functions just doesn't look as nice.
-
Try using this: http://thecodingbeast.com/tools?id=customcheck (http://thecodingbeast.com/tools?id=customcheck)
This will give you the code for the check that may be the issue this will help ALOT scroll down to the bottom of the page and fill it out!
-
I'm moving this to Developers corner, as I feel right now it's not so much how to use ULib or ULX.
-
MY advice: try removing the spaces from your groups. Humour me.
-
Try using this: http://thecodingbeast.com/tools?id=customcheck (http://thecodingbeast.com/tools?id=customcheck)
This will give you the code for the check that may be the issue this will help ALOT scroll down to the bottom of the page and fill it out!
I Use That
-
If you guys actually READ the code, you'd see he's using the check...
-
If you guys actually READ the code, you'd see he's using the check...
I Know
-
i had the same problem.. but i found out that in my donor grups "silver mod" and so on dident work, so i chanced them to smod, then it worked.
So if you try to rename/remove donor mod, it might work. Space wont work, try removing or ply:IsUserGroup("donor mod"), and see if it works now. If it work i suggest you to rename your donor mod to dmod or donormod.
-
Ok so this is what i use... Use this:
-- Donator Code / Only players there is in the Donator group can see the job.
customCheck = function(ply) return ply:GetNWString("usergroup") == "Donator" end,
CustomCheckFailMsg = "This job is donator only."
-- Donator Code / All players can see the job.
customCheck = function(ply) return CLIENT or ply:GetNWString("usergroup") == "Donator" end,
CustomCheckFailMsg = "This job is donator only."
-- SteamID Code / Only players with that SteamID can see the job.
customCheck = function(ply) return ply:SteamID() == "STEAM_***" end,
CustomCheckFailMsg = "This job is donator only."
-- SteamID Code / All players can see the job.
customCheck = function(ply) return CLIENT or ply:SteamID() == "STEAM_***" end,
CustomCheckFailMsg = "This job is donator only."
to add more steamids or ranks just do: or ply:SetamID() == "STEAM_***" ect.