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