So, This is actually really frustrating considering I have spent such a long time trying to figure out why. All the printers I have are working, except I cant spawn the vip, vip+, and Legendary exclusive printers even when I have
customCheck = function(ply) return CLIENT or table.HasValue({"VIP+"}, ply:GetUserGroup()) or ply:IsAdmin() end,
CustomCheckFailMsg = "You must be a VIP+ to become this job!",
This is the full length code. Please tell me what I can do. I cant see custom check fail message and it wont spawn the printer, period. (Yes I am set to superadmin)
timer.Simple(4, function()
DarkRP.createCategory{
name = "Circle Printers",
categorises = "entities",
startExpanded = true,
color = Color(0, 119, 255, 255),
canSee = function(ply) return true end,
sortOrder = 1
}
DarkRP.createEntity("Level 1 Printer", {
ent = "lvl1",
model = "models/props_c17/consolebox01a.mdl",
price = 2000,
max = 2,
category = "Circle Printers",
cmd = "buylevelone"
})
DarkRP.createEntity("Level 2 Printer", {
ent = "lvl2",
model = "models/props_c17/consolebox01a.mdl",
price = 10000,
max = 2,
category = "Circle Printers",
cmd = "buyleveltwo"
})
DarkRP.createEntity("Level 3 Printer", {
ent = "lvl3",
model = "models/props_c17/consolebox01a.mdl",
price = 35000,
max = 2,
category = "Circle Printers",
cmd = "buylevelthree"
})
DarkRP.createEntity("VIP Printer", {
ent = "VIP",
model = "models/props_c17/consolebox01a.mdl",
price = 100000,
max = 2,
category = "Circle Printers",
customCheck = function(ply) return CLIENT or table.HasValue({"VIP"}, ply:GetUserGroup()) or ply:IsAdmin() end,
CustomCheckFailMsg = "You must be a VIP to become this job!",
cmd = "buyvipprint"
})
DarkRP.createEntity("VIP+ Printer", {
ent = "VIP+",
model = "models/props_c17/consolebox01a.mdl",
price = 250000,
max = 2,
category = "Circle Printers",
customCheck = function(ply) return CLIENT or table.HasValue({"VIP+"}, ply:GetUserGroup()) or ply:IsAdmin() end,
CustomCheckFailMsg = "You must be a VIP+ to become this job!",
cmd = "buyvippprint"
})
DarkRP.createEntity("Legendary Printer", {
ent = "Legendary",
model = "models/props_c17/consolebox01a.mdl",
price = 400000,
max = 2,
category = "Circle Printers",
customCheck = function(ply) return CLIENT or table.HasValue({"Legendary"}, ply:GetUserGroup()) or ply:IsAdmin() end,
CustomCheckFailMsg = "You must be a Legendary to become this job!",
cmd = "buylegendary"
})
end)
Any help would be much appriciated!
So... just to be clear... you can buy level printer 1-3, correct?
Yes I can
I usually try not to spoon feed code but...
function(ply) return CLIENT or ply:IsUserGroup("VIP") or ply:IsAdmin() end,
what you're trying to do is use the entities properties to determine rather or not the player entity is VIP or not. At least that's what it looks like to me. You can use the printer entity to set the player entity.
The code that I provided is looking for the Player entities usergroup. If they aren't VIP or admin then they can't spawn it.
Player UserGroup VIP should include VIP, VIP+, Legendary etc. Unless you have Usergroups separated by VIP, VIP+, and Legendary. Then it would be the same values respectively. Just make sure you're calling player's usergroup not the entity's name.
Alright, I'll try this out. Thanks for teaching me something new!
is "VIP" really the entity's classname?
I never used Failmessage.
Spawning depends on which usergroup you are in
I'm using
customCheck = function(ply) return
table.HasValue({TEAM_SECURITY, TEAM_POLICE, TEAM_CHIEF, TEAM_SLEAD, TEAM_SNIPE, TEAM_SWAT, TEAM_PMC}, ply:Team())
end,
Donator Entities
Make sure the Usergroup VIP actually exists
Yknow what, you just answered my question. I was rushing this through so thats probably my answer. I'll make sure to check it out when I can and I'll let you know.
Sorry, you need to Log In to post a reply to this thread.