Raised This Month: $51 Target: $400
 12% 

Plugin encountered error 15: Array index is out of bounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pchun
Member
Join Date: Sep 2013
Old 12-16-2013 , 10:36   Plugin encountered error 15: Array index is out of bounds
Reply With Quote #1

Error log:

PHP Code:
L 12/16/2013 22:40:57: [SMPlugin encountered error 15: Array index is out of bounds
L 12
/16/2013 22:40:57: [SMDisplaying call stack trace for plugin "KZMod.smx":
L 12/16/2013 22:40:57: [SM]   [0]  Line 279KZMod/hooks.sp::OnPlayerRunCmd() 

PHP Code:
        //Strafe Count
        
for (new 0MAX_BUTTONSi++)
        {
            new 
button = (<< i);    
            if ((
buttons button)) 
            {
                if (!(
g_lastButtons[client] & button)) 
                {
                    if (
button == IN_MOVERIGHT || button == IN_MOVELEFT)
                    {
                        
g_strafecount[client]++; 
279                        g_strafe_good_sync[client][g_strafecount[client]-1] = 0.0;
                        
g_strafe_frames[client][g_strafecount[client]-1] = 0.0;                    
                    }
                }
            } 
        } 
hooks.sp
PHP Code:
// - PlayerSpawn -
public Action:Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if(
client != && (GetClientTeam(client) > 1) && g_bPluginEnabled == true)
    {
        
g_bPlayerJumped[client] = false;
        
g_teamID[client] = GetClientTeam(client);
        
        
//NoBlock
        
if(g_bNoBlock)
            
SetEntData(clientFindSendPropOffs("CBaseEntity""m_CollisionGroup"), 24true);
        else
            
SetEntData(clientFindSendPropOffs("CBaseEntity""m_CollisionGroup"), 54true);
                    
        
//remove weapons
        
if (g_bCleanWeapons)
            
GiveWeaponFunc(client,"weapon_knife");
                
        
//challenge start pos
        
GetClientAbsOrigin(clientg_fCStartPosition[client]);
        
        
//MapStart
        
if (g_bMapStart[client] == true)        
            
CreateTimer(0.1Connectedclient);
        
        
//restore position
        
if (g_bRestoreC[client] == true)
        {
            
TeleportEntity(clientg_fPlayerCordsRestore[client],g_fPlayerAnglesRestore[client],NULL_VECTOR);
            
g_bRestoreC[client]  = false;
        }

        if (
g_bRespawnPosition[client] == true)
        {
            
TeleportEntity(clientg_fPlayerCordsRestore[client],g_fPlayerAnglesRestore[client],NULL_VECTOR);
            
g_bRespawnPosition[client] = false;
        }        
        
        
//jumpstats: teleporter block 
        
GetClientAbsOrigin(clientg_fPosOld[client]);
        
        
//hide radar
        
CreateTimer(0.0HideRadarclient);
    
        
//set clantag
        
CreateTimer(3.0SetClanTagclient);
        
        
//set speclist
        
Format(g_szSpecList[client], 512"");        

        if (
g_bTeleMenuOpen2[client])
        {
            
g_bTeleMenuOpen2[client] = false;
            
TeleMenu(client);
        }    

        
//godmode
        
if (g_bgodmode)
            
SetEntProp(clientProp_Data"m_takedamage"01);
        else
            
SetEntProp(clientProp_Data"m_takedamage"21);
    }
    
}

public 
Action:EventTeamChange(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
team GetEventInt(event"team");
    if(
client && IsClientInGame(client) && !IsFakeClient(client) && (team == 1))
    {
        
GetClientAbsOrigin(client,g_fPlayerCordsRestore[client]);
        
GetClientEyeAngles(clientg_fPlayerAnglesRestore[client]);
        
g_bRespawnPosition[client] = true;
        if (
g_bTimeractivated[client] == true)
        {    
            
g_fStartPauseTime[client] = GetEngineTime();
            if (
g_fPauseTime[client] > 0.0)
            
g_fStartPauseTime[client] = g_fStartPauseTime[client] - g_fPauseTime[client];    
        }
        
g_bSpectate[client] = true;
        
g_bPause[client]=false;
    }
}

public 
OnMapVoteStarted()
{
       for(new 
client 1client <= MAXPLAYERSclient++)
    {
        
g_bMenuOpen[client] = true;
        
g_bTeleMenuOpen[client] = false;
    }
}

public 
Action:Hook_SetTransmit(entityclient

    if (
client != entity && (entity <= MaxClients) && IsClientInGame(client) && g_bHide[client]) 
        return 
Plugin_Handled
     
    return 
Plugin_Continue
}  

// - PlayerDeath -
public Action:Event_OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));    
    
CreateTimer(0.5OnDeathTimerclient);
}
                    
public 
Action:CS_OnTerminateRound(&Float:delay, &CSRoundEndReason:reason)
{
    new 
timeleft;
    
GetMapTimeLeft(timeleft);
    if (
timeleft>= -1)
        return 
Plugin_Handled;
    
    return 
Plugin_Continue;
}  

// - OnRoundRestart - (restore custom Map Buttons)
public Action:OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (
g_bPluginEnabled == true)
        
db_selectMapButtons();
}

// - PlayerHurt - 
public Action:Event_OnPlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (
g_bPluginEnabled && !g_bgodmode && g_Autohealing_Hp 0)
    {
        new 
client GetClientOfUserId(GetEventInt(event"userid"));
        new 
remainingHeatlh GetEventInt(event"health");
        if (
remainingHeatlh>0)
        {
            if ((
remainingHeatlh+g_Autohealing_Hp) > 100)
                
SetEntData(clientFindSendPropOffs("CBasePlayer""m_iHealth"), 100);
            else
                
SetEntData(clientFindSendPropOffs("CBasePlayer""m_iHealth"), remainingHeatlh+g_Autohealing_Hp);
        }
    }
}

// - PlayerDamage - (if godmode 0)
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    if (
g_bPluginEnabled && !g_bgodmode)
    {
        if (
attacker <= MAXPLAYERS && attacker 0)
        {
            
damage 0.0;
        }
    }
    return 
Plugin_Changed;
}

