summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornavewindre <nw@moneybot.cc>2023-12-15 06:02:12 +0100
committernavewindre <nw@moneybot.cc>2023-12-15 06:02:12 +0100
commite99b9c6bac7f5b835f025fa1c342e315b3c3d812 (patch)
treef6667c0e3e9eefd5fcb8b41e5710747eec75527f
parent1c54f685bb080b5409e729ed3bc8fc5ad4e1d774 (diff)
aaaa
-rw-r--r--sourcemod-1.5-dev/scripting/ljstats.sp2
-rw-r--r--sourcemod-1.5-dev/scripting/stats.sp18
-rw-r--r--sourcemod/scripting/css-kztimer.sp57
-rw-r--r--sourcemod/scripting/game_manager.sp4
-rw-r--r--web/index.php3
5 files changed, 64 insertions, 20 deletions
diff --git a/sourcemod-1.5-dev/scripting/ljstats.sp b/sourcemod-1.5-dev/scripting/ljstats.sp
index f755835..662a1d5 100644
--- a/sourcemod-1.5-dev/scripting/ljstats.sp
+++ b/sourcemod-1.5-dev/scripting/ljstats.sp
@@ -3561,7 +3561,7 @@ public PrintSyncStats(client) {
}
PrintToConsole( client, strFull );
- if( !g_PlayerStates[client][bSyncStats] || g_PlayerStates[client][nTotalTicks] > 65 )
+ if( !g_PlayerStates[client][bSyncStats] || g_PlayerStates[client][nTotalTicks] > 78 )
return;
Format( strLeft, sizeof( strLeft ), "[ " );
diff --git a/sourcemod-1.5-dev/scripting/stats.sp b/sourcemod-1.5-dev/scripting/stats.sp
index f006f60..bb0b1f1 100644
--- a/sourcemod-1.5-dev/scripting/stats.sp
+++ b/sourcemod-1.5-dev/scripting/stats.sp
@@ -418,7 +418,7 @@ public Float:GetPlayerPoints( client ) {
points += float(g_playerStats[client][plKills]) * 1;
points -= float(g_playerStats[client][plDeaths]) * 0.9;
points += float(g_playerStats[client][plRoundwins]) * 0.5;
- points -= float(g_playerStats[client][plRoundlosses]) * 0.5;
+ points -= float(g_playerStats[client][plRoundlosses]) * 0.5;
points += GetLJScore( client, _:LT_LJ );
points += GetLJScore( client, _:LT_CJ );
points += GetLJScore( client, _:LT_BJ );
@@ -429,7 +429,7 @@ public Float:GetPlayerPoints( client ) {
points += GetLJScore( client, _:LT_WJ );
points += GetKDScore( client );
- if( points < 0 )
+ if( points < 0.0 )
points = 0.0;
return points;
@@ -972,7 +972,21 @@ public DisplayClientStatsToSelf( client ) {
*/
CPrintToChatEx( client, client, chatOutput );
+
+ new String:mapName[64];
+ GetCurrentMap( mapName, sizeof(mapName) );
+
+ if( !strncmp( mapName, "kz_", 3 )
+ || !strncmp( mapName, "bkz_", 4 )
+ || !strncmp( mapName, "xc_", 3 )
+ || !strncmp( mapName, "surf_", 5 )
+ || !strncmp( mapName, "bhop_", 5 ) ) {
+ CreateTimer( 0.1, Timer_SendMsg2, client, TIMER_FLAG_NO_MAPCHANGE );
+ return 0;
+ }
+
CreateTimer( 0.1, Timer_SendMsg, client, TIMER_FLAG_NO_MAPCHANGE );
+ return 0;
}
public DisplayClientStats( client, target ) {
diff --git a/sourcemod/scripting/css-kztimer.sp b/sourcemod/scripting/css-kztimer.sp
index 9a978ad..5070985 100644
--- a/sourcemod/scripting/css-kztimer.sp
+++ b/sourcemod/scripting/css-kztimer.sp
@@ -32,7 +32,7 @@ enum struct PlayerData {
int nTeleports;
bool bShowingMenu;
- bool bHideViewmodel;
+ bool bShowViewmodel;
float vStartPoint[3];
float vStartAngle[3];
@@ -85,6 +85,7 @@ public void OnPluginStart() {
RegConsoleCmd( "sm_viewmodel", Command_HideViewmodel, "Toggle viewmodel." );
RegConsoleCmd( "sm_vm", Command_HideViewmodel, "Toggle viewmodel." );
RegConsoleCmd( "sm_hideweapon", Command_HideViewmodel, "Toggle viewmodel." );
+ RegConsoleCmd( "sm_noclip", Command_Noclip, "Toggle noclip." );
HookEvent( "player_spawn", Event_PlayerSpawn, EventHookMode_Post );
HookEvent( "player_jump", Event_PlayerJump, EventHookMode_Post );
@@ -111,6 +112,7 @@ public void ClearPlayerData( int i ) {
g_playerData[i].bPausedRun = false;
g_playerData[i].bShowingMenu = false;
g_playerData[i].nDuckTicks = 0;
+ g_playerData[i].bShowViewmodel = true;
}
public void ClearAllPlayers() {
@@ -245,7 +247,7 @@ public void ClearRecords() {
}
public Action CommandTimer( Handle timer, any unused ) {
- ServerCommand( "bot_kick; bot_quota 0; nh_warmup 0; sv_airaccelerate 12; mp_falldamage 0; sv_enablebunnyhopping 1" );
+ ServerCommand( "bot_kick; bot_quota 0; nh_warmup 0; sv_airaccelerate 12; mp_falldamage 0; sv_enablebunnyhopping 1; mp_ignore_round_win_conditions 1" );
if( !g_nhWarmup )
g_nhWarmup = FindConVar( "nh_warmup" );
else
@@ -283,6 +285,14 @@ public void OnMapEnd() {
}
public void StartRun( int client ) {
+ MoveType mv = GetEntityMoveType( client );
+ if( mv == MOVETYPE_NOCLIP ) {
+ EmitSoundToClient( client, "buttons/button10.wav" );
+ CPrintToChat( client, "[{green}kz{default}] {red}You cannot use noclip during a run." );
+
+ return;
+ }
+
EmitSoundToClient( client, "buttons/button17.wav" );
CPrintToChat( client, "[{green}kz{default}] {white}run started." );
g_playerData[client].bIsInRun = true;
@@ -335,7 +345,6 @@ public void EndRun( int client ) {
char clientSteamId[32];
GetClientAuthId( client, AuthId_Engine, clientSteamId, sizeof(clientSteamId) );
for( int i = 0; i < g_topTime; i++ ) {
- PrintToChatAll( "%d : %s", i, g_times[i].sSteamid );
if( prevRunTime < 0 && !strcmp( clientSteamId, g_times[i].sSteamid ) ) {
prevRunTime = g_times[i].fFinalTime;
}
@@ -357,7 +366,7 @@ public void EndRun( int client ) {
} else {
Format( chatStr, sizeof(chatStr), "%s%d:%02d.%03d", chatStr, minutes, seconds, milliseconds );
}
-
+
if( prevRunTime > 0.0 ) {
float diff = prevRunTime - time;
float absDiff = FloatAbs( diff );
@@ -384,7 +393,6 @@ public void EndRun( int client ) {
);
}
- CPrintToChatAll( clientSteamId );
CPrintToChatAll( chatStr );
if( prevRunTime < 0.0 || time < prevRunTime ) {
@@ -732,7 +740,7 @@ public Action OnPlayerRunCmd(int client, int& buttons, int& impulse, float vel[3
SetEntityRenderMode( client, RENDER_TRANSCOLOR );
SetEntityRenderColor( client, 255, 255, 255, 100 );
- if( GetEntityMoveType( client ) == MOVETYPE_NOCLIP ) {
+ if( GetEntityMoveType( client ) == MOVETYPE_NOCLIP && g_playerData[client].bIsInRun ) {
g_playerData[client].bIsInRun = false;
CPrintToChat( client, "[{green}kz{default}] {red}You cannot use noclip during a run." );
EmitSoundToClient( client, "buttons/button10.wav" );
@@ -769,9 +777,13 @@ public Action Event_PlayerJump( Event e, const char[] name, bool dontBroadcast )
public Action OnTakeDamage( int client, int& attacker, int& inflictor, float& damage, int& damagetype ) {
if( !g_isKZ ) return Plugin_Continue;
- if( damagetype & DMG_FALL )
+ if( damagetype & DMG_FALL || damagetype & DMG_BULLET )
return Plugin_Handled;
+ if( attacker > 0 && attacker < MaxClients ) {
+ damage = 0.0;
+ }
+
return Plugin_Continue;
}
@@ -798,17 +810,15 @@ public Action Event_PlayerSpawn( Event e, const char[] name, bool dontBroadcast
char cookie[32];
g_hideWeaponCookie.Get( client, cookie, sizeof(cookie) );
- bool hide = !!StringToInt( cookie );
- g_playerData[client].bHideViewmodel = hide;
- SetEntProp( client, Prop_Send, "m_bDrawViewmodel", hide );
+ bool draw = !StringToInt( cookie );
+ g_playerData[client].bShowViewmodel = draw;
+ SetEntProp( client, Prop_Send, "m_bDrawViewmodel", draw );
}
return Plugin_Continue;
}
public int TopTimesMenuHandler( Menu menu, MenuAction ma, int client, int nItem ) {
- LogMessage( "TopTimesMenuHandler %d %d %d", client, ma, nItem );
-
if( ma == MenuAction_Cancel ) {
if( g_playerData[client].bShowingMenu ) {
ShowCheckpointMenu( client, g_isKZ );
@@ -838,7 +848,7 @@ public void ShowTopNubTimes( int client ) {
else
Format( buf, sizeof(buf), "%s%d:%02d.%03d", buf, minutes, seconds, milliseconds );
- Format( buf, sizeof(buf), "%s (%d TP, %d jumps)", buf, g_times[i].nJumps, g_times[i].nTeleports );
+ Format( buf, sizeof(buf), "%s (%d TP, %d jumps)", buf, g_times[i].nTeleports, g_times[i].nJumps );
menu.AddItem( "button", buf, ITEMDRAW_DISABLED );
}
@@ -865,6 +875,8 @@ public void ShowTopProTimes( int client ) {
Format( buf, sizeof(buf), "%s%d:%02d:%02d.%03d", buf, hours, minutes, seconds, milliseconds );
else
Format( buf, sizeof(buf), "%s%d:%02d.%03d", buf, minutes, seconds, milliseconds );
+ Format( buf, sizeof(buf), "%s (%d TP, %d jumps)", buf, g_times[i].nTeleports, g_times[i].nJumps );
+
menu.AddItem( "button", buf, ITEMDRAW_DISABLED );
++it;
@@ -947,11 +959,26 @@ public Action Command_HideViewmodel( int client, int args ) {
SetEntProp( client, Prop_Send, "m_bDrawViewmodel", !draw );
char cookieStr[32];
- IntToString( !draw, cookieStr, sizeof(cookieStr) );
+ IntToString( draw, cookieStr, sizeof(cookieStr) );
g_hideWeaponCookie.Set( client, cookieStr );
- g_playerData[client].bHideViewmodel = !draw;
+ g_playerData[client].bShowViewmodel = !draw;
CPrintToChat( client, "[{green}kz{default}] viewmodel is now %s", !draw ? "shown" : "hidden" );
return Plugin_Handled;
+}
+
+public Action Command_Noclip( int client, int args ) {
+ if( !g_isKZ ) return Plugin_Handled;
+
+ MoveType mv = GetEntityMoveType( client );
+ if( mv != MOVETYPE_NOCLIP ) {
+ SetEntityMoveType( client, MOVETYPE_NOCLIP );
+ CPrintToChat( client, "[{green}kz{default}] noclip enabled." );
+ } else {
+ SetEntityMoveType( client, MOVETYPE_WALK );
+ CPrintToChat( client, "[{green}kz{default}] noclip disabled." );
+ }
+
+ return Plugin_Handled;
} \ No newline at end of file
diff --git a/sourcemod/scripting/game_manager.sp b/sourcemod/scripting/game_manager.sp
index 7959880..f182205 100644
--- a/sourcemod/scripting/game_manager.sp
+++ b/sourcemod/scripting/game_manager.sp
@@ -414,7 +414,7 @@ public Event_PlayerDeath( Handle:event, const String:name[], bool dontBroadcast
public Action:RespawnPlayerDeathmatch( Handle:timer, any:userid ) {
new dmmode = GetConVarInt( g_h_nh_warmup );
- if( !dmmode )
+ if( !dmmode && !g_isKZ )
return;
new id = GetClientOfUserId( userid );
@@ -523,7 +523,7 @@ public Action:Event_PlayerTeam( Handle:event, const String:name[], bool dontBroa
CreateTimer( 0.2, VerifyTeamCounts, 0, 0 );
new uid = GetEventInt( event, "userid" );
- if( GetConVarInt( g_h_nh_warmup ) != 0 ) {
+ if( GetConVarInt( g_h_nh_warmup ) != 0 || g_isKZ ) {
CreateTimer( 0.5, RespawnPlayerDelay, uid );
}
diff --git a/web/index.php b/web/index.php
index bab978c..ee7e333 100644
--- a/web/index.php
+++ b/web/index.php
@@ -134,6 +134,9 @@ function generate_mc_status_div($server = null) {
$server1data = query_source_server("107.192.200.138", "27015");
if( $server1data['playersmax'] > 0 )
generate_status_div($server1data, false);
+ $server1data = query_source_server("107.192.200.138", "27016");
+ if( $server1data['playersmax'] > 0 )
+ generate_status_div($server1data, false);
$mcserverdata = query_minecraft_server("45.33.90.90", "25565");
if ($mcserverdata['result_valid'] == true) {
generate_mc_status_div($mcserverdata);