• Moneyprinters for donators and up
    8 replies, posted
Here is my current code AddEntity("Money printer ", "normal_money_printer", "models/props_lab/reciever01a.mdl", 1500, 2, "/buymp1", nil, function(ply) return ply:GetNWString("usergroup") == "Donator" end) i want it to work with my other classes such as Super Donator, Mod, Admin, Super Admin. no i tried to do this v AddEntity("Money printer ", "normal_money_printer", "models/props_lab/reciever01a.mdl", 1500, 2, "/buymp1", nil, function(ply) return ply:GetNWString("usergroup") == "Donator", "super doantor", "mod", "admin", "super admin" end) but it still only works for donators only. [editline]11th February 2013[/editline] nvm it doesnt even work for donator ? anyone help me out here lol
[code]local a_groups = {["Donator"]=true,["super donator"]=true,["mod"]=true,["admin"]=true,["super admin"]=true}; AddEntity("Money printer ", "normal_money_printer", "models/props_lab/reciever01a.mdl", 1500, 2, "/buymp1", nil, function(ply) return a_groups[ply:GetNWString("usergroup")] or false end); [/code] Try that. I think it's necessary to point out 'donator' isn't a word, it's 'donor' and it's not spelled 'doantor' either.
[QUOTE=>>oubliette<<;39550009][code]local a_groups = {["Donator"]=true,["super donator"]=true,["mod"]=true,["admin"]=true,["super admin"]=true}; AddEntity("Money printer ", "normal_money_printer", "models/props_lab/reciever01a.mdl", 1500, 2, "/buymp1", nil, function(ply) return a_groups[ply:GetNWString("usergroup")] or false end); [/code] Try that. I think it's necessary to point out 'donator' isn't a word, it's 'donor' and it's not spelled 'doantor' either.[/QUOTE] yea i saw i spelled the super one wrong i just got up so... but thanks for your help btw [editline]11th February 2013[/editline] i tried it and it still says you are not allowed to buy this...
Jesus christ, don't use NWStrings... I would recommend making your gamemode from scratch or get immediate hate from the Facepunch community....
If that didn't work, your problem is elsewhere. I think your gamemode would benefit from a clean slate.
nvm just me as the owner cant get it witch doesn't bother me btw thanks for the help and im not dumb im simply working alone and have nobody but myself to test these things...
[QUOTE=SoY;39549900]Here is my current code AddEntity("Money printer ", "normal_money_printer", "models/props_lab/reciever01a.mdl", 1500, 2, "/buymp1", nil, function(ply) return ply:GetNWString("usergroup") == "Donator" end) i want it to work with my other classes such as Super Donator, Mod, Admin, Super Admin. no i tried to do this v AddEntity("Money printer ", "normal_money_printer", "models/props_lab/reciever01a.mdl", 1500, 2, "/buymp1", nil, function(ply) return ply:GetNWString("usergroup") == "Donator", "super doantor", "mod", "admin", "super admin" end) but it still only works for donators only. [editline]11th February 2013[/editline] nvm it doesnt even work for donator ? anyone help me out here lol[/QUOTE] If you are using ULX, use this at the bottom of your addentity: [lua] customCheck = function(ply) return ply:GetUserGroup() == "vip" or ply:GetUserGroup() == "secondgroup and so on." end [/lua] Here is an example: [lua] AddEntity("My custom printer", { ent = "money_printer_custom", model = "models/props_lab/reciever01b.mdl", price = 1, max = 1, cmd = "/buymyprinter", nil, customCheck = function(ply) return ply:GetUserGroup() == "vip" or ply:GetUserGroup() == "vip+" end }) [/lua]
Didnt mean to put dumb on those... my bad
I have the same issue. I have a bunch of money printers that work fine. But when I tried adding your code to make a VIP printer. I get an error, plus ALL of my money printer options disappear... *Erm, okay. Nevermind. It works! *
Sorry, you need to Log In to post a reply to this thread.