// - PlayerJump - JumpStats
public Action:Event_OnPlayerJump(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
FloatfGroundDiff;
    new 
client GetClientOfUserId(GetEventInt(event"userid"));    
    new 
weapon GetEntPropEnt(clientProp_Data"m_hActiveWeapon");
    if (
g_bPluginEnabled && !g_bSpectate[client] && IsPlayerAlive(client) && weapon != -&& IsClientInGame(client)  && !IsFakeClient(client))
    {
        if (
GetEntProp(clientProp_Data"m_nWaterLevel") > 0)
            return 
Plugin_Handled;
        
decl Float:flVelocity[3];
        
GetEntPropVector(clientProp_Data"m_vecBaseVelocity"flVelocity);
        if (
flVelocity[0] != 0.0 || flVelocity[1] != 0.0 || flVelocity[2] != 0.0)
            
g_bInvalidGround[client] = true;
        else
            
g_bInvalidGround[client] = false;
        

        
g_fMaxSpeed[client] = 0.0;
        
g_strafecount[client] = 1;
        
g_bDuckInAir[client] = false;
        
g_bPlayerJumped[client] = true;
        
g_bCheckSurf[client] = false;
        
g_bStandUpBhop[client] = false;
        
decl Float:fVelocity[3];
        
g_fMaxHeight[client] = -99999.0;        
        
GetEntPropVector(clientProp_Data"m_vecVelocity"fVelocity);
        
GetClientAbsOrigin(clientg_fJump_Initial[client]);    
        
g_fPreStrafe[client] = SquareRoot(Pow(fVelocity[0], 2.0) + Pow(fVelocity[1], 2.0) + Pow(fVelocity[2], 2.0));
        
        if (
g_fJump_InitialLastHeight[client] != -1.012345)
        {        
            
fGroundDiff g_fJump_Initial[client][2] - g_fJump_InitialLastHeight[client];
            if(
fGroundDiff < -1.9)
                
g_bDropJump[client] = true;
            else
                
g_bDropJump[client] = false;
            if (
g_bDropJump[client])
                
g_fDroppedUnits[client] = FloatAbs(fGroundDiff);
        }
        
        
//StandUp?
        
g_fLastJumpTime[client] = GetEngineTime();
        new 
FloatGetEngineTime() - g_fLastTimeDucked[client];
        if (
<= 0.1)
        {
            
g_bStandUpBhop[client]=true;
        }
        

        
        
//Noclip Used?
        
if (g_bNoClipUsed[client])
        {
            
g_bPlayerJumped[client]=false;
            
g_bNoClipUsed[client]=false;
        }
        
g_fJump_InitialLastHeight[client] = g_fJump_Initial[client][2];
    }
    return 
Plugin_Continue;
}

