PHP Code:
// - PlayerSpawn -
public Action:Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(client != 0 && (GetClientTeam(client) > 1) && g_bPluginEnabled == true)
{
g_bPlayerJumped[client] = false;
g_teamID[client] = GetClientTeam(client);
//NoBlock
if(g_bNoBlock)
SetEntData(client, FindSendPropOffs("CBaseEntity", "m_CollisionGroup"), 2, 4, true);
else
SetEntData(client, FindSendPropOffs("CBaseEntity", "m_CollisionGroup"), 5, 4, true);
//remove weapons
if (g_bCleanWeapons)
GiveWeaponFunc(client,"weapon_knife");
//challenge start pos
GetClientAbsOrigin(client, g_fCStartPosition[client]);
//MapStart
if (g_bMapStart[client] == true)
CreateTimer(0.1, Connected, client);
//restore position
if (g_bRestoreC[client] == true)
{
TeleportEntity(client, g_fPlayerCordsRestore[client],g_fPlayerAnglesRestore[client],NULL_VECTOR);
g_bRestoreC[client] = false;
}
if (g_bRespawnPosition[client] == true)
{
TeleportEntity(client, g_fPlayerCordsRestore[client],g_fPlayerAnglesRestore[client],NULL_VECTOR);
g_bRespawnPosition[client] = false;
}
//jumpstats: teleporter block
GetClientAbsOrigin(client, g_fPosOld[client]);
//hide radar
CreateTimer(0.0, HideRadar, client);
//set clantag
CreateTimer(3.0, SetClanTag, client);
//set speclist
Format(g_szSpecList[client], 512, "");
if (g_bTeleMenuOpen2[client])
{
g_bTeleMenuOpen2[client] = false;
TeleMenu(client);
}
//godmode
if (g_bgodmode)
SetEntProp(client, Prop_Data, "m_takedamage", 0, 1);
else
SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
}
}
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(client, g_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 = 1; client <= MAXPLAYERS; client++)
{
g_bMenuOpen[client] = true;
g_bTeleMenuOpen[client] = false;
}
}
public Action:Hook_SetTransmit(entity, client)
{
if (client != entity && (0 < 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.5, OnDeathTimer, client);
}
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(client, FindSendPropOffs("CBasePlayer", "m_iHealth"), 100);
else
SetEntData(client, FindSendPropOffs("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 Float: fGroundDiff;
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new weapon = GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon");
if (g_bPluginEnabled && !g_bSpectate[client] && IsPlayerAlive(client) && weapon != -1 && IsClientInGame(client) && !IsFakeClient(client))
{
if (GetEntProp(client, Prop_Data, "m_nWaterLevel") > 0)
return Plugin_Handled;
decl Float:flVelocity[3];
GetEntPropVector(client, Prop_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(client, Prop_Data, "m_vecVelocity", fVelocity);
GetClientAbsOrigin(client, g_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 Float: x = GetEngineTime() - g_fLastTimeDucked[client];
if (x <= 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 > 0 && 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 Float: y = GetEngineTime() - g_fLastJumpTime[client];
if (y <= 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 i = 0; i < MAX_BUTTONS; i++)
{
new button = (1 << 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(client, pos);
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(client, g_fPosOld[client]);
new weapon = GetEntPropEnt(client, Prop_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(client, Prop_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(client, Prop_Data, "m_vecVelocity", CurVelVec);
if (GetVectorLength(CurVelVec) > g_fBhopSpeedCap)
{
NormalizeVector(CurVelVec, CurVelVec);
ScaleVector(CurVelVec, g_fBhopSpeedCap);
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, CurVelVec);
}
}
}
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( 0 < g_strafecount[client] <= MAX_STRAFES )
g_strafe_good_sync[client][g_strafecount[client] - 1]++;
}
if( 0 < g_strafecount[client] <= MAX_STRAFES )
g_strafe_frames[client][g_strafecount[client] - 1]++;
g_sync_frames[client]++;
//GRAVITY
new Handle: g_hgravity = FindConVar("sv_gravity");
new Float: flgravitySrv = 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(client, height);
if (height[2] > g_fMaxHeight[client])
g_fMaxHeight[client] = height[2];
//INVALID GROUND?
new Float:flbaseVelocity[3];
GetEntPropVector(client, Prop_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 != -1 && IsValidEntity(weapon) && GetEntProp(client, Prop_Data, "m_nWaterLevel") < 1 && !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(client, szName, MAX_NAME_LENGTH);
g_bPlayerJumped[client] = false;
GetClientAbsOrigin(client, g_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 Float: fGroundDiff = g_fJump_Final[client][2] - g_fJump_Initial[client][2];
new Float: fJump_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_SM, configFile, sizeof(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 i = 0; i < strafes; i++)
{
if (i==0)
Format(szStrafeSync, 255, "[%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(szStrafeSync2, 255, " %c%i.%c %i%c",GRAY, (i+1),LIMEGREEN,strafe_sync,PERCENT);
else
Format(szStrafeSync2, 255, "%c - %i.%c %i%c",GRAY, (i+1),LIMEGREEN,strafe_sync,PERCENT);
StrCat(szStrafeSync, sizeof(szStrafeSync), szStrafeSync2);
if ((i+1) == strafes)
{
Format(szStrafeSync2, 255, " %c[%c%i%c%c]",GRAY,PURPLE, sync,PERCENT,GRAY);
StrCat(szStrafeSync, sizeof(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,GRAY, g_fJump_Distance[client],LIMEGREEN,strafes,GRAY, LIMEGREEN, g_fPreStrafe[client], GRAY,LIMEGREEN, sync,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]",szName, g_fJump_Distance[client],strafes, g_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
PrintToChat(client, "%t", "Jumpstats_Lj",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafes, g_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
if (g_bEnableSounds[client])
{
decl String:buffer[255];
Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
ClientCommand(client, buffer);
}
//chat all
for (new i = 1; i <= MaxClients; i++)
{
if (1 <= i <= MaxClients && IsClientInGame(i) && IsValidEntity(i))
{
if (g_bColorChat[i] && i != client)
PrintToChat(i, "%t", "Jumpstats_Lj",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafes, g_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_szMapName, g_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]",szName, g_fJump_Distance[client],strafes, g_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
PrintToChat(client, "%t", "Jumpstats_Lj",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_fJump_Distance[client],RED,DARKRED,RED,strafes, g_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 i = 1; i <= MaxClients; i++)
{
if (1 <= i <= MaxClients && IsClientInGame(i) && IsValidEntity(i))
{
if (g_bColorChat[i] && i != client)
{
PrintToChat(i, "%t", "Jumpstats_Lj",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_fJump_Distance[client],RED,DARKRED,RED,strafes, g_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,YELLOW, g_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] == 1 && g_fPreStrafe[client] > 350.0)
{
}
else
{
g_multi_bhop_count[client]++;
decl String:szBhopCount[255];
Format(szBhopCount, sizeof(szBhopCount), "%i", g_multi_bhop_count[client]);
if (g_multi_bhop_count[client] > 8)
Format(szBhopCount, sizeof(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,WHITE, GRAY, g_fJump_Distance[client],LIMEGREEN, strafes, GRAY, LIMEGREEN, g_fPreStrafe[client], GRAY, LIMEGREEN, sync,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]",szName, g_fJump_Distance[client],strafes, g_fPreStrafe[client], g_fMaxSpeed_Test[client], szBhopCount,sync,PERCENT);
PrintToChat(client, "%t", "Jumpstats_MultiBhop",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafes, g_fPreStrafe[client], g_fMaxSpeed_Test[client],szBhopCount,sync,PERCENT)
if (g_bEnableSounds[client])
{
decl String:buffer[255];
Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
ClientCommand(client, buffer);
}
//all
for (new i = 1; i <= MaxClients; i++)
{
if (1 <= i <= MaxClients && IsClientInGame(i) && IsValidEntity(i))
{
if (g_bColorChat[i] && i != client)
PrintToChat(i, "%t", "Jumpstats_MultiBhop",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafes, g_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]",szName, g_fJump_Distance[client],strafes, g_fPreStrafe[client], g_fMaxSpeed_Test[client], szBhopCount,sync,PERCENT);
PrintToChat(client, "%t", "Jumpstats_MultiBhop",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_fJump_Distance[client],RED,DARKRED,RED,strafes, g_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 i = 1; i <= MaxClients; i++)
{
if (1 <= i <= MaxClients && IsClientInGame(i))
{
if (g_bColorChat[i] && i != client)
{
PrintToChat(i, "%t", "Jumpstats_MultiBhop",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_fJump_Distance[client],RED,DARKRED,RED,strafes, g_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,YELLOW, g_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,WHITE, GRAY,g_fJump_Distance[client],LIMEGREEN, strafes, GRAY, LIMEGREEN, g_fPreStrafe[client], GRAY, LIMEGREEN,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,szName, MOSSGREEN,GREEN, g_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafes, g_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]",szName, g_fJump_Distance[client],strafes, g_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
if (g_bEnableSounds[client] == true)
{
decl String:buffer[255];
Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
ClientCommand(client, buffer);
}
//all
for (new i = 1; i <= MaxClients; i++)
{
if (1 <= i <= MaxClients && IsClientInGame(i))
{
if (g_bColorChat[i]==true && i != client)
PrintToChat(i, "%t", "Jumpstats_DropBhop",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafes, g_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,szName, RED,DARKRED, g_fJump_Distance[client],RED,DARKRED,RED,strafes, g_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]",szName, g_fJump_Distance[client],strafes, g_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 i = 1; i <= MaxClients; i++)
{
if (1 <= i <= MaxClients && IsClientInGame(i))
{
if (g_bColorChat[i]==true && i != client)
{
PrintToChat(i, "%t", "Jumpstats_DropBhop",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_fJump_Distance[client],RED,DARKRED,RED,strafes, g_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,YELLOW, g_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,WHITE, GRAY,g_fJump_Distance[client],LIMEGREEN, strafes, GRAY, LIMEGREEN, g_fPreStrafe[client], GRAY, LIMEGREEN, sync,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,szName, MOSSGREEN,GREEN, g_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafes, g_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]",szName, g_fJump_Distance[client],strafes, g_fPreStrafe[client], g_fMaxSpeed_Test[client],sync,PERCENT);
if (g_bEnableSounds[client] == true)
{
decl String:buffer[255];
Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
ClientCommand(client, buffer);
}
//all
for (new i = 1; i <= MaxClients; i++)
{
if (1 <= i <= MaxClients && IsClientInGame(i))
{
if (g_bColorChat[i]==true && i != client)
PrintToChat(i, "%t", "Jumpstats_Weird",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafes, g_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,szName, RED,DARKRED, g_fJump_Distance[client],RED,DARKRED,RED,strafes, g_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]",szName, g_fJump_Distance[client],strafes, g_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 i = 1; i <= MaxClients; i++)
{
if (1 <= i <= MaxClients && IsClientInGame(i))
{
if (g_bColorChat[i]==true && i != client)
{
PrintToChat(i, "%t", "Jumpstats_Weird",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_fJump_Distance[client],RED,DARKRED,RED,strafes, g_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,YELLOW, g_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,GRAY, g_fJump_Distance[client],LIMEGREEN, strafes, GRAY, LIMEGREEN, g_fPreStrafe[client], GRAY, LIMEGREEN, sync,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,szName, MOSSGREEN,GREEN, g_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafes, g_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]",szName, g_fJump_Distance[client],strafes, g_fPreStrafe[client], g_fMaxSpeed_Test[client], sync,PERCENT);
if (g_bEnableSounds[client] == true)
{
decl String:buffer[255];
Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
ClientCommand(client, buffer);
}
//all
for (new i = 1; i <= MaxClients; i++)
{
if (1 <= i <= MaxClients && IsClientInGame(i))
{
if (g_bColorChat[i]==true && i != client)
PrintToChat(i, "%t", "Jumpstats_Bhop",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_fJump_Distance[client],MOSSGREEN,GREEN,MOSSGREEN,strafes, g_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,szName, RED,DARKRED, g_fJump_Distance[client],RED,DARKRED,RED,strafes, g_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]",szName, g_fJump_Distance[client],strafes, g_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 i = 1; i <= MaxClients; i++)
{
if (1 <= i <= MaxClients && IsClientInGame(i))
{
if (g_bColorChat[i]==true && i != client)
{
PrintToChat(i, "%t", "Jumpstats_Bhop",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_fJump_Distance[client],RED,DARKRED,RED,strafes, g_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,YELLOW, g_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(client, flPos);
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 i = 0; i < MAX_STRAFES; i++ )
{
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 (1 <= iEntity <= MaxClients && IsClientInGame(iEntity))
{
if(StrEqual(classname, "player") && g_bPluginEnabled == true)
SDKHook(iEntity, SDKHook_StartTouch, OnTouch);
}
}
// - JumpStats : Surfprotection -
public OnTouch(client, other)
{
if (IsClientInGame(client) && IsPlayerAlive(client))
{
if ((1 <= client <= MaxClients) && !(GetEntityFlags(client) & FL_ONGROUND))
{
g_bCheckSurf[client] = true;
}
if ((1 <= other <= MaxClients) && !(GetEntityFlags(other) & FL_ONGROUND))
{
g_bCheckSurf[other] = true;
}
}
}