Raised This Month: $ Target: $400
 0% 

set specific price for each player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Siveroo
Junior Member
Join Date: Apr 2020
Old 10-21-2020 , 23:25   set specific price for each player
Reply With Quote #1

so basically i have a custom shop, i wanna make it so that for every VIP, they will have some discount on that shop, my idea is that to make an array that will contain every price of every item for every player, so basically a 2d array. here's bit of my code..

Code:
enum _: COD_ITEM {     ITEM_EQUIPMENT,     ITEM_AMMO,     ITEM_BUFF,     ITEM_EXPERIENCE,     ITEM_PERK_I,     ITEM_PERK_II,     MAX_ITEM } new const cod_defaultPrice[MAX_ITEM] = {     8000,     8000,     10000,     16000,     8500,     10000 } new cod_itemPrice[33][MAX_ITEM]; public client_authorized(id) {     new flag = get_user_flags(id);     if (flag & ADMIN_LEVEL_E)     {         for (new item = 0; item < MAX_ITEM; item++)         {             cod_itemPrice[id][item] = cod_defaultPrice[item] *3 / 4         }     }     else     {         for (new item = 0; item < MAX_ITEM; item++)         {             cod_itemPrice[id][item] = cod_defaultPrice[item]         }     } }

now my question is that, using the code above, will there be any flaw or possible bug that will happen?

or maybe you can give me another example/code that does the same job in a better way

btw currently i cant test on multiplayer, but i need to get it done asap, that's why im asking it here in the first place

Last edited by Siveroo; 10-21-2020 at 23:27.
Siveroo is offline
 



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 13:52.


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