AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SLOVED] Run Time error 4 (https://forums.alliedmods.net/showthread.php?t=5822)

BigBaller 09-13-2004 19:27

[SLOVED] Run Time error 4
 
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.

BAILOPAN 09-13-2004 19:47

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.

BigBaller 09-13-2004 23:20

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

Monolyth 09-13-2004 23:56

Change the i<=maptypecount to i<maptypecount

BigBaller 09-14-2004 00:00

:) 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.


All times are GMT -4. The time now is 17:20.

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