Ulysses

General => Developers Corner => Topic started by: petturoidakko on March 27, 2015, 04:48:45 PM

Title: some of our jobs dissappeared from F4
Post 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.

Quote
})

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
Title: Re: some of our jobs dissappeared from F4
Post by: Caustic Soda-Senpai on March 27, 2015, 05:04:08 PM
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?
Title: Re: some of our jobs dissappeared from F4
Post by: petturoidakko on March 28, 2015, 03:55:48 AM
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?
Title: Re: some of our jobs dissappeared from F4
Post by: Caustic Soda-Senpai on March 28, 2015, 04:18:33 AM
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.)
Title: Re: some of our jobs dissappeared from F4
Post by: petturoidakko on March 28, 2015, 06:03:54 AM
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.
Title: Re: some of our jobs dissappeared from F4
Post by: Livaco on March 28, 2015, 07:00:41 AM
It Might Be The Custum Cheak
Title: Re: some of our jobs dissappeared from F4
Post by: XxLMM13xX on March 28, 2015, 07:11:29 AM
Where are you putting the code??? If it's in the darkrp files then that's the problem you need to have darkrp modification!
Title: Re: some of our jobs dissappeared from F4
Post by: petturoidakko on March 28, 2015, 07:56:50 AM
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.
Title: Re: some of our jobs dissappeared from F4
Post by: Aaron113 on March 28, 2015, 08:24:56 AM
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.
Title: Re: some of our jobs dissappeared from F4
Post by: XxLMM13xX on March 28, 2015, 09:40:42 PM
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!
Title: Re: some of our jobs dissappeared from F4
Post by: JamminR on March 28, 2015, 10:11:11 PM
I'm moving this to Developers corner, as I feel right now it's not so much how to use ULib or ULX.
Title: Re: some of our jobs dissappeared from F4
Post by: Caustic Soda-Senpai on March 29, 2015, 02:02:50 AM
MY advice: try removing the spaces from your groups. Humour me.
Title: Re: some of our jobs dissappeared from F4
Post by: Livaco on April 01, 2015, 07:55:03 AM
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
Title: Re: some of our jobs dissappeared from F4
Post by: Caustic Soda-Senpai on April 01, 2015, 09:00:29 AM
If you guys actually READ the code, you'd see he's using the check...
Title: Re: some of our jobs dissappeared from F4
Post by: Livaco on April 01, 2015, 09:39:29 AM
If you guys actually READ the code, you'd see he's using the check...
I Know
Title: Re: some of our jobs dissappeared from F4
Post by: -sG- Broccoli on April 01, 2015, 04:35:34 PM
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.
Title: Re: some of our jobs dissappeared from F4
Post by: XxLMM13xX on April 02, 2015, 05:13:29 PM
Ok so this is what i use... Use this:

Code: [Select]

-- 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.