Jump to content

Bug MD in Itemshop


Recommended Posts

Hi I have a problem a pj in mi server is giving him MD whit a bug. He tell me that make whit a negative form. For example in shop have potions soo you can put how much you whant until 200. He put - and give him MD. Here is the function I think is bad but Idk how to put to work good.

 

				if tonumber(date_[1]) != 0 then -- got an end date
					timeLeft = itemshop_v2.currentTimeDiff(date_)
					if itemshopItem[1].percent > 0 and timeLeft <= 0 then -- has percent and if the timeleft is <= 0 then set percent = 0
						itemshopItem[1].percent = 0
					end
				end
				
				local amount = tonumber(cmd[3])
				if not pc.enough_inventory(itemshopItem[1].vnum) then syschat'No tienes suficiente espacio para hacer una compra.' return end
				if amount > 200 then syschat'El numero maximo es 200.' return end
				local coins = itemshop.get_coins()
				local realPrice = math.floor((itemshopItem[1].price*amount) - (((itemshopItem[1].price*amount) / 100 ) * itemshopItem[1].percent))
				if coins < realPrice then syschat'No tienes suficiente MD' return end
				local newCoins = coins-realPrice

 

Link to comment
Share on other sites

hace 6 horas, Shang dijo:

Easy to understand, BYTE datatype is from 0 to 254, you can not make it negative so it gives you a positive number.

if amount < 1 then

    return

end

Btw, too nerve to ask for support from a leak.

Soo if I add bellow here: 

if amount > 200 then syschat'El numero maximo es 200.' return end

This:

if amount > 200 then syschat'El numero maximo es 200.' return end
if amount < 1 then syschat'No esta permitido hacer esto.' return end

It will work fine? 

P.D: Yeah is your itemshop I think :( if you fell bad send me your paypal and I will pay you for this help. I dont own the system but like all the thinks was on internet. Thanks

Link to comment
Share on other sites

hace 6 horas, AlCapone dijo:

Soo if I add bellow here: 


if amount > 200 then syschat'El numero maximo es 200.' return end

This:


if amount > 200 then syschat'El numero maximo es 200.' return end
if amount < 1 then syschat'No esta permitido hacer esto.' return end

It will work fine? 

P.D: Yeah is your itemshop I think :( if you fell bad send me your paypal and I will pay you for this help. I dont own the system but like all the thinks was on internet. Thanks

Is not my itemshop, but I know how developers feel when their work goes leak and people asks for support.

hace 23 minutos, Fleon dijo:

if (amount > 200 || amount < 1) then {
	syschat('Error processing your request, the max amount is set to 200.'); 
	return end
}

 

Is not c++ btw.

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.