Ulysses

General => Developers Corner => Topic started by: sabo on August 18, 2013, 10:27:14 AM

Title: Pointshop problem :I
Post by: sabo on August 18, 2013, 10:27:14 AM
Hello.

Currently I have a problem with my pointshop doing the following:

If you are a VIP you get -25% on all items.

Example: An item in the shop costs 100,000$

As VIP it is displayed as 75,000$ (because of the discount stated above)

The problem is that VIPs need to own 100,000$ in order to buy the item. The will spend only 75,000$ but yet they will need to have 100,000$ in the wallet.

Example: A VIP has 90,000$ and wants to buy the item which is displayed as 75,000$ and it does not work, he cant buy it at all.
If the VIP has more than the original price (100,000$) then he can buy it for 75,000$.


I hope I could state my problem as clear as possible and I hope you guys can help me.

Here is the discount code:

Code: [Select]
PS.Config.CalculateBuyPrice = function(ply, item)
-- You can do different calculations here to return how much an item should cost to buy.
-- There are a few examples below, uncomment them to use them.

-- Everything half price for admins:
-- if ply:IsAdmin() then return math.Round(item.Price * 0.5) end

-- 25% off for the 'donators' group
if ply:IsUserGroup('vip') then return math.Round(item.Price * 0.75) end


return item.Price
end

Thanks for reading! :-\
Title: Re: Pointshop problem :I
Post by: LuaTenshi on August 18, 2013, 12:06:56 PM
Seems like there is another section of code that checks if said person can afford the current item. Can you paste that part here too?
Title: Re: Pointshop problem :I
Post by: Decicus on August 18, 2013, 01:01:53 PM
Or at least post whatever pointshop you're using.