Raised This Month: $ Target: $400
 0% 

Index out of bounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 08-15-2013 , 09:53   Index out of bounds
Reply With Quote #1

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" } }
Podarok 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 15:55.


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