Raised This Month: $ Target: $400
 0% 

index out of bounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dEMolite
Member
Join Date: Feb 2006
Old 02-14-2007 , 17:09   index out of bounds
Reply With Quote #1

Hi Guys i become this littel fucking error in ct_show_timer (line 1336)

Code:
if( climbstatus[id] == CT_STATUS_NONE ) {         new hud_text[256]                 set_hudmessage( 54, 113, 156, 0.3, 0.0, 0, 0.0, 5.0, 0.0, 0.5, 1 )         if(gChecks[id] > 1)         {             format( hud_text, 255, "[ Time: 00:00 | Status: None | Checkpoint: %s ]",gChecks[id] )         }else{             format( hud_text, 255, "[ Time: 00:00 | Status: None | Checkpoint: 0 ]" )         }         show_hudmessage( id, hud_text )                 return PLUGIN_HANDLED     }

I hope anyone can help me.
dEMolite is offline
Howdy!
Senior Member
Join Date: Feb 2007
Old 02-14-2007 , 17:19   Re: index out of bounds
Reply With Quote #2

(ban this user)
__________________
[IMG]http://img221.**************/img221/5608/howdyfinnishhq2.jpg[/IMG]

Last edited by Howdy!; 03-15-2007 at 17:51.
Howdy! is offline
dEMolite
Member
Join Date: Feb 2006
Old 02-14-2007 , 17:20   Re: index out of bounds
Reply With Quote #3

nothing only in game the Runtime Error 4: index out of bounds
dEMolite is offline
lunarwolfx
Member
Join Date: Feb 2005
Old 02-14-2007 , 18:34   Re: index out of bounds
Reply With Quote #4

which one is like 1336?
lunarwolfx is offline
dEMolite
Member
Join Date: Feb 2006
Old 02-15-2007 , 14:34   Re: index out of bounds
Reply With Quote #5

This ones:
if( climbstatus[id] == CT_STATUS_NONE ) {
dEMolite is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 02-15-2007 , 14:46   Re: index out of bounds
Reply With Quote #6

Post the whole function not just that section of the code and what is calling that function.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 02-15-2007 , 16:20   Re: index out of bounds
Reply With Quote #7

Code:
format( hud_text, 255, "[ Time: 00:00 | Status: None | Checkpoint: %s ]",gChecks[id] )
should be
Code:
format( hud_text, 255, "[ Time: 00:00 | Status: None | Checkpoint: %i ]",gChecks[id] )
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
dEMolite
Member
Join Date: Feb 2006
Old 02-15-2007 , 17:43   Re: index out of bounds
Reply With Quote #8

Okay here for teamme06
This is the funktion
Code:
public ct_show_timer(id) {     if( !climbtimer_on )         return PLUGIN_CONTINUE         if( climbstatus[id] == CT_STATUS_NONE ) {         new hud_text[300]             set_hudmessage( 54, 113, 156, 0.3, 0.0, 0, 0.0, 0.5, 0.0, 0.0, 4 )         if(gChecks[id] > 1)         {             format( hud_text, 299, "[ Time: 00:00 | Status: None | Checkpoint: %s ]",gChecks[id] )             //show_hudmessage( i, "[ Time: 00:00 | Status: None | Checkpoint: %s ]",gChecks[i] )         }else{             format( hud_text, 299, "[ Time: 00:00 | Status: None | Checkpoint: 0 ]" )             //show_hudmessage( i, "[ Time: 00:00 | Status: None | Checkpoint: 0 ]" )         }         show_hudmessage( id, hud_text )             return PLUGIN_HANDLED     }     if( climbstatus[id] == CT_STATUS_CLIMBING ) {         new hud_text[256]             set_hudmessage( 54, 113, 156, 0.3, 0.0, 0, 0.0, 5.0, 0.0, 0.5, 4 )         if(gChecks[id] > 1)         {             //show_hudmessage( i, "[ Time: %d:%02d | Status: Climbing | Checkpoint: %s ]", (climbtime/60) , (climbtime%60),gChecks[i] )             format( hud_text, 255, "[ Time: %d:%02d | Status: Climbing | Checkpoint: %s ]", (climbtime/60) , (climbtime%60),gChecks[id] )         }else{             //show_hudmessage( i, "[ Time: %d:%02d | Status: Climbing | Checkpoint: 0 ]", (climbtime/60) , (climbtime%60),gChecks[i] )             format( hud_text, 255, "[ Time: %d:%02d | Status: Climbing | Checkpoint: 0 ]", (climbtime/60) , (climbtime%60),gChecks[id] )         }         show_hudmessage( id, hud_text )                     return PLUGIN_HANDLED       }     if( climbstatus[id] == CT_STATUS_FINISHED ) {         new hud_text[256]             set_hudmessage( 54, 113, 156, 0.3, 0.0, 0, 0.0, 5.0, 0.0, 0.5, 4 )         if(gChecks[id] > 1)         {             format( hud_text, 255, "[ Time: %d:%02d | Status: Finished | Checkpoint: %s ]", (climbertime[id]/60) , (climbertime[id]%60),gChecks[id] )         }else{             format( hud_text, 255, "[ Time: %d:%02d | Status: Finished | Checkpoint: 0 ]", (climbertime[id]/60) , (climbertime[id]%60),gChecks[id] )         }         show_hudmessage( id, hud_text )                 return PLUGIN_HANDLED       }     return PLUGIN_HANDLED }

And this is how i call it in plugininit
Code:
set_task(0.5, "ct_show_timer", id+334490, "", 0, "b", 0);

Last edited by dEMolite; 02-15-2007 at 17:46.
dEMolite is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 02-15-2007 , 18:28   Re: index out of bounds
Reply With Quote #9

Code:
public ct_show_timer(id) {     if( !climbtimer_on )         return PLUGIN_CONTINUE     // if your going to pass the id with task id.     You need to subtract it out later. So your way out of bounds.     id -= 334490;
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
dEMolite
Member
Join Date: Feb 2006
Old 02-16-2007 , 13:37   Re: index out of bounds
Reply With Quote #10

with id -= 334490 works.
Thanks team06 you helped me alot ;)
dEMolite is offline
Reply



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 00:43.


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