• DarkRP CustomCheck
    9 replies, posted
Hey guys! I'm using the newest github DarkRP Version, and Im trying to make a job wich is only for donator groups - the problem is theres more then one donator group; so How do I manage this? If I use: customCheck = function(ply) return ply:GetNWString("usergroup") == "donator" end Its no problem; the Job is then "donator" only; but If I use this: customCheck = function(ply) return ply:GetNWString("usergroup") == "donator" or "admin_don" or "supporter_don" end everyone is able to use this job! Why? FAdmin groups have the same name... What did I do wrong?
Which admin mod are you using?
You must repeat ply:GetNWString("") ... : [LUA] customCheck = function(ply) return ply:GetNWString("usergroup") == "donator" or ply:GetNWString("usergroup") == "admin_don" or ply:GetNWString("usergroup") == "supporter_don" end [/LUA] EDIT : It work ?
[CODE]TEAM_COOK = AddExtraTeam("Cook", { color = Color(238, 99, 99, 255), model = "models/player/mossman.mdl", description = [[As a cook, it is your responsibility to feed the other members of your city. You can spawn a microwave and sell the food you make: /Buymicrowave]], weapons = {}, command = "cook", max = 2, salary = 45, admin = 1, vote = false, hasLicense = false, --this comma here is important customCheck = function(ply) return ply:GetUserGroup() == "donator" or ply:GetUserGroup() == "superdonator" or ply:IsAdmin() end[/CODE] you can change "superdonator" to whatever you want. and if you want to add another rank just add: or ply:GetUserGroup() == "extrarank"
[QUOTE=k9o0df1;39398805][CODE]TEAM_COOK = AddExtraTeam("Cook", { color = Color(238, 99, 99, 255), model = "models/player/mossman.mdl", description = [[As a cook, it is your responsibility to feed the other members of your city. You can spawn a microwave and sell the food you make: /Buymicrowave]], weapons = {}, command = "cook", max = 2, salary = 45, admin = 1, vote = false, hasLicense = false, --this comma here is important customCheck = function(ply) return ply:GetUserGroup() == "donator" or ply:GetUserGroup() == "superdonator" or ply:IsAdmin() end[/CODE] you can change "superdonator" to whatever you want. and if you want to add another rank just add: or ply:GetUserGroup() == "extrarank"[/QUOTE] You forgot to end the AddExtraTeam function and the table inside it. And GetUserGroup is ULX only. He should use ply:IsUserGroup("rank") instead.
oh yeah, it's fadmin, but i didn't end it wrong, on my server it works properly
[QUOTE=k9o0df1;39413541]oh yeah, it's fadmin, but i didn't end it wrong, on my server it works properly[/QUOTE] Don't be stupid, it isn't ended at all.
do you mean the })? cause that's all i didn't add forgot to copy
Now using this: [CODE]customCheck = function(ply) return table.HasValue({"donator", "supporter_don", "admin_don", "superadmin"}, ply:GetNWString("usergroup")) end[/CODE] Works fine for me with FAdmin Groups; this also works on Shipments etc. BUT it doesn't work with entities - why? eg.: [CODE]AddEntity("Nuclear Money Printer", { ent = "nuclear_money_printer", model = "models/props_lab/reciever01a.mdl", price = 8000, max = 1, cmd = "/buymoneyprinterdonator", customCheck = function(ply) return table.HasValue({"donator", "supporter_don", "admin_don", "superadmin"}, ply:GetNWString("usergroup")) end })[/CODE] And Everyone is able to spawn the MoneyPrinter
#PUSH Still now information, DarkRP is up-to-date; falco is saying it's working on his server. So whats the problem? I dont get any errors, it just dont works...
Sorry, you need to Log In to post a reply to this thread.