AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Index out of Bounds (https://forums.alliedmods.net/showthread.php?t=144012)

shuttle_wave 11-27-2010 18:38

Index out of Bounds
 
L 11/28/2010 - 12:31:19: [AMXX] Displaying debug trace (plugin "JailBreak_MainMod_Core.amxx")
L 11/28/2010 - 12:31:19: [AMXX] Run time error 4: index out of bounds
L 11/28/2010 - 12:31:19: [AMXX] [0] JailBreak_MainMod_Core.sma::task_ShowDay (line 915)


PHP Code:

public task_ShowDay(id)
{
    if(
get_pcvar_num(p_DayCounter))
    {
        
set_hudmessage(255255255, -1.00.35__4.01.01.0);
        
ShowSyncHudMsg(idg_msgSyncHud"%L^n%L"id"DAY_HUD"g_iDayCounteridg_szDisplayDayName[g_iDayPassed]);
        
        if(
g_iTeam[id] == CS_TEAM_T)
            
client_printc(id"%L %L"id"PREFIX"id"DAY_MSG"g_iDayCounteridg_szDisplayDayName[g_iDayPassed]);
        
        else if(
g_iTeam[id] == CS_TEAM_CT)
            
client_printc(id"%L %L"id"PREFIX"id"DAY_GUARD"g_iDayCounteridg_szDisplayDayName[g_iDayPassed]);
    }
    
    if(
get_pcvar_num(p_CrimeSystem))
    {    
        if(
g_iCrimeName[id] == 0
            
g_iCrimeName[id] = random_num(0g_iCrime-1);
        
        if(
g_iTeam[id] == CS_TEAM_T)
            
client_printc(id"%L %L"id"PREFIX"id"CRIME_MSG"g_sCrime[g_iCrimeName[id]]);
    }



PHP Code:

new const g_szDisplayDayName[7][] =
{
    
"DAY_SUNDAY",
    
"DAY_MONDAY",
    
"DAY_TUESDAY",
    
"DAY_WEDNESDAY",
    
"DAY_THURSDAY",
    
"DAY_FRIDAY",
    
"DAY_SATURDAY"
}; 


YamiKaitou 11-27-2010 18:43

Re: Index out of Bounds
 
Without you telling us which line is 915, we can't help you

shuttle_wave 11-27-2010 18:57

Re: Index out of Bounds
 
PHP Code:

ShowSyncHudMsg(idg_msgSyncHud"%L^n%L"id"DAY_HUD"g_iDayCounteridg_szDisplayDayName[g_iDayPassed]); 


Arkshine 11-27-2010 19:27

Re: Index out of Bounds
 
Debug g_iDayPassed and try to understand why it's out of bounds.

shuttle_wave 12-16-2010 22:41

Re: Index out of Bounds
 
i dont get why is this index out of bounds.


PHP Code:

if(g_bLr[iKiller] && iVictim != iKiller


fysiks 12-16-2010 22:47

Re: Index out of Bounds
 
Quote:

Originally Posted by shuttle_wave (Post 1372530)
i dont get why is this index out of bounds.


PHP Code:

if(g_bLr[iKiller] && iVictim != iKiller


Either show the whole code or learn how to debug (print the value of "iKiller").

shuttle_wave 12-16-2010 22:48

Re: Index out of Bounds
 
CODE REMOVED.

fysiks 12-16-2010 22:50

Re: Index out of Bounds
 
Quote:

Originally Posted by fysiks (Post 1372536)
Either show the whole code or learn how to debug (print the value of "iKiller").


shuttle_wave 12-16-2010 22:52

Re: Index out of Bounds
 
how wound i print value of ikiller?

Kreation 12-16-2010 22:55

Re: Index out of Bounds
 
Quote:

Originally Posted by shuttle_wave (Post 1372541)
how wound i print value of ikiller?

client_print


All times are GMT -4. The time now is 11:16.

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