Raised This Month: $51 Target: $400
 12% 

Solved Shop Discount


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mixtaz
Junior Member
Join Date: Sep 2017
Old 01-01-2018 , 12:11   Shop Discount
Reply With Quote #1

Hello to everybody reading this thread right now.

I've came across a splendid idea, which would be great addition to my already done plugin.

The thing is that I wanted to create discount in my shop (using % as value) for each kill they make, so whenever they kill another player, they get -1% for all items in the shop.

I've already made an example of that code and even took attempt to do that however I failed because I didn't know how to state the regressing price on the menu.

Perhaps you would give me advice on how to do that or even edit the code by yourself and show me the results.

Don't mind that I used my national language on it.

Last edited by Mixtaz; 01-03-2018 at 07:47. Reason: Removing the source for safety reasons, thx for help
Mixtaz is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-01-2018 , 13:20   Re: Shop Discount
Reply With Quote #2

Here's the easiest way.
Code:
// global vars float gKill[33] = 1.0 float gDiscount[33] new gPrintDiscount[33] gKill[id] -= 0.01 // on client_kill gPrintDiscount[id]++ // on client_kill new full_price = 16000 // price of item gDiscount[id] = full_price * gKill[id] // new price if (gKill[id] <= 0) gDiscount[id] = 0; // free item, after 100 kills; if (gPrintDiscount[id] > 100) gPrintDiscount[id] = 100;
__________________
Relaxing is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-01-2018 , 13:21   Re: Shop Discount
Reply With Quote #3

If you want to use my shop, I can easily make such a thing happen because it has an option to set a discount for players. Here's an example for VIP discount using a sub-plugin.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Mixtaz
Junior Member
Join Date: Sep 2017
Old 01-02-2018 , 10:42   Re: Shop Discount
Reply With Quote #4

Hello, I have either good and bad news, without further do I will start with the good one first:

So I finally managed to make my plugin work properly, the biggest accomplishment was certainly putting variables into menu which was literally painful at the first glance. But here I am with fully working plugin, nothing else I need.

Although, the bad one is that I didn't use none of yours code, I am grateful for helping me nonetheless, I would say that your contribution wasn't at all wasted cause it was an epiphany for me to get through my code.

Thanks, I wish you all great 2018.
Mixtaz is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-02-2018 , 12:08   Re: Shop Discount
Reply With Quote #5

Best reply to start 2018.
Figuring out stuff by yourself.
__________________

Last edited by Relaxing; 01-02-2018 at 12:08. Reason: to
Relaxing is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode