So I have got a menu and prices for it and in handler i remove amout of money required to buy item, but console is showing me an error : Index is out of bounds, how can I cope with it ?
Code:
public shopmenu_handler( id, menu, item ) {
if( item == MENU_EXIT ) {
menu_destroy( menu );
return PLUGIN_HANDLED;
}
new money = cs_get_user_money(id)
cs_set_user_money(id, money-str_to_num(g_Cost[item])) // <----- This Line
Code:
static const g_Cost[][] = {
{ "10000" },
{ "13000" },
{ "16000" },
{ "7500" },
{ "7000" },
{ "12000" },
{ "7500" },
{ "15000" },
{ "16000" }
}