Raised This Month: $ Target: $400
 0% 

VoteMenu - index out of bounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-09-2015 , 04:28   VoteMenu - index out of bounds
Reply With Quote #1

I'm have a vote days.

And I get in votemenu handler always full error of this:

Code:
L 01/09/2015 - 11:17:12: [AMXX] Displaying debug trace (plugin "test_votedays.amxx")
 L 09/01/2015 - 11:17:12: [AMXX] Run time error 4: index out of bounds
 L 01/09/2015 - 11:17:12: [AMXX] [0] test_votedays.sma :: CmdVoteMenu_Handler ()

code
:
Code:
new g_iSelectedDays[ 4 ], g_iVotes[ 4 ], g_iPlayersVotes[ 33 ];
PHP Code:
public CmdVoteMenu_HandlerclientiMenuitem )
{
    if ( 
item != MENU_EXIT )
    {
        if ( !
g_iCounter )
            return 
1;
    
        if ( 
g_iPlayersVotesclient ] != DAY_NONE )
            return 
1;
            
        
g_iPlayersVotesclient ] = g_iSelectedDaysitem ];
        
        
g_iVotesitem ]++;
        
        
ColorChatclientRED"%s You have Voted to^x04 %s^x01."g_szPrefixg_szDaysDatag_iSelectedDaysitem ] ][ m_DayName ] );
    }
    
    return 
1;
}

public 
CmdEndVote()
{
    
g_iCurrentDay GetHighestVoteg_iVotessizeof g_iVotes );
    
    if ( 
g_iCurrentDay == -)
    {
        
ColorChat0RED"%s The vote has^x03 failed^x01, choosing random day."g_szPrefix );
        
        
g_iCurrentDay g_iSelectedDaysrandomsizeof g_iSelectedDays ) ];
        
        
ColorChat0RED"%s The random day is:^x04 %s^x01."g_szPrefixg_szDaysDatag_iCurrentDay ][ m_DayName ] );
    }
    
    else
    {        
        
ColorChat0RED"%s The winning day is^x04 %s^x01, with^x03 %i votes^x01."g_szPrefixg_szDaysDatag_iSelectedDaysg_iCurrentDay ] ][ m_DayName ], g_iVotesg_iCurrentDay ] );
        
        
g_iCurrentDay g_iSelectedDaysg_iCurrentDay ];
    }    
    
    
StartDayg_iCurrentDay );

Line Error:
Code:
        ColorChat( client, RED, "%s You have Voted to^x04 %s^x01.", g_szPrefix, g_szDaysData[ g_iSelectedDays[ item ] ][ m_DayName ] );

Last edited by Fuck For Fun; 04-24-2015 at 20:44. Reason: Trash IT
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
 



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 15:24.


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