• Two customChecks on a job, in DarkRP
    6 replies, posted
Hi! I'm kind of a noob, but I can get things done. There's just this small issue that I'm having and I'd really appreciate it if somebody could help me out! So, in the jobs.lua, I have a rebel class and I only want it to appear if there is a Mayor. I actually have the customCheck for it, and I want to give credits to the person here: [url]http://forum.darkrp.com/threads/becoming-a-job-only-when-there-is-a-mayor.269/[/url] It works, but the problem is, is that I have another customCheck for it, and it's called isVIP. isVIP calls for a function that makes sure that your usergroup in ULX is vip or higher. I don't know how to exactly run both of these functions at the same time, which is what I need help with. I tried: [CODE] customCheck = isVIP, customCheck = fn.Compose{fn.Not, fn.Null, fn.Curry(fn.Filter, 2)(FindMetaTable("Player").isMayor), player.GetAll},[/CODE] but that didn't work out so well, haha. Sorry if this is confusing, I tried my best explaining. Anyways, I'd really appreciate any kind of help. Thanks for reading!
What way have you got the isVIP function set up?
[QUOTE=Bo98;44129825]What way have you got the isVIP function set up?[/QUOTE] Hi, thanks for your reply! It goes like this: [code]return ply:GetNetworkedBool("VIP") == true or ply:GetUserGroup() != "user"[/code]
Sorry, I should have specified I meant parameter-wise. Is it like this? [lua] function isVIP(ply) [/lua]
[QUOTE=Bo98;44129901]Sorry, I should have specified I meant parameter-wise. Is it like this? [lua] function IsVIP(ply) [/lua][/QUOTE] Exactly!
Try this: [lua] customCheck = fn.FAnd{fn.Compose{fn.Not, fn.Null, fn.Curry(fn.Filter, 2)(FindMetaTable("Player").isMayor), player.GetAll}, isVIP}, [/lua]
[QUOTE=Bo98;44130072]Try this: [lua] customCheck = fn.FAnd{fn.Compose{fn.Not, fn.Null, fn.Curry(fn.Filter, 2)(FindMetaTable("Player").isMayor), player.GetAll}, isVIP}, [/lua][/QUOTE] Thanks so much! It worked perfectly!
Sorry, you need to Log In to post a reply to this thread.