So I had this idea where I wanted to offer ranks by points in the pointshop. I want to add an item that users can buy that would be a price like 50,000 points and they can use their points to buy the rank "VIP" or something similar. Is there anyway to do this or are there any addons like this out already?
Extremely easily accomplished, a simple setusergroup function for each admin mod inside the onbuy function on the item.
Edit:
ninja'd
So on ITEM:OnEquip I would add something similar to ply:SetUserGroup("VIP")?
[QUOTE=bluebull107;46041725]So on ITEM:OnEquip I would add something similar to ply:SetUserGroup("VIP")?[/QUOTE]Use ITEM:OnBuy
So would something simple like this work?
[lua]
ITEM.Name = 'Buy VIP'
ITEM.Price = 100000
ITEM.Material = 'vgui/something/VIP.png'
ITEM.OneUse = true
function ITEM:OnBuy(ply, modifications)
ply:ChatPrint("Congratulations on buying VIP!")
if SERVER then
ply:SetUserGroup("VIP")
end
end
function ITEM:OnSell(ply)
if SERVER then
ply:SetUserGroup("member")
end
end
[/lua]
[editline]21st September 2014[/editline]
It worked!
Thanks for all of your help!
Sorry, you need to Log In to post a reply to this thread.