Raised This Month: $ Target: $400
 0% 

Run time error 4: Index out of bounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
NiQu
Veteran Member
Join Date: Nov 2009
Old 03-08-2010 , 12:55   Run time error 4: Index out of bounds
Reply With Quote #1

I got that thing in my server console...

Line's it gives this on is 540 and 2659:
FIXED! For others with this problem: Check if users are connected!

l540:
PHP Code:
F_Print(id"You got 10 dollars!"); //Line 540 
Function #1
PHP Code:
F_Print(id, const sMsg[], any:...)
{
    static 
iid id get_Player();
    if ( !
) return;
    
    new 
sMessage[256];
    new 
len formatex(sMessagesizeof(sMessage) - 1"^x04[%s %s]^x03 "PLUGIN_PREFIXVERSION);
    
vformat(sMessage[len], sizeof(sMessage) - lensMsg3);
    
sMessage[192] = '^0';
    
    static 
msgid_SayText;
    if ( !
msgid_SayText msgid_SayText get_user_msgid("SayText");
    
    new const 
team_Names[][] =
    {
        
"",
        
"TERRORIST",
        
"CT",
        
"SPECTATOR"
    
};
    
    new 
sTeam get_user_team(i);
    
    
team_Info(iidteam_Names[0]);
    
    
message_begin(id MSG_ONE_UNRELIABLE MSG_BROADCASTmsgid_SayText_id);
    
write_byte(i);
    
write_string(sMessage);
    
message_end();
    
    
team_Info(iidteam_Names[sTeam]); //Line 2659!

Function #2:
PHP Code:
team_Info(receiversendersTeam[])
{
    static 
msgid_TeamInfo;
    if ( !
msgid_TeamInfo msgid_TeamInfo get_user_msgid("TeamInfo");
    
    
message_begin(sender MSG_ONE_UNRELIABLE MSG_BROADCASTmsgid_TeamInfo_sender);
    
write_byte(receiver);
    
write_string(sTeam);
    
message_end();

Function #3:
PHP Code:
get_Player()
{
    for ( new 
id 1id <= gMaxPlayersid++ )
    {
        if ( 
gbConnected[id] )
        {
            return 
id;
        }
    }
    
    return 
0;

Please help , what can the problem be ?
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]

Last edited by NiQu; 03-09-2010 at 04:19.
NiQu 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 08:36.


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