// - PlayerRun -  JumpStats
public Action:OnPlayerRunCmd(client, &buttons)
{
    if (
client && IsClientInGame(client) && IsPlayerAlive(client) && g_bPluginEnabled == true  && g_bSpectate[client] == false)
    {            
        
//Timer Panel
        
if (g_bTimeractivated[client] && !g_bPause[client])
        {
            if (
g_bTeleMenuOpen[client] == false)
                
PlayerPanel(client);
        }
        
        
//refresh ClimbersMenu
        
if (g_bTeleMenuOpen[client] && !g_bMenuOpen[client])
            
TeleMenu(client);
            
        
//showkeys
        
g_ButtonsPressed[client] = buttons;
        
        
//Last Duck
        
if (buttons IN_DUCK)        
            
g_fLastTimeDucked[client] = GetEngineTime();
        
        if (
g_bPlayerJumped[client] == true && !g_bStandUpBhop[client])
        {
            new 
FloatGetEngineTime() - g_fLastJumpTime[client];
            if (
<= 0.09)
            {
                if (
buttons IN_DUCK)
                {
                    
g_bStandUpBhop[client]=true;
                }
            }
        }
        
        
//Set GroundFrame
        
if (g_bPlayerJumped[client] == false && GetEntityFlags(client) & FL_ONGROUND && ((buttons IN_MOVERIGHT) || (buttons IN_MOVELEFT) || (buttons IN_BACK) || (buttons IN_FORWARD)))
            
g_ground_frames[client]++;    
            
        
//Surf Protection
        
if (g_bCheckSurf[client] == true && g_bPlayerJumped[client] == true)
        {        
            
g_LeetJumpDominating[client]=0;
            
g_ground_frames[client] = 0;
            
g_bPlayerJumped[client] = false;
            
g_bCheckSurf[client] = false;
            return 
Plugin_Continue;
        }
        
//Strafe Count
        
for (new 0MAX_BUTTONSi++)
        {
            new 
button = (<< i);    
            if ((
buttons button)) 
            {
                if (!(
g_lastButtons[client] & button)) 
                {
                    if (
button == IN_MOVERIGHT || button == IN_MOVELEFT)
                    {
                        
g_strafecount[client]++; 
                        
g_strafe_good_sync[client][g_strafecount[client]-1] = 0.0;
                        
g_strafe_frames[client][g_strafecount[client]-1] = 0.0;                    
                    }
                }
            } 
        }                    
        
g_lastButtons[client] = buttons;
            
        
//Block Teleports
        
new Float:pos[3];
        
GetClientAbsOrigin(clientpos);
        new 
Float:sum FloatAbs(pos[0]) - FloatAbs(g_fPosOld[client][0]);
        if (
sum 10 || sum < -10)
        {
                if (
g_bPlayerJumped[client])    
                {
                    
g_LeetJumpDominating[client]=0;
                    
g_bPlayerJumped[client] = false;
                }    
        }
        
sum FloatAbs(pos[1]) - FloatAbs(g_fPosOld[client][1]);
        if (
sum 10 || sum < -10)
        {
            if (
g_bPlayerJumped[client])
            {
                
g_bPlayerJumped[client] = false;
                
g_LeetJumpDominating[client]=0;
            }
                
        }
        
GetClientAbsOrigin(clientg_fPosOld[client]);
        
        new 
weapon GetEntPropEnt(clientProp_Data"m_hActiveWeapon");
        
        
//Block Ladders
        
if (GetEntityMoveType(client) == MOVETYPE_LADDER)
        {
            
g_ground_frames[client] = 0;
            
g_LeetJumpDominating[client]=0;
            
g_bPlayerJumped[client] = false;                    
        }
        
        
//Block Water
        
if (GetEntProp(clientProp_Data"m_nWaterLevel") > 0)
        {
            
g_ground_frames[client] = 0;
            
g_LeetJumpDominating[client]=0;
            
g_bPlayerJumped[client] = false;        
        }
        
        
//NoClip Block
        
new MoveType:mt GetEntityMoveType(client);   
        if(
mt == MOVETYPE_NOCLIP && (g_bPlayerJumped[client] || g_bTimeractivated[client]))
        {
            
g_bPlayerJumped[client] = false;
            
g_LeetJumpDominating[client]=0;
            
g_bTimeractivated[client] = false;
        }

        
//max pre speed (bhop speed limiter)
        // http://forums.alliedmods.net/showthread.php?t=132262 , thx to blodia
        
static bool:IsOnGround[MAXPLAYERS 1]; 
        if (
IsPlayerAlive(client))
        {
            new 
ClientFlags GetEntityFlags(client);
            if (
ClientFlags FL_ONGROUND)
            {
                if (!
IsOnGround[client])
                {
                    
IsOnGround[client] = true;    
                    new 
Float:CurVelVec[3];
                    
GetEntPropVector(clientProp_Data"m_vecVelocity"CurVelVec);
                    if (
GetVectorLength(CurVelVec) > g_fBhopSpeedCap)
                    {
                        
                        
NormalizeVector(CurVelVecCurVelVec);
                        
ScaleVector(CurVelVecg_fBhopSpeedCap);
                        
TeleportEntity(clientNULL_VECTORNULL_VECTORCurVelVec);
                    }
                }
            }
            else
            {
                
IsOnGround[client] = false;
            }
        }
        
        
//MaxSpeed,MaxHeight & Gravity Check && Ground Check
        
if (g_bPlayerJumped[client] == true)
        {
            
//
            
if (g_last_ground_frames[client] > 11 && !(GetEntityFlags(client) & FL_ONGROUND))
            {
                if (
GetClientButtons(client) == IN_DUCK)
                    
g_bDuckInAir[client]=true;
            }
            
            
//MAXSPEED
            
new Float:fspeed GetSpeed(client);
            if (
g_fOldSpeed[client] < fspeed)
                
g_fMaxSpeed[client] = fspeed;
                
            
            
//SYNCs
            
if( g_fOldSpeed[client] < fspeed )
            {
                
g_good_sync[client]++;        
                if( 
g_strafecount[client] <= MAX_STRAFES )
                    
g_strafe_good_sync[client][g_strafecount[client] - 1]++;
            }        
            if( 
g_strafecount[client] <= MAX_STRAFES )
                
g_strafe_frames[client][g_strafecount[client] - 1]++;
            
g_sync_frames[client]++;
            
            
//GRAVITY
            
new Handleg_hgravity FindConVar("sv_gravity");
            new 
FloatflgravitySrv GetConVarFloat(g_hgravity);
            new 
Float:flGravity GetEntityGravity(client);
            
            if ((
flGravity != 0.0 && flGravity !=1.0) || flgravitySrv != 800.0)
            {
                
g_ground_frames[client] = 0;
                
g_LeetJumpDominating[client]=0;
                
g_bPlayerJumped[client] = false;        
            }
            
            
//MAX HEIGHT
            
new Float:height[3];
            
GetClientAbsOrigin(clientheight);
            if (
height[2] > g_fMaxHeight[client])
                
g_fMaxHeight[client] = height[2];            
                                    
            
//INVALID GROUND?
            
new Float:flbaseVelocity[3];
            
GetEntPropVector(clientProp_Data"m_vecBaseVelocity"flbaseVelocity);
            if (
flbaseVelocity[0] != 0.0 || flbaseVelocity[1] != 0.0 || flbaseVelocity[2] != 0.0)
            {
                
g_ground_frames[client] = 0;
                
g_LeetJumpDominating[client]=0;
                
g_bPlayerJumped[client] = false;                        
            }            
        }
        
g_fOldSpeed[client] = GetSpeed(client);
                    
        
//Calcs Distance & Chat Ouput
        
if(GetEntityFlags(client) & FL_ONGROUND && !g_bInvalidGround[client] && !g_bLastInvalidGround[client] && g_bPlayerJumped[client] == true && weapon != -&& IsValidEntity(weapon) && GetEntProp(clientProp_Data"m_nWaterLevel") < && !IsFakeClient(client))
        {    
            new 
g_frames g_ground_frames[client];
            new 
strafes g_strafecount[client];
            
g_ground_frames[client] = 0;    
            
g_fMaxSpeed_Test[client] = g_fMaxSpeed[client];
            
decl String:szName[MAX_NAME_LENGTH];    
            
GetClientName(clientszNameMAX_NAME_LENGTH);    
            
g_bPlayerJumped[client] = false;    
            
GetClientAbsOrigin(clientg_fJump_Final[client]);
            
            
g_fJump_DistanceX[client] = g_fJump_Final[client][0] - g_fJump_Initial[client][0];
            if(
g_fJump_DistanceX[client] < 0)
                
g_fJump_DistanceX[client] = -g_fJump_DistanceX[client];

            
g_fJump_DistanceZ[client] = g_fJump_Final[client][1] - g_fJump_Initial[client][1];
            if(
g_fJump_DistanceZ[client] < 0)
                
g_fJump_DistanceZ[client] = -g_fJump_DistanceZ[client];
                    
            new 
FloatfGroundDiff g_fJump_Final[client][2] - g_fJump_Initial[client][2];
            new 
FloatfJump_Height;
            if(-
1.9 fGroundDiff 1.9)
                
fGroundDiff 0.0;        
            
            if (
FloatAbs(g_fJump_Initial[client][2]) > FloatAbs(g_fMaxHeight[client]))
                
fJump_Height =  FloatAbs(g_fJump_Initial[client][2]) - FloatAbs(g_fMaxHeight[client]);
            else
                
fJump_Height =  FloatAbs(g_fMaxHeight[client]) - FloatAbs(g_fJump_Initial[client][2]);
            
            
g_fJump_Distance[client] = SquareRoot(Pow(g_fJump_DistanceX[client], 2.0) + Pow(g_fJump_DistanceZ[client], 2.0));        
            
g_fJump_Distance[client] = g_fJump_Distance[client] + 32;        

            
            
g_Strafes[client] = strafes;
            new 
sync RoundToNearest(g_good_sync[client] / g_sync_frames[client] * 100.0);
            
g_sync[client] = sync;
            
//bug log
            
new String:configFile[PLATFORM_MAX_PATH];
            
BuildPath(Path_SMconfigFilesizeof(configFile), "configs/jumpstats_bugs.txt");
            new 
Handle:file OpenFile(configFile"at+");
            
            
//STRAFE SYNC CHAT
            
new String:szStrafeSync[255];
            new 
String:szStrafeSync2[255];
            new 
strafe_sync;
            if (
g_bStrafeSync[client])
            {
                for (new 
0strafesi++)
                {
                    if (
i==0)
                        
Format(szStrafeSync255"[%cKZ%c] %cSync:",MOSSGREEN,WHITE,GRAY);
                    if (
g_strafe_frames[client][i] == 0.0 || g_strafe_good_sync[client][i] == 0.0
                        
strafe_sync 0;
                    else
                        
strafe_sync RoundToNearest(g_strafe_good_sync[client][i] / g_strafe_frames[client][i] * 100.0);
                    if (
i==0)    
                        
Format(szStrafeSync2255" %c%i.%c %i%c",GRAY, (i+1),LIMEGREEN,strafe_sync,PERCENT);
                    else
                        
Format(szStrafeSync2255"%c - %i.%c %i%c",GRAY, (i+1),LIMEGREEN,strafe_sync,PERCENT);
                    
StrCat(szStrafeSyncsizeof(szStrafeSync), szStrafeSync2);
                    if ((
i+1) == strafes)
                    {
                        
Format(szStrafeSync2255" %c[%c%i%c%c]",GRAY,PURPLEsync,PERCENT,GRAY);
                        
StrCat(szStrafeSyncsizeof(szStrafeSync), szStrafeSync2);
                    }
                }    
            }
            
            
//
            //Chat Output
            //LongJump
            
if (g_frames 11 && fGroundDiff == 0.0 && g_fPreStrafe[client] < 251.0 && fJump_Height <= 66.0
            {    
                
g_fLastJumpDistance[client] = g_fJump_Distance[client];
                if (
g_fJump_Distance[client] >= g_dist_good_lj && g_fJump_Distance[client] < g_dist_pro_lj)    
                {
                    
g_LeetJumpDominating[client]=0;
                    
PrintToChat(client"[%cKZ%c] %cLJ: %.2f units [%c%i%c Strafes | %c%.0f%c Pre | %c%i%c%c Sync]",MOSSGREEN,WHITE,GRAYg_fJump_Distance[client],LIMEGREEN,strafes,GRAYLIMEGREENg_fPreStrafe[client], GRAY,LIMEGREENsync,PERCENT,GRAY);    
                }
                else

                    if (
g_fJump_Distance[client] >= g_dist_pro_lj && g_fJump_Distance[client] < g_dist_leet_lj)    
                    {
                        
g_LeetJumpDominating[client]=0;
                        
//chat & sound client                    
                        
PrintToConsole(client"[KZ] %s jumped %0.4f units with a LongJump [%i Strafes | %0.f Pre | %0.f Max | %i%c Sync]",szNameg_fJump_Distance[client],strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                        
PrintToChat(client"%t""Jumpstats_Lj",MOSSGREEN,WHITE,GREEN,szNameMOSSGREEN,GREENg_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                        if (
g_bEnableSounds[client])
                        {
                            
decl String:buffer[255];
                            
Format(buffersizeof(buffer), "play %s"PROJUMP_RELATIVE_SOUND_PATH); 
                            
ClientCommand(clientbuffer); 
                        }

                        
//chat all
                        
for (new 1<= MaxClientsi++)
                        {
                            if (
<= <= MaxClients && IsClientInGame(i) && IsValidEntity(i))
                            {                        
                                if (
g_bColorChat[i] && != client)
                                    
PrintToChat(i"%t""Jumpstats_Lj",MOSSGREEN,WHITE,GREEN,szNameMOSSGREEN,GREENg_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                            }
                        }    
                        
                    }    
                    else        
                        
// strafes & distance check workaround.. some mg_courses have some undetectable stuff
                        
if (g_fJump_Distance[client] >= g_dist_leet_lj && strafes 3)    
                        {
                            
//bug log
                            
if (g_fJump_Distance[client] > 252.0)
                                
WriteFileLine(file"lj distance: %f --- on: %s --- jumpoff: %f %f %f\n"g_fJump_Distance[client], g_szMapNameg_fJump_Initial[client][0], g_fJump_Initial[client][1], g_fJump_Initial[client][2]);                            
                        
                            
g_LeetJumpDominating[client]++;
                            
//client                    
                            
PrintToConsole(client"[KZ] %s jumped %0.4f units with a LongJump [%i Strafes | %0.f Pre | %0.f Max | %i%c Sync]",szNameg_fJump_Distance[client],strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                            
PrintToChat(client"%t""Jumpstats_Lj",MOSSGREEN,WHITE,DARKRED,szNameRED,DARKREDg_fJump_Distance[client],RED,DARKRED,RED,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                            if (
g_LeetJumpDominating[client]==3)
                                
PrintToChat(client"%t""Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
                                else
                                if (
g_LeetJumpDominating[client]==5)
                                    
PrintToChat(client"%t""Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
                            
                            
//all
                            
for (new 1<= MaxClientsi++)
                            {
                                if (
<= <= MaxClients && IsClientInGame(i) && IsValidEntity(i))
                                {                        
                                    if (
g_bColorChat[i] && != client)
                                    {
                                        
PrintToChat(i"%t""Jumpstats_Lj",MOSSGREEN,WHITE,DARKRED,szNameRED,DARKREDg_fJump_Distance[client],RED,DARKRED,RED,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                                        if (
g_LeetJumpDominating[client]==3)
                                            
PrintToChat(i"%t""Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
                                        else
                                            if (
g_LeetJumpDominating[client]==5)
                                                
PrintToChat(i"%t""Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
                                    }
                                }
                            }
                            
PlayLeetJumpSound(client);
                        }
                        else 
                            
g_LeetJumpDominating[client]=0;
                
                if (
g_bStrafeSync[client] && g_fJump_Distance[client] >= g_dist_good_bhop)
                            
PrintToChat(client,"%s"szStrafeSync);        
                
//db 
                
if (g_fPersonalLjRecord[client] < g_fJump_Distance[client])
                {        
                    if (
g_fPersonalLjRecord[client] > 0.0)
                        
PrintToChat(client"%t""Jumpstats_BeatLjBest",MOSSGREEN,WHITE,YELLOWg_fJump_Distance[client]);
                    
g_fPersonalLjRecord[client] = g_fJump_Distance[client];
                    
db_updateLjRecord(client);
                    
                }
            }
            
            
//Multi Bhop
            
if (g_last_ground_frames[client] < 11 && g_frames 11 && fGroundDiff == 0.0  && fJump_Height <= 66.0 && !g_bDropJump[client])
            {        
                
g_fLastJumpDistance[client] = g_fJump_Distance[client];
                if (
g_multi_bhop_count[client] == && g_fPreStrafe[client] > 350.0)
                {
                }
                else
                {    
                    
g_multi_bhop_count[client]++;    
                    
decl String:szBhopCount[255];
                    
Format(szBhopCountsizeof(szBhopCount), "%i"g_multi_bhop_count[client]);
                    if (
g_multi_bhop_count[client] > 8)
                        
Format(szBhopCountsizeof(szBhopCount), "> 8");
                    if (
g_fJump_Distance[client] >= g_dist_good_multibhop && g_fJump_Distance[client] < g_dist_pro_multibhop)    
                    {
                        
g_LeetJumpDominating[client]=0;
                        
PrintToChat(client"[%cKZ%c] %cMultiBhop: %.2f units [%c%i%c Strafes | %c%.0f%c Pre | %c%i%c%c Sync]",MOSSGREEN,WHITEGRAYg_fJump_Distance[client],LIMEGREENstrafesGRAYLIMEGREENg_fPreStrafe[client], GRAYLIMEGREENsync,PERCENT,GRAY);    
                    }    
                    else
                        if (
g_fJump_Distance[client] >= g_dist_pro_multibhop && g_fJump_Distance[client] < g_dist_leet_multibhop)
                        {                
                            
g_LeetJumpDominating[client]=0;
                            
//Client
                            
PrintToConsole(client"[KZ] %s jumped %0.4f units with a Multi-Bunnyhop [%i Strafes | %0.f Pre | %0.f Max | %s Bhops | %i%c Sync]",szNameg_fJump_Distance[client],strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client], szBhopCount,sync,PERCENT);                
                            
PrintToChat(client"%t""Jumpstats_MultiBhop",MOSSGREEN,WHITE,GREEN,szNameMOSSGREEN,GREENg_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],szBhopCount,sync,PERCENT)            
                            if (
g_bEnableSounds[client])
                            {
                                
decl String:buffer[255];
                                
Format(buffersizeof(buffer), "play %s"PROJUMP_RELATIVE_SOUND_PATH); 
                                
ClientCommand(clientbuffer); 
                            }
                                            
                            
//all
                            
for (new 1<= MaxClientsi++)
                            {
                                if (
<= <= MaxClients && IsClientInGame(i) && IsValidEntity(i))
                                {
                                    if (
g_bColorChat[i] && != client)                    
                                        
PrintToChat(i"%t""Jumpstats_MultiBhop",MOSSGREEN,WHITE,GREEN,szNameMOSSGREEN,GREENg_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],szBhopCount,sync,PERCENT);
                                }
                            }
        
                        }
                        else
                        if (
g_fJump_Distance[client] >= g_dist_leet_multibhop)    
                        {
                            
g_LeetJumpDominating[client]++;
                            
//Client
                            
PrintToConsole(client"[KZ] %s jumped %0.4f units with a Multi-Bunnyhop [%i Strafes | %0.f Pre | %0.f Max | %s Bhops | %i%c Sync]",szNameg_fJump_Distance[client],strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client], szBhopCount,sync,PERCENT);
                            
PrintToChat(client"%t""Jumpstats_MultiBhop",MOSSGREEN,WHITE,DARKRED,szNameRED,DARKREDg_fJump_Distance[client],RED,DARKRED,RED,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],szBhopCount,sync,PERCENT);
                            if (
g_LeetJumpDominating[client]==3)
                                
PrintToChat(client"%t""Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
                            else
                            if (
g_LeetJumpDominating[client]==5)
                                
PrintToChat(client"%t""Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);                        
                        
                            
//all
                            
for (new 1<= MaxClientsi++)
                            {
                                if (
<= <= MaxClients && IsClientInGame(i))
                                {
                                    if (
g_bColorChat[i] && != client)
                                    {
                                        
PrintToChat(i"%t""Jumpstats_MultiBhop",MOSSGREEN,WHITE,DARKRED,szNameRED,DARKREDg_fJump_Distance[client],RED,DARKRED,RED,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],szBhopCount,sync,PERCENT);
                                        if (
g_LeetJumpDominating[client]==3)
                                                
PrintToChat(i"%t""Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
                                            else
                                            if (
g_LeetJumpDominating[client]==5)
                                                
PrintToChat(i"%t""Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
                                    }
                                }
                            }
                            
PlayLeetJumpSound(client);    
                        }    
                        else
                            
g_LeetJumpDominating[client]=0;
                    if (
g_bStrafeSync[client] && g_fJump_Distance[client] >= g_dist_good_multibhop)
                        
PrintToChat(client,"%s"szStrafeSync);        
                    if (
g_fPersonalMultiBhopRecord[client] < g_fJump_Distance[client])
                    {
                        if (
g_fPersonalMultiBhopRecord[client] > 0.0)
                            
PrintToChat(client"%t""Jumpstats_BeatMultiBhopBest",MOSSGREEN,WHITE,YELLOWg_fJump_Distance[client]);
                        
g_fPersonalMultiBhopRecord[client] = g_fJump_Distance[client];
                        
db_updateMultiBhopRecord(client);
                    }
                }
            }
            else
                
g_multi_bhop_count[client] = 1;    
    
            
//StandUp Drop Bunnyhop 
            /*if (g_frames < 11 && g_last_ground_frames[client] > 11 && g_bLastButtonJump[client] && fGroundDiff == 0.0 && fJump_Height <= 66.0 && g_bDropJump[client] && g_bStandUpBhop[client])
            {
                if (g_fDroppedUnits[client] > 132.0)
                    PrintToChat(client, "[%cKZ%c] You fell too far. (%c%.1f%c/%c132.0%c max)",MOSSGREEN,WHITE,RED,g_fDroppedUnits[client],WHITE,GREEN,WHITE);
                else
                {
                    if (g_fPreStrafe[client]>300.0)
                        PrintToChat(client, "[%cKZ%c] Your Prestrafe is too high. (%c%.1f%c/%c300.0%c max)",MOSSGREEN,WHITE,RED,g_fPreStrafe[client],WHITE,GREEN,WHITE);
                    else
                    {
                        if (g_fJump_Distance[client] >= 250.0)    
                        {
                            g_LeetJumpDominating[client]=0;
                            PrintToChat(client, "[%cKZ%c] StandUp DropBhop: %.2f units [%c%i%c Strafes | %c%.0f%c Pre]",MOSSGREEN,WHITE, g_fJump_Distance[client],MOSSGREEN, strafes, WHITE, MOSSGREEN, g_fPreStrafe[client],WHITE);    
                        }    
                    }
                }
            }*/
            
            //Drop Bunnyhop
            
if (g_frames 11 && g_last_ground_frames[client] > 11 && g_bLastButtonJump[client] && fGroundDiff == 0.0 && fJump_Height <= 66.0 && g_bDropJump[client])
            {
                if (
g_fDroppedUnits[client] > 132.0)
                    
PrintToChat(client"[%cKZ%c] You fell too far. (%c%.1f%c/%c132.0%c max)",MOSSGREEN,WHITE,RED,g_fDroppedUnits[client],WHITE,GREEN,WHITE);
                else
                {
                    if (
g_fPreStrafe[client]>300.0)
                        
PrintToChat(client"[%cKZ%c] Your Prestrafe is too high. (%c%.3f%c/%c300.0%c max)",MOSSGREEN,WHITE,RED,g_fPreStrafe[client],WHITE,GREEN,WHITE);
                    else
                    {
                        
g_fLastJumpDistance[client] = g_fJump_Distance[client];
                        if (
g_fJump_Distance[client] >= g_dist_good_dropbhop && g_fJump_Distance[client] < g_dist_pro_dropbhop)    
                        {
                            
g_LeetJumpDominating[client]=0;
                            
PrintToChat(client"[%cKZ%c] %cDrop-Bhop: %.2f units [%c%i%c Strafes | %c%.0f%c Pre | %c%i%c%c Sync]",MOSSGREEN,WHITEGRAY,g_fJump_Distance[client],LIMEGREENstrafesGRAYLIMEGREENg_fPreStrafe[client], GRAYLIMEGREEN,sync,PERCENT,GRAY);    
                        }    
                        else
                            if (
g_fJump_Distance[client] >= g_dist_pro_dropbhop && g_fJump_Distance[client] < g_dist_leet_dropbhop)
                        {
                                
g_LeetJumpDominating[client]=0;
                                
//Client
                                
PrintToChat(client"%t""Jumpstats_DropBhop",MOSSGREEN,WHITE,GREEN,szNameMOSSGREEN,GREENg_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                                
PrintToConsole(client"[KZ] %s jumped %0.4f units with a Drop-Bunnyhop [%i Strafes | %0.f Pre | %0.f Max | %i%c Sync]",szNameg_fJump_Distance[client],strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);                        
                                if (
g_bEnableSounds[client] == true)
                                {
                                    
decl String:buffer[255];
                                    
Format(buffersizeof(buffer), "play %s"PROJUMP_RELATIVE_SOUND_PATH); 
                                    
ClientCommand(clientbuffer); 
                                }        
                    
                                
//all
                                
for (new 1<= MaxClientsi++)
                                {
                                    if (
<= <= MaxClients && IsClientInGame(i))
                                    {
                                        if (
g_bColorChat[i]==true && != client)
                                            
PrintToChat(i"%t""Jumpstats_DropBhop",MOSSGREEN,WHITE,GREEN,szNameMOSSGREEN,GREENg_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                                    }
                                }
                            }
                            else
                                if (
g_fJump_Distance[client] >= g_dist_leet_dropbhop)    
                                {                        
                                    
g_LeetJumpDominating[client]++;
                                    
//Client
                                    
PrintToChat(client"%t""Jumpstats_DropBhop",MOSSGREEN,WHITE,DARKRED,szNameRED,DARKREDg_fJump_Distance[client],RED,DARKRED,RED,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                                    
PrintToConsole(client"[KZ] %s jumped %0.4f units with a Drop-Bunnyhop [%i Strafes | %0.f Pre | %0.f Max | %i%c Sync]",szNameg_fJump_Distance[client],strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                                    if (
g_LeetJumpDominating[client]==3)
                                        
PrintToChat(client"%t""Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
                                    else
                                        if (
g_LeetJumpDominating[client]==5)
                                            
PrintToChat(client"%t""Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
                                            
                                    
//all
                                    
for (new 1<= MaxClientsi++)
                                    {
                                        if (
<= <= MaxClients && IsClientInGame(i))
                                        {
                                            if (
g_bColorChat[i]==true && != client)
                                            {
                                                
PrintToChat(i"%t""Jumpstats_DropBhop",MOSSGREEN,WHITE,DARKRED,szNameRED,DARKREDg_fJump_Distance[client],RED,DARKRED,RED,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                                                if (
g_LeetJumpDominating[client]==3)
                                                        
PrintToChat(i"%t""Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
                                                else
                                                if (
g_LeetJumpDominating[client]==5)
                                                        
PrintToChat(i"%t""Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
                                            }
                                        }    
                                    }
                                    
PlayLeetJumpSound(client);    
                                }        
                                else
                                    
g_LeetJumpDominating[client]=0;
                        
                        if (
g_bStrafeSync[client] && g_fJump_Distance[client] >= g_dist_pro_dropbhop)
                            
PrintToChat(client,"%s"szStrafeSync);    
                        if (
g_fPersonalDropBhopRecord[client] < g_fJump_Distance[client])
                        {
                            if (
g_fPersonalDropBhopRecord[client] > 0.0)
                                
PrintToChat(client"%t""Jumpstats_BeatDropBhopBest",MOSSGREEN,WHITE,YELLOWg_fJump_Distance[client]);
                            
g_fPersonalDropBhopRecord[client] = g_fJump_Distance[client];
                            
db_updateDropBhopRecord(client);
                        }                
                    }
                }
            }
            
            
// WeirdJump
            
if (g_frames 11 && !g_bLastButtonJump[client] && fGroundDiff == 0.0 && fJump_Height <= 66.0 && g_bDropJump[client])
            {                
                if (
g_fDroppedUnits[client] > 132.0)
                    
PrintToChat(client"[%cKZ%c] You fell too far. (%c%.1f%c/%c132.0%c max)",MOSSGREEN,WHITE,RED,g_fDroppedUnits[client],WHITE,GREEN,WHITE);
                else
                {
                    if (
g_fPreStrafe[client]>300.0)
                        
PrintToChat(client"[%cKZ%c] Your Prestrafe is too high. (%c%.3f%c/%c300.0%c max)",MOSSGREEN,WHITE,RED,g_fPreStrafe[client],WHITE,GREEN,WHITE);
                    else
                    {
                        if (
g_bStrafeSync[client])
                            
PrintToChat(client,"%s"szStrafeSync);    
                        
g_fLastJumpDistance[client] = g_fJump_Distance[client];
                        if (
g_fJump_Distance[client] >= g_dist_good_weird && g_fJump_Distance[client] < g_dist_pro_weird)    
                        {
                            
g_LeetJumpDominating[client]=0;
                            
PrintToChat(client"[%cKZ%c] %cWJ: %.2f units [%c%i%c Strafes | %c%.0f%c Pre | %c%i%c%c Sync]",MOSSGREEN,WHITEGRAY,g_fJump_Distance[client],LIMEGREENstrafesGRAYLIMEGREENg_fPreStrafe[client], GRAYLIMEGREENsync,PERCENT,GRAY);    
                        }    
                        else
                            if (
g_fJump_Distance[client] >= g_dist_pro_weird && g_fJump_Distance[client] < g_dist_leet_weird)
                            {
                                
g_LeetJumpDominating[client]=0;
                                
//Client
                                
PrintToChat(client"%t""Jumpstats_Weird",MOSSGREEN,WHITE,GREEN,szNameMOSSGREEN,GREENg_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                                
PrintToConsole(client"[KZ] %s jumped %0.4f units with a WeirdJump [%i Strafes | %0.f Pre | %0.f Max | %i%c Sync]",szNameg_fJump_Distance[client],strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);                        
                                if (
g_bEnableSounds[client] == true)
                                {
                                    
decl String:buffer[255];
                                    
Format(buffersizeof(buffer), "play %s"PROJUMP_RELATIVE_SOUND_PATH); 
                                    
ClientCommand(clientbuffer); 
                                }        
                                
                                
//all
                                
for (new 1<= MaxClientsi++)
                                {
                                    if (
<= <= MaxClients && IsClientInGame(i))
                                    {
                                        if (
g_bColorChat[i]==true && != client)
                                            
PrintToChat(i"%t""Jumpstats_Weird",MOSSGREEN,WHITE,GREEN,szNameMOSSGREEN,GREENg_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                                    }
                                }
                            }
                            else
                                if (
g_fJump_Distance[client] >= g_dist_leet_weird)    
                                {
                                    
g_LeetJumpDominating[client]++;
                                    
//Client
                                    
PrintToChat(client"%t""Jumpstats_Weird",MOSSGREEN,WHITE,DARKRED,szNameRED,DARKREDg_fJump_Distance[client],RED,DARKRED,RED,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                                    
PrintToConsole(client"[KZ] %s jumped %0.4f units with a WeirdJump [%i Strafes | %0.f Pre | %0.f Max | %i%c Sync]",szNameg_fJump_Distance[client],strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                                    if (
g_LeetJumpDominating[client]==3)
                                        
PrintToChat(client"%t""Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
                                    else
                                        if (
g_LeetJumpDominating[client]==5)
                                            
PrintToChat(client"%t""Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
                                                        
                                    
//all
                                    
for (new 1<= MaxClientsi++)
                                    {
                                        if (
<= <= MaxClients && IsClientInGame(i))
                                        {
                                            if (
g_bColorChat[i]==true && != client)
                                            {
                                                
PrintToChat(i"%t""Jumpstats_Weird",MOSSGREEN,WHITE,DARKRED,szNameRED,DARKREDg_fJump_Distance[client],RED,DARKRED,RED,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
                                                if (
g_LeetJumpDominating[client]==3)
                                                        
PrintToChat(i"%t""Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
                                                    else
                                                    if (
g_LeetJumpDominating[client]==5)
                                                        
PrintToChat(i"%t""Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
                                            }
                                        }
                                    }
                                    
PlayLeetJumpSound(client);    
                                }        
                                    else
                                        
g_LeetJumpDominating[client]=0;        
                        
                        if (
g_bStrafeSync[client] && g_fJump_Distance[client] >= g_dist_good_weird)
                            
PrintToChat(client,"%s"szStrafeSync);        
                        if (
g_fPersonalWjRecord[client] < g_fJump_Distance[client])
                        {
                            if (
g_fPersonalWjRecord[client] > 0.0)
                                
PrintToChat(client"%t""Jumpstats_BeatWjBest",MOSSGREEN,WHITE,YELLOWg_fJump_Distance[client]);
                            
g_fPersonalWjRecord[client] = g_fJump_Distance[client];
                            
db_updateWjRecord(client);
                        }
                    }
                }
            }

            
//StandUp BunnyHop
            /*if (g_frames < 11 && g_last_ground_frames[client] > 10 && fGroundDiff == 0.0 && fJump_Height <= 66.0 && !g_bDropJump[client] && g_bStandUpBhop[client])
            {
                if (g_fPreStrafe[client]>300.0)
                    PrintToChat(client, "[%cKZ%c] Your Prestrafe is too high. (%c%.1f%c/%c300.0%c max)",MOSSGREEN,WHITE,RED,g_fPreStrafe[client],WHITE,GREEN,WHITE);
                else
                {
                    if (g_fJump_Distance[client] >= 250.0)    
                    {
                        g_LeetJumpDominating[client]=0;
                        PrintToChat(client, "[%cKZ%c] StandUp Bhop: %.2f units [%c%i%c Strafes | %c%.0f%c Pre]",MOSSGREEN,WHITE, g_fJump_Distance[client],MOSSGREEN, strafes, WHITE, MOSSGREEN, g_fPreStrafe[client], WHITE);    
                    }                    
                }
            }*/
            
            //BunnyHop
            
if (g_frames 11 && g_last_ground_frames[client] > 10 && fGroundDiff == 0.0 && fJump_Height <= 66.0 && !g_bDropJump[client])
            {
                if (
g_fPreStrafe[client]>300.0)
                    
PrintToChat(client"[%cKZ%c] Your Prestrafe is too high. (%c%.3f%c/%c300.0%c max)",MOSSGREEN,WHITE,RED,g_fPreStrafe[client],WHITE,GREEN,WHITE);
                else
                {    
                    
g_fLastJumpDistance[client] = g_fJump_Distance[client];
                    if (
g_fJump_Distance[client] >= g_dist_good_bhop && g_fJump_Distance[client] < g_dist_pro_bhop)    
                    {
                        
g_LeetJumpDominating[client]=0;
                        
PrintToChat(client"[%cKZ%c] %cBhop: %.2f units [%c%i%c Strafes | %c%.0f%c Pre | %c%i%c%c Sync]",MOSSGREEN,WHITE,GRAYg_fJump_Distance[client],LIMEGREENstrafesGRAYLIMEGREENg_fPreStrafe[client], GRAYLIMEGREENsync,PERCENT,GRAY);    
                    }    
                    else
                        if (
g_fJump_Distance[client] >= g_dist_pro_bhop && g_fJump_Distance[client] < g_dist_leet_bhop)
                        {
                            
g_LeetJumpDominating[client]=0;
                            
//Client
                            
PrintToChat(client"%t""Jumpstats_Bhop",MOSSGREEN,WHITE,GREEN,szNameMOSSGREEN,GREENg_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client], sync,PERCENT);
                            
PrintToConsole(client"[KZ] %s jumped %0.4f units with a Bunnyhop [%i Strafes | %0.f Pre | %0.f Max | %i%c Sync]",szNameg_fJump_Distance[client],strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client], sync,PERCENT);                        
                            if (
g_bEnableSounds[client] == true)
                            {
                                
decl String:buffer[255];
                                
Format(buffersizeof(buffer), "play %s"PROJUMP_RELATIVE_SOUND_PATH); 
                                
ClientCommand(clientbuffer); 
                            }        
                        
                            
//all
                            
for (new 1<= MaxClientsi++)
                            {
                                if (
<= <= MaxClients && IsClientInGame(i))
                                {
                                    if (
g_bColorChat[i]==true && != client)
                                        
PrintToChat(i"%t""Jumpstats_Bhop",MOSSGREEN,WHITE,GREEN,szNameMOSSGREEN,GREENg_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client], sync,PERCENT);
                                }
                            }
                        }
                        else
                            if (
g_fJump_Distance[client] >= g_dist_leet_bhop)    
                            {
                                
g_LeetJumpDominating[client]++;
                                
//Client
                                
PrintToChat(client"%t""Jumpstats_Bhop",MOSSGREEN,WHITE,DARKRED,szNameRED,DARKREDg_fJump_Distance[client],RED,DARKRED,RED,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client], sync,PERCENT);
                                
PrintToConsole(client"[KZ] %s jumped %0.4f units with a Bunnyhop [%i Strafes | %0.f Pre | %0.f Max | %i%c Sync]",szNameg_fJump_Distance[client],strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client], sync,PERCENT);
                                if (
g_LeetJumpDominating[client]==3)
                                    
PrintToChat(client"%t""Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
                                else
                                if (
g_LeetJumpDominating[client]==5)
                                            
PrintToChat(client"%t""Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
                                                
                                
//all
                                
for (new 1<= MaxClientsi++)
                                {
                                    if (
<= <= MaxClients && IsClientInGame(i))
                                    {
                                        if (
g_bColorChat[i]==true && != client)
                                        {
                                            
PrintToChat(i"%t""Jumpstats_Bhop",MOSSGREEN,WHITE,DARKRED,szNameRED,DARKREDg_fJump_Distance[client],RED,DARKRED,RED,strafesg_fPreStrafe[client], g_fMaxSpeed_Test[client], sync,PERCENT);
                                            if (
g_LeetJumpDominating[client]==3)
                                                
PrintToChat(i"%t""Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
                                            else
                                                if (
g_LeetJumpDominating[client]==5)
                                                
PrintToChat(i"%t""Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
                                        }
                                    }
                                }
                                
PlayLeetJumpSound(client);    
                            }        
                            else
                                
g_LeetJumpDominating[client]=0;
                    if (
g_bStrafeSync[client] && g_fJump_Distance[client] >= g_dist_good_bhop)
                            
PrintToChat(client,"%s"szStrafeSync);        
                    if (
g_fPersonalBhopRecord[client] < g_fJump_Distance[client])
                    {
                        if (
g_fPersonalBhopRecord[client] > 0.0)
                            
PrintToChat(client"%t""Jumpstats_BeatBhopBest",MOSSGREEN,WHITE,YELLOWg_fJump_Distance[client]);
                        
g_fPersonalBhopRecord[client] = g_fJump_Distance[client];
                        
db_updateBhopRecord(client);
                    }
                }
            }
            
CloseHandle(file);    
            
g_last_ground_frames[client] = g_frames;                    
        }    
        
            
        
//INVALID GROUND && LAST GROUND FRAMES
        
if (GetEntityFlags(client) & FL_ONGROUND)
        {
            
g_bLastInvalidGround[client] = g_bInvalidGround[client];
        }
                    
        
//noclip used?
        
new MoveType:mt2 GetEntityMoveType(client);  
        if(!(
GetEntityFlags(client) & FL_ONGROUND))
        {    
            if (
mt2 == MOVETYPE_NOCLIP)
                
g_bNoClipUsed[client]=true;
        }
        else
        {        
            if (
g_ground_frames[client] > 10)
                
g_bNoClipUsed[client]=false;
        }
        
        
//LastButton Jump? + LastHeight
        
if(GetEntityFlags(client) & FL_ONGROUND && g_bPlayerJumped[client] == false && g_ground_frames[client] > 10)
        {
            
decl Float:flPos[3];
            
GetClientAbsOrigin(clientflPos);    
            
g_fJump_InitialLastHeight[client] = flPos[2];
            if (
buttons IN_JUMP)
                
g_bLastButtonJump[client] = true;
            else
                
g_bLastButtonJump[client] = false;
        }    
        
        
//set gframes 0 if dropped without jump
        
if (!(GetEntityFlags(client) & FL_ONGROUND) && g_bPlayerJumped[client] == false)
            
g_ground_frames[client] = 0;    
            
        if (
g_bPlayerJumped[client] == false)
        {
            
g_good_sync[client] = 0.0;
            
g_sync_frames[client] = 0.0;
            for( new 
0MAX_STRAFESi++ )
            {
                
g_strafe_good_sync[client][i] = 0.0;
                
g_strafe_frames[client][i] = 0.0;
            }
        }
    }        
    return 
Plugin_Continue;
}

// - JumpStats : Surfprotection -
public OnEntityCreated(iEntity, const String:classname[]) 

    if (
<= iEntity <= MaxClients && IsClientInGame(iEntity))
    {    
        if(
StrEqual(classname"player") && g_bPluginEnabled == true)   
            
SDKHook(iEntitySDKHook_StartTouchOnTouch);
    }
}

// - JumpStats : Surfprotection -
public OnTouch(clientother)
{
    if (
IsClientInGame(client) && IsPlayerAlive(client))
    {
        if ((
<= client <= MaxClients) && !(GetEntityFlags(client) & FL_ONGROUND))
        {
            
g_bCheckSurf[client] = true;
        }
        if ((
<= other <= MaxClients) && !(GetEntityFlags(other) & FL_ONGROUND))
        {
            
g_bCheckSurf[other] = true;
        }
    }

pchun is offline
tristen620
Junior Member
Join Date: Feb 2012
Old 12-18-2013 , 05:13   Re: Plugin encountered error 15: Array index is out of bounds
Reply With Quote #2

Quote:
Originally Posted by pchun View Post
Error log:

PHP Code:
L 12/16/2013 22:40:57: [SMPlugin encountered error 15: Array index is out of bounds
L 12
/16/2013 22:40:57: [SMDisplaying call stack trace for plugin "KZMod.smx":
L 12/16/2013 22:40:57: [SM]   [0]  Line 279KZMod/hooks.sp::OnPlayerRunCmd() 

PHP Code:
        //Strafe Count
        
for (new 0MAX_BUTTONSi++)
        {
            new 
button = (<< i);    
            if ((
buttons button)) 
            {
                if (!(
g_lastButtons[client] & button)) 
                {
                    if (
button == IN_MOVERIGHT || button == IN_MOVELEFT)
                    {
                        
g_strafecount[client]++; 
279                    g_strafe_good_sync[client][g_strafecount[client]-1] = 0.0;
                        
g_strafe_frames[client][g_strafecount[client]-1] = 0.0;                    
                    }
                }
            } 
        } 
What are g_strafecount[], g_strafe_good_sync[][] initialized at?
IF their size is less than max players then the client could be higher than the index.
OR if g_strafecount is initialized at -1 or something silly then even after being incremented the g_strafecount[client]-1 could lead to it asking for index -1 which doesn't exist.

Hope that helps you.

Last edited by tristen620; 12-18-2013 at 05:15.
tristen620 is offline
pchun
Member
Join Date: Sep 2013
Old 12-18-2013 , 07:42   Re: Plugin encountered error 15: Array index is out of bounds
Reply With Quote #3

Quote:
Originally Posted by tristen620 View Post
What are g_strafecount[], g_strafe_good_sync[][] initialized at?
IF their size is less than max players then the client could be higher than the index.
OR if g_strafecount is initialized at -1 or something silly then even after being incremented the g_strafecount[client]-1 could lead to it asking for index -1 which doesn't exist.

Hope that helps you.
thank you!
pchun is offline
Reply



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 14:39.


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