AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Run time error 4: index out of bounds (https://forums.alliedmods.net/showthread.php?t=274832)

Michell 11-15-2015 14:24

[HELP] Run time error 4: index out of bounds
 
PHP Code:

public MenuHandler(id,iMenu,iKey){
    new 
sName[32];
        
get_user_name(id,sName,charsmax(sName));
    
    
g_iVotes[iKey]++;
    

    
    return 
PLUGIN_HANDLED;



Bugsy 11-15-2015 14:26

Re: [HELP] Run time error 4: index out of bounds
 
g_iVotes[] is not sized large enough to handle the max iKey value specified to it.

Michell 11-15-2015 14:33

Re: [HELP] Run time error 4: index out of bounds
 
? wan

HamletEagle 11-15-2015 14:44

Re: [HELP] Run time error 4: index out of bounds
 
Show how you created g_iVotes

Michell 11-15-2015 14:49

Re: [HELP] Run time error 4: index out of bounds
 
? wn


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

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