Raised This Month: $ Target: $400
 0% 

Strange problem "Run time error 4: index out of bounds"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 11-07-2011 , 14:26   Re: Strange problem "Run time error 4: index out of bounds"
Reply With Quote #2

You get index out of bounds either on iPtz or item_cost

If you can't find the error yourself only with looking at the code and you can't post more code then you should start debugging it like this:
PHP Code:
 if(is_user_connected(id)) {
     if(
id >= sizeof iPtz)
         
log_amx("id value (%d) out of bounds, should be (0..%d)"idsizeof iPtz -1)
     if(
get_info >= sizeof item_cost || get_info 0)
         
log_amx("get_info value (%d) out of bounds, should be (0..%d)"get_infosizeof item_cost -1)
     
iPtz[id] -= item_cost[get_info];
 } 
__________________
Impossible is Nothing

Last edited by Emp`; 11-07-2011 at 15:19. Reason: small fix
Sylwester 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 14:20.


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