Raised This Month: $ Target: $400
 0% 

[SLOVED] Run Time error 4


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 09-13-2004 , 19:27   [SLOVED] Run Time error 4
Reply With Quote #1

Quote:
L 09/13/2004 - 18:21:11: [AMXX] Run time error 4 on line 3871 (plugin "mapmanager.amxx")
I looked at that line, and well that is the very end of the plugin. What does that exactly mean "error 4"

It would help to know what this error was soo I can fix it up.
__________________

BigBaller is offline
BAILOPAN
Join Date: Jan 2004
Old 09-13-2004 , 19:47  
Reply With Quote #2

1. If this is 0.20, make sure you've put the plugin i ndebug mode (look in RC5 release thread).

2. Runtime error 4 means you tried to access a member of an array that was out of bounds.
__________________
egg
BAILOPAN is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 09-13-2004 , 23:20  
Reply With Quote #3

Ok bailopan I will try debug mode, I forgot about doing that, I am pretty tired

Quote:
L 09/13/2004 - 22:23:08: [AMXX] Run time error 4 on line 1894 (plugin "mapmanager.amxx")
L 09/13/2004 - 22:23:10: [AMXX] Run time error 4 on line 1894 (plugin "mapmanager.amxx")
Ok, soo that is the out come of debug mode.

I zoom to that line and this is the block of code that has to deal with it.

Code:
public HandleSay(id) {         new chat[256]         read_args(chat, 256)         new saymap[256]         new i = 0         saymap=chat         remove_quotes(saymap)         new saymap2[28]         read_args(saymap2,28)         remove_quotes(saymap2)         new chat2[32]         if(containi(chat, "<")!=-1||containi(chat, "?")!=-1||containi(chat, ">")!=-1||containi(chat, "*")!=-1||containi(chat, "&")!=-1||containi(chat, ".")!=-1)         {                 return PLUGIN_CONTINUE         }         if(containi(chat, "nominations") != -1)         {                 if(mselected)                 {                         client_print(id,print_chat, "[AMXX] Vote in progress...")                 }                 else                 {                         if(nmaps_num==0)                         {                                 client_print(id,print_chat, "[AMXX] No maps have been nominated so far, type nominate map_name to nominate a map.")                         }                         else                         {                                 listnominations(id)                         }                 }         }         else         {                 if(containi(chat, "nominate ") == 1)                 {                         new mycommand[32]                         read_args(mycommand,32)                         remove_quotes(mycommand)                         handle_andchange(id,mycommand[9])                 }                 else                 {                         if(containi(chat, "vote ") == 1)                         {                                 new mycommand[32]                                 read_args(mycommand,32)                                 remove_quotes(mycommand)                                 handle_andchange(id,mycommand[5])                         }                         else                         {                                 if(is_map_valid(saymap)==1)                                 {                                         handle_nominate(id,saymap)                                 }                                 else                                 {                                                                         while( i <= maptypecount )                                         {                                                 format(chat2,31,"%s_%s",maptypes[i],saymap2)                                                 if(is_map_valid(chat2)==1)                                                 {                                                         i = 6                                                 }                                                 i++                                         }                                         if(i > maptypecount+1)                                         {                                                 handle_nominate(id,chat2)                                         }                                         else                                         {                                                 return PLUGIN_CONTINUE                                         }                                 }                         }                 }         }         return PLUGIN_CONTINUE }

The exact line debug mode lists is this line

Code:
format(chat2,31,"%s_%s",maptypes[i],saymap2)

Any ideas?

Edit

I am going to guess maptypes[i] is the invalid array.

Edit AGain

I looked around and found on line 44/45

Code:
// Added by Monolyth new maptypes[5][] = {"cs","de","as","dod","fy"} new maptypecount = 5
__________________

BigBaller is offline
Monolyth
Member
Join Date: Jul 2004
Location: Midwest, USA
Old 09-13-2004 , 23:56  
Reply With Quote #4

Change the i<=maptypecount to i<maptypecount
Monolyth is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 09-14-2004 , 00:00  
Reply With Quote #5

just the person I was looking for hehe.

I will do that and test it out on debug mode again to see what I come up with.

EDIT

Woot, no more errors being logged in the debug mode, time to go see how it is running on the server and such.
__________________

BigBaller 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 17:20.


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