Dudes, how can I store the weapon's price in an array? And how can I check if the item that you've bought isn't these:
PHP Code:
const INVALID_ITEMS_BOUGH = ((1<<CSW_DEFUSER)|(1<<CSW_NVGS)|(1<<CSW_SHIELD)|(1<<CSW_PRIMAMMO)|(1<<CSW_SECAMMO))
I'm using client_buy forward by Connor.
PHP Code:
public client_buy(id, iItem)
{
if(!(1 << iItem & INVALID_ITEMS_BOUGH))
{
PlayerData[id][arItemsBought]++
if(PlayerData[id][arItemsBought] > 3)
{
new randomChance = random_num(0,MAX_CHANCE)
if(randomChance == MAX_CHANCE)
{
gUserEventName = id
get_user_name(gUserEventName,PlayerData[id][PlayerName],charsmax(PlayerData[]))
eVents = ev_ItemsBought
}
}
if(PlayerData[id][arMoneyWornOut] >= 4500)
{
new randomChance = random_num(0,MAX_CHANCE)
if(randomChance == MAX_CHANCE)
{
gUserEventName = id
get_user_name(gUserEventName,PlayerData[id][PlayerName],charsmax(PlayerData[]))
eVents = ev_MoneyWornOut
}
}
}
}
__________________