summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornavewindre <nw@moneybot.cc>2023-11-22 04:27:09 +0100
committernavewindre <nw@moneybot.cc>2023-11-22 04:27:09 +0100
commit6a292a21a7fcacde51f0551ea9ae76fe36972183 (patch)
tree6d0561fd8ef3402ebbdb25c8c9cdfe9c6ecf7808
parent101833cf3c6abd2e5d69b056c7fb6cfe062a85b8 (diff)
yeee haw
-rw-r--r--sourcemod-1.5-dev/scripting/ljstats.sp261
-rw-r--r--sourcemod/scripting/game_manager.sp5
2 files changed, 213 insertions, 53 deletions
diff --git a/sourcemod-1.5-dev/scripting/ljstats.sp b/sourcemod-1.5-dev/scripting/ljstats.sp
index 30df4ee..29c4881 100644
--- a/sourcemod-1.5-dev/scripting/ljstats.sp
+++ b/sourcemod-1.5-dev/scripting/ljstats.sp
@@ -51,13 +51,12 @@ enum PlayerState
bool:bHideBhopPanel,
bool:bShowBhopStats,
bool:bBeam,
+ bool:bDeadstrafe,
bool:bSound,
bool:bBlockMode,
nVerbosity,
bool:bShowAllJumps,
- #if defined LJSERV
bool:bShowPrestrafeHint,
- #endif
Float:fBlockDistance,
Float:vBlockNormal[2],
@@ -113,6 +112,8 @@ enum PlayerState
Float:vLastOrigin[3],
Float:vLastAngles[3],
Float:vLastVelocity[3],
+ Float:vTPOrigin[3],
+ Float:vTPAngles[3],
String:strHUDHint[HUD_HINT_SIZE / 4], // string characters are stored as cells
@@ -323,6 +324,7 @@ new g_BeamModel;
new Handle:g_hCvarColorMin = INVALID_HANDLE;
new Handle:g_hCvarColorMax = INVALID_HANDLE;
+new Handle:g_hCvarColorTop = INVALID_HANDLE;
new Handle:g_hCvarLJMin = INVALID_HANDLE;
new Handle:g_hCvarLJMax = INVALID_HANDLE;
new Handle:g_hCvarNonLJMax = INVALID_HANDLE;
@@ -365,19 +367,19 @@ new Handle:g_hCookieDefaultsSet = INVALID_HANDLE;
new Handle:g_hCookieLJEnabled = INVALID_HANDLE;
new Handle:g_hCookieBlockMode = INVALID_HANDLE;
new Handle:g_hCookieBeam = INVALID_HANDLE;
+new Handle:g_hCookieDeadstrafe = INVALID_HANDLE;
new Handle:g_hCookieSound = INVALID_HANDLE;
new Handle:g_hCookieHidePanel = INVALID_HANDLE;
new Handle:g_hCookieHideBhopPanel = INVALID_HANDLE;
new Handle:g_hCookieShowBhopStats = INVALID_HANDLE;
new Handle:g_hCookieVerbosity = INVALID_HANDLE;
new Handle:g_hCookieShowAllJumps = INVALID_HANDLE;
-#if defined LJSERV
new Handle:g_hCookieShowPrestrafeHint = INVALID_HANDLE;
-#endif
new Handle:g_hCookiePersonalBest = INVALID_HANDLE;
new g_ColorMin[3] = {0xAD, 0xD8, 0xE6}; // Lightblue!
new g_ColorMax[3] = {0x00, 0x00, 0xFF};
+new g_ColorTop[3] = {0xFF, 0xFF, 0x00};
new Float:g_fLJMin = 260.0;
new Float:g_fLJMax = 275.0;
new Float:g_fNonLJMax = 275.0;
@@ -422,6 +424,7 @@ public OnPluginStart()
g_hCvarColorMin = CreateCvar("ljstats_color_min", "ADD8E6");
g_hCvarColorMax = CreateCvar("ljstats_color_max", "0000FF");
+ g_hCvarColorTop = CreateCvar("ljstats_color_top", "FFFF00");
g_hCvarLJMin = CreateCvar("ljstats_lj_min", "260");
g_hCvarLJMax = CreateCvar("ljstats_lj_max", "275");
g_hCvarNonLJMax = CreateCvar("ljstats_nonlj_max", "275");
@@ -483,15 +486,13 @@ public OnPluginStart()
HookEvent("player_death", Event_PlayerDeath);
RegConsoleCmd("sm_ljhelp", Command_LJHelp);
- #if !defined LJSERV
- RegConsoleCmd("sm_lj", Command_LJ);
- #else
+
RegConsoleCmd("sm_lj", Command_LJSettings);
- #endif
RegConsoleCmd("sm_ljsettings", Command_LJSettings);
RegConsoleCmd("sm_ljs", Command_LJSettings);
RegConsoleCmd("sm_ljpanel", Command_LJPanel);
RegConsoleCmd("sm_ljbeam", Command_LJBeam);
+ RegConsoleCmd("sm_ljdeadstrafe", Command_LJDeadstrafe);
RegConsoleCmd("sm_ljblock", Command_LJBlock);
RegConsoleCmd("sm_ljb", Command_LJBlock);
RegConsoleCmd("sm_ljsound", Command_LJSound);
@@ -501,7 +502,10 @@ public OnPluginStart()
#if defined LJSERV
RegConsoleCmd("sm_wr", Command_LJTop);
#endif
+ RegConsoleCmd("sm_tpmenu", Command_CheckpointPanel);
+
RegAdminCmd("sm_ljtopdelete", Command_LJTopDelete, ADMFLAG_RCON);
+ RegAdminCmd("sm_kz", Command_KZ, ADMFLAG_RCON);
RegConsoleCmd("sm_gap", Command_Gap);
RegConsoleCmd("sm_blockgap", Command_BlockGap);
RegConsoleCmd("sm_tele", Command_Tele);
@@ -517,15 +521,14 @@ public OnPluginStart()
g_hCookieLJEnabled = RegClientCookie("ljstats_ljenabled", "ljstats_ljenabled", CookieAccess_Public);
g_hCookieBlockMode = RegClientCookie("ljstats_blockmode", "ljstats_blockmode", CookieAccess_Public);
g_hCookieBeam = RegClientCookie("ljstats_beam", "ljstats_beam", CookieAccess_Public);
+ g_hCookieDeadstrafe = RegClientCookie("ljstats_deadstrafe", "ljstats_deadstrafe", CookieAccess_Public);
g_hCookieSound = RegClientCookie("ljstats_sound", "ljstats_sound", CookieAccess_Public);
g_hCookieHidePanel = RegClientCookie("ljstats_hidepanel", "ljstats_hidepanel", CookieAccess_Public);
g_hCookieHideBhopPanel = RegClientCookie("ljstats_hidebhoppanel", "ljstats_hidebhoppanel", CookieAccess_Public);
g_hCookieShowBhopStats = RegClientCookie("ljstats_showbhopstats", "ljstats_showbhopstats", CookieAccess_Public);
g_hCookieVerbosity = RegClientCookie("ljstats_verbosity", "ljstats_verbosity", CookieAccess_Public);
g_hCookieShowAllJumps = RegClientCookie("ljstats_showalljumps", "ljstats_showalljumps", CookieAccess_Public);
- #if defined LJSERV
g_hCookieShowPrestrafeHint = RegClientCookie("ljstats_showprestrafehint", "ljstats_showprestrafehint", CookieAccess_Public);
- #endif
g_hCookiePersonalBest = RegClientCookie("ljstats_personalbest", "ljstats_personalbest", CookieAccess_Private);
for(new i = 1; i < MaxClients; i++)
@@ -845,6 +848,13 @@ public OnCvarChange(Handle:hCvar, const String:strOldValue[], const String:strNe
g_ColorMax[1] = (nColor & 0xFF00) >> 8;
g_ColorMax[2] = nColor & 0xFF;
}
+ else if(hCvar == g_hCvarColorTop)
+ {
+ new nColor = StringToInt(strNewValue, 16);
+ g_ColorTop[0] = (nColor & 0xFF0000) >> 16;
+ g_ColorTop[1] = (nColor & 0xFF00) >> 8;
+ g_ColorTop[2] = nColor & 0xFF;
+ }
ON_CVAR_CHANGE_FLOAT(g_hCvarLJMin, g_fLJMin)
ON_CVAR_CHANGE_FLOAT(g_hCvarLJMax, g_fLJMax)
ON_CVAR_CHANGE_FLOAT(g_hCvarNonLJMax, g_fNonLJMax)
@@ -933,7 +943,6 @@ public OnClientPutInServer(client)
#else
g_PlayerStates[client][bLJEnabled] = true;
#endif
- g_PlayerStates[client][bHidePanel] = true;
g_PlayerStates[client][bBeam] = false;
g_PlayerStates[client][bSound] = true;
//#if defined LJSERV
@@ -944,12 +953,18 @@ public OnClientPutInServer(client)
g_PlayerStates[client][nVerbosity] = g_nVerbosity;
*/
+ g_PlayerStates[client][bHidePanel] = true;
g_PlayerStates[client][bLJEnabled] = true;
g_PlayerStates[client][bOnGround] = true;
g_PlayerStates[client][fBlockDistance] = -1.0;
g_PlayerStates[client][IllegalJumpFlags] = IJF_NONE;
g_PlayerStates[client][nSpectators] = 0;
g_PlayerStates[client][nSpectatorTarget] = -1;
+
+ g_PlayerStates[client][vTPOrigin][0] = 0.0;
+ g_PlayerStates[client][vTPOrigin][1] = 0.0;
+ g_PlayerStates[client][vTPOrigin][2] = 0.0;
+
/*
#if defined LJSERV
g_PlayerStates[client][bShowPrestrafeHint] = true;
@@ -1048,6 +1063,8 @@ public OnClientCookiesCached(client)
SetCookie(client, g_hCookieSound, g_bLJSound);
SetCookie(client, g_hCookieShowBhopStats, g_bShowBhopStats);
+ SetCookie(client, g_hCookieHidePanel, true);
+
SetCookie(client, g_hCookieVerbosity, g_nVerbosity);
@@ -1069,6 +1086,9 @@ public OnClientCookiesCached(client)
GetClientCookie(client, g_hCookieBeam, strCookie, sizeof(strCookie));
g_PlayerStates[client][bBeam] = bool:StringToInt(strCookie);
+
+ GetClientCookie(client, g_hCookieDeadstrafe, strCookie, sizeof(strCookie));
+ g_PlayerStates[client][bDeadstrafe] = bool:StringToInt(strCookie);
GetClientCookie(client, g_hCookieSound, strCookie, sizeof(strCookie));
g_PlayerStates[client][bSound] = bool:StringToInt(strCookie);
@@ -1088,10 +1108,8 @@ public OnClientCookiesCached(client)
GetClientCookie(client, g_hCookieShowAllJumps, strCookie, sizeof(strCookie));
g_PlayerStates[client][bShowAllJumps] = bool:StringToInt(strCookie);
- #if defined LJSERV
GetClientCookie(client, g_hCookieShowPrestrafeHint, strCookie, sizeof(strCookie));
g_PlayerStates[client][bShowPrestrafeHint] = bool:StringToInt(strCookie);
- #endif
GetClientCookie(client, g_hCookiePersonalBest, strCookie, sizeof(strCookie));
g_PlayerStates[client][fPersonalBest] = StringToFloat(strCookie);
@@ -1102,15 +1120,17 @@ ShowSettingsPanel(client)
new Handle:hMenu = CreateMenu(SettingsMenuHandler);
decl String:buf[64];
-
+
+ AddMenuItem(hMenu, "tpmenu", "Show TP menu");
+
Format(buf, sizeof(buf), "LJ stats: %s", g_PlayerStates[client][bLJEnabled] ? "On" : "Off");
AddMenuItem(hMenu, "ljenabled", buf);
- Format(buf, sizeof(buf), "Block mode: %s", g_PlayerStates[client][bBlockMode] ? "On" : "Off");
- AddMenuItem(hMenu, "block", buf);
-
Format(buf, sizeof(buf), "Beam: %s", g_PlayerStates[client][bBeam] ? "On" : "Off");
AddMenuItem(hMenu, "beam", buf);
+
+ Format(buf, sizeof(buf), "Deadstrafe (beam): %s", g_PlayerStates[client][bDeadstrafe] ? "On" : "Off");
+ AddMenuItem(hMenu, "deadstrafe", buf);
Format(buf, sizeof(buf), "Sounds: %s", g_PlayerStates[client][bSound] ? "On" : "Off");
AddMenuItem(hMenu, "sound", buf);
@@ -1129,11 +1149,9 @@ ShowSettingsPanel(client)
Format(buf, sizeof(buf), "Show all jumps: %s", g_PlayerStates[client][bShowAllJumps] ? "On" : "Off");
AddMenuItem(hMenu, "showalljumps", buf);
-
- #if defined LJSERV
+
Format(buf, sizeof(buf), "Prestrafe hint: %s", g_PlayerStates[client][bShowPrestrafeHint] ? "On" : "Off");
AddMenuItem(hMenu, "prestrafehint", buf);
- #endif
DisplayMenu(hMenu, client, 0);
}
@@ -1152,20 +1170,16 @@ public SettingsMenuHandler(Handle:hMenu, MenuAction:ma, client, nItem)
return;
}
- if(!strcmp(strInfo, "ljenabled"))
+ if(!strcmp(strInfo, "tpmenu")) {
+ Command_CheckpointPanel(client, 0);
+ }
+ else if(!strcmp(strInfo, "ljenabled"))
{
g_PlayerStates[client][bLJEnabled] = !g_PlayerStates[client][bLJEnabled];
SetCookie(client, g_hCookieLJEnabled, g_PlayerStates[client][bLJEnabled]);
PrintToChat(client, "LJ stats are now %s", g_PlayerStates[client][bLJEnabled] ? "on" : "off");
ShowSettingsPanel(client);
}
- else if(!strcmp(strInfo, "block"))
- {
- g_PlayerStates[client][bBlockMode] = !g_PlayerStates[client][bBlockMode];
- SetCookie(client, g_hCookieBlockMode, g_PlayerStates[client][bBlockMode]);
- PrintToChat(client, "Block mode is now %s", g_PlayerStates[client][bBlockMode] ? "on" : "off");
- ShowSettingsPanel(client);
- }
else if(!strcmp(strInfo, "beam"))
{
g_PlayerStates[client][bBeam] = !g_PlayerStates[client][bBeam];
@@ -1173,6 +1187,13 @@ public SettingsMenuHandler(Handle:hMenu, MenuAction:ma, client, nItem)
PrintToChat(client, "Beam is now %s", g_PlayerStates[client][bBeam] ? "on" : "off");
ShowSettingsPanel(client);
}
+ else if(!strcmp(strInfo, "deadstrafe"))
+ {
+ g_PlayerStates[client][bDeadstrafe] = !g_PlayerStates[client][bDeadstrafe];
+ SetCookie(client, g_hCookieDeadstrafe, g_PlayerStates[client][bDeadstrafe]);
+ PrintToChat(client, "Deadstrafe beam is now %s", g_PlayerStates[client][bDeadstrafe] ? "on" : "off");
+ ShowSettingsPanel(client);
+ }
else if(!strcmp(strInfo, "sound"))
{
g_PlayerStates[client][bSound] = !g_PlayerStates[client][bSound];
@@ -1219,7 +1240,6 @@ public SettingsMenuHandler(Handle:hMenu, MenuAction:ma, client, nItem)
PrintToChat(client, "Showing all jumps is now %s", g_PlayerStates[client][bShowAllJumps] ? "on" : "off");
ShowSettingsPanel(client);
}
- #if defined LJSERV
else if(!strcmp(strInfo, "prestrafehint"))
{
g_PlayerStates[client][bShowPrestrafeHint] = !g_PlayerStates[client][bShowPrestrafeHint];
@@ -1227,7 +1247,6 @@ public SettingsMenuHandler(Handle:hMenu, MenuAction:ma, client, nItem)
PrintToChat(client, "Prestrafe hint is now %s", g_PlayerStates[client][bShowPrestrafeHint] ? "on" : "off");
ShowSettingsPanel(client);
}
- #endif
}
case MenuAction_End:
@@ -1275,11 +1294,149 @@ public VerbosityMenuHandler(Handle:hMenu, MenuAction:ma, client, nItem)
}
}
+public CheckpointMenuHandler( Handle:hMenu, MenuAction:ma, client, nItem ) {
+ switch( ma ) {
+ case MenuAction_Select:
+ {
+ switch( nItem ) {
+ case 0:
+ {
+ Command_SavePoint(client, 0);
+ Command_CheckpointPanel(client, 0);
+ }
+
+ case 1:
+ {
+ Command_LoadPoint(client, 0);
+ Command_CheckpointPanel(client, 0);
+ }
+ }
+ }
+
+ case MenuAction_End:
+ {
+ CloseHandle( hMenu );
+ }
+ }
+}
+
+new Handle:nh_warmup = INVALID_HANDLE;
+public Action:Command_SavePoint(client, args) {
+ if( !g_PlayerStates[client][bOnGround] ) {
+ PrintToChat( client, "\x07FF00FFCannot save a checkpoint midair!" );
+ return Plugin_Handled;
+ }
+
+ if( nh_warmup == INVALID_HANDLE ) {
+ nh_warmup = FindConVar( "nh_warmup" );
+ }
+
+ if( nh_warmup && GetConVarInt( nh_warmup ) == 0 ) {
+ PrintToChat( client, "\x07FF00FF Can only teleport during warmup." );
+ return Plugin_Handled;
+ }
+
+ new Float:vOrigin[3];
+ GetClientAbsOrigin(client, vOrigin);
+
+ Array_Copy(vOrigin, g_PlayerStates[client][vTPOrigin], 3);
+ Array_Copy(g_PlayerStates[client][vLastAngles], g_PlayerStates[client][vTPAngles], 3);
+
+ PrintToChat( client, "\x04Checkpoint saved." );
+ return Plugin_Handled;
+}
+
+public Action:Command_LoadPoint(client, args) {
+ if( !IsPlayerAlive(client) ) {
+ PrintToChat( client, "\x07FF00FFCannot teleport while dead." );
+ return Plugin_Handled;
+ }
+
+ if( nh_warmup == INVALID_HANDLE ) {
+ nh_warmup = FindConVar( "nh_warmup" );
+ }
+
+ if( nh_warmup && GetConVarInt( nh_warmup ) == 0 ) {
+ PrintToChat( client, "\x07FF00FFCan only teleport during warmup." );
+ return Plugin_Handled;
+ }
+
+
+ new Float:vVelocity[3], Float:vOrigin[3], Float:vAngle[3];
+ vVelocity[0] = 0.0;
+ vVelocity[1] = 0.0;
+ vVelocity[2] = -2.0;
+
+ Array_Copy(g_PlayerStates[client][vTPOrigin], vOrigin, 3);
+ Array_Copy(g_PlayerStates[client][vTPAngles], vAngle, 3);
+
+ if( vOrigin[0] == 0.0 && vOrigin[1] == 0.0 && vOrigin[2] == 0.0 ) {
+ PrintToChat( client, "\x07FF00FFYou do not have a valid checkpoint." );
+ return Plugin_Handled;
+ }
+
+ g_PlayerStates[client][IllegalJumpFlags] |= IJF_TELEPORT;
+
+ TeleportEntity( client, vOrigin, vAngle, vVelocity );
+
+ PrintToChat( client, "\x01Checkpoint loaded." );
+ return Plugin_Handled;
+}
+
+public Action:Command_CheckpointPanel(client, args) {
+ if( !IsPlayerAlive(client) ) {
+ PrintToChat( client, "\x07FF00FFCannot teleport while dead." );
+ return Plugin_Handled;
+ }
+
+ if( nh_warmup == INVALID_HANDLE ) {
+ nh_warmup = FindConVar( "nh_warmup" );
+ }
+
+ if( nh_warmup && GetConVarInt( nh_warmup ) == 0 ) {
+ PrintToChat( client, "\x07FF00FFCan only teleport during warmup." );
+ return Plugin_Handled;
+ }
+
+ new Handle:hPanel = CreateMenu(CheckpointMenuHandler);
+
+ AddMenuItem( hPanel, "savetp", "save checkpoint" );
+ AddMenuItem( hPanel, "loadtp", "load checkpoint" );
+ DisplayMenu(hPanel, client, MENU_TIME_FOREVER);
+
+ return Plugin_Handled;
+}
+
+public Action:Command_KZ(client, args) {
+ if( nh_warmup == INVALID_HANDLE ) {
+ nh_warmup = FindConVar( "nh_warmup" );
+ }
+
+ if( nh_warmup ) {
+ SetConVarInt( nh_warmup, -1 );
+ }
+ else {
+ ServerCommand( "mp_ignore_round_win_conditions 1" );
+ }
+
+ ServerCommand( "bot_kick" );
+ return Plugin_Handled;
+}
+
+public Action:Command_LJDeadstrafe(client, args)
+{
+ g_PlayerStates[client][bDeadstrafe] = !g_PlayerStates[client][bDeadstrafe];
+ SetCookie(client, g_hCookieDeadstrafe, g_PlayerStates[client][bDeadstrafe]);
+ PrintToChat(client, "Deadstrafe beam %s", g_PlayerStates[client][bDeadstrafe] ? "ENABLED" : "DISABLED");
+
+ return Plugin_Handled;
+}
+
public Action:Command_LJPanel(client, args)
{
g_PlayerStates[client][bHidePanel] = !g_PlayerStates[client][bHidePanel];
SetCookie(client, g_hCookieHidePanel, g_PlayerStates[client][bHidePanel]);
- PrintToChat(client, "Longjump panel %s", g_PlayerStates[client][bHidePanel] ? "ENABLED" : "DISABLED");
+ PrintToChat(client, "Longjump panel %s", !g_PlayerStates[client][bHidePanel] ? "ENABLED" : "DISABLED");
return Plugin_Handled;
}
@@ -1295,10 +1452,6 @@ public Action:Command_LJBeam(client, args)
public Action:Command_LJBlock(client, args)
{
- g_PlayerStates[client][bBlockMode] = !g_PlayerStates[client][bBlockMode];
- SetCookie(client, g_hCookieBlockMode, g_PlayerStates[client][bBlockMode]);
- PrintToChat(client, "Longjump block mode %s", g_PlayerStates[client][bBlockMode] ? "ENABLED" : "DISABLED");
-
return Plugin_Handled;
}
@@ -2567,9 +2720,10 @@ _OnPlayerRunCmd(client, buttons, const Float:vOrigin[3], const Float:vAngles[3],
if(!g_PlayerStates[client][bOnGround])
CheckValidJump(client);
-
+ new bool:teleport = !!(g_PlayerStates[client][IllegalJumpFlags] & IJF_TELEPORT);
+
// BEAMU
- if(g_PlayerStates[client][bBeam] && !bGround && (g_PlayerStates[client][bShowBhopStats] || g_PlayerStates[client][nBhops] < 2))
+ if(g_PlayerStates[client][bBeam] && !bGround && !teleport && (g_PlayerStates[client][bShowBhopStats] || g_PlayerStates[client][nBhops] < 2))
{
new Float:v1[3], Float:v2[3];
v1[0] = vOrigin[0];
@@ -2581,8 +2735,16 @@ _OnPlayerRunCmd(client, buttons, const Float:vOrigin[3], const Float:vAngles[3],
v2[2] = g_PlayerStates[client][vJumpOrigin][2];
new color[4] = {255, 255, 255, 100};
-
- if(g_PlayerStates[client][CurStrafeDir] % STRAFE_DIRECTION:2)
+ if(bDucked)
+ {
+ color[1] = 0;
+ color[2] = 0;
+ }
+ else if( vVelocity[2] > 0 && vVelocity[2] < 140 && g_PlayerStates[client][bDeadstrafe] ) {
+ color[1] = 120;
+ color[2] = 0;
+ }
+ else if(g_PlayerStates[client][CurStrafeDir] % STRAFE_DIRECTION:2)
{
color[0] = 128;
color[1] = 128;
@@ -2625,12 +2787,10 @@ _OnPlayerRunCmd(client, buttons, const Float:vOrigin[3], const Float:vAngles[3],
PlayerLand(client);
}
- #if defined LJSERV
if(g_PlayerStates[client][bLJEnabled] && g_PlayerStates[client][bShowPrestrafeHint])
{
PrintPrestrafeHint(client);
}
- #endif
return;
}
@@ -2688,12 +2848,10 @@ _OnPlayerRunCmd(client, buttons, const Float:vOrigin[3], const Float:vAngles[3],
PlayerLand(client);
}
- #if defined LJSERV
if(g_PlayerStates[client][bLJEnabled] && g_PlayerStates[client][bShowPrestrafeHint])
{
PrintPrestrafeHint(client);
}
- #endif
return;
}
@@ -2875,12 +3033,10 @@ _OnPlayerRunCmd(client, buttons, const Float:vOrigin[3], const Float:vAngles[3],
PlayerLand(client);
}
- #if defined LJSERV
if(g_PlayerStates[client][bLJEnabled] && g_PlayerStates[client][bShowPrestrafeHint])
{
PrintPrestrafeHint(client);
}
- #endif
}
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:vAngles[3], &weapon)
@@ -2902,7 +3058,6 @@ public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:vAn
return Plugin_Continue;
}
-#if defined LJSERV
PrintPrestrafeHint(client)
{
new bool:bGround = bool:(GetEntityFlags(client) & FL_ONGROUND);
@@ -2922,7 +3077,6 @@ PrintPrestrafeHint(client)
PrintHintText(client, strHint);
}
-#endif
PlayerLand(client)
{
@@ -3564,9 +3718,16 @@ OutputJump(client, String:buf[1024])
}
new nColor[3];
- for(new i; i < 3; i++) {
- nColor[i] = RoundFloat((MIN(MAX(g_PlayerStates[client][fJumpDistance], fMinClamp), fMax) - fMinClamp) /
- (fMax - fMinClamp) * (g_ColorMax[i] - g_ColorMin[i]) + g_ColorMin[i]);
+ if( g_PlayerStates[client][fJumpDistance] > fMax ) {
+ for( new i = 0; i < 3; ++i ) {
+ nColor[i] = g_ColorTop[i];
+ }
+ }
+ else {
+ for(new i; i < 3; i++) {
+ nColor[i] = RoundFloat((MIN(MAX(g_PlayerStates[client][fJumpDistance], fMinClamp), fMax) - fMinClamp) /
+ (fMax - fMinClamp) * (g_ColorMax[i] - g_ColorMin[i]) + g_ColorMin[i]);
+ }
}
Format(buf, sizeof(buf), "\x07%02X%02X%02X",
diff --git a/sourcemod/scripting/game_manager.sp b/sourcemod/scripting/game_manager.sp
index e3246c1..3fcd3c7 100644
--- a/sourcemod/scripting/game_manager.sp
+++ b/sourcemod/scripting/game_manager.sp
@@ -227,7 +227,7 @@ public Action:RespawnPlayerDeathmatch( Handle:timer, any:userid ) {
CS_RespawnPlayer( id );
}
-public VerifyTeamCounts() {
+public Action:VerifyTeamCounts( Handle:timer, any:unused ) {
new entToKickT = 0;
new entToKickCT = 0;
new countCT = 0;
@@ -301,12 +301,11 @@ public Action:Listener_JoinTeam( id, const String: command[], args ) {
return Plugin_Handled;
}
- VerifyTeamCounts();
return Plugin_Continue;
}
public Action:Event_PlayerTeam( Handle:event, const String:name[], bool dontBroadcast ) {
- VerifyTeamCounts();
+ CreateTimer( 0.2, VerifyTeamCounts, 0, 0 );
return Plugin_Continue;
}