Skip to content

Commit

Permalink
update 0.3.1c
Browse files Browse the repository at this point in the history
  • Loading branch information
jke-cs committed Oct 22, 2024
1 parent d191cd9 commit 5316e92
Show file tree
Hide file tree
Showing 13 changed files with 522 additions and 256 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
> [!NOTE]
> The original creator of SharpTimer is deafps, who discontinued support for the project after version 0.2.6. This fork is now maintaned by the community, mainly [rcnoob](https://github.com/rcnoob).
> The original creator of SharpTimer is dea_bb, who discontinued support for the project after version 0.2.6. This fork is now maintaned by the community, mainly [rcnoob](https://github.com/rcnoob).


Expand All @@ -8,6 +8,10 @@
<div align="center">
<img src="https://files.catbox.moe/qvawnf.png" alt="" style="margin: 0;">
</div>
<p align="center">
<br>
<a href="https://ko-fi.com/rcnoob"><img width="185" src="https://files.catbox.moe/rig9aq.svg" alt="Badge"></a>
</p>


# SharpTimer
Expand Down Expand Up @@ -80,20 +84,24 @@ SharpTimer is a "simple" Surf/KZ/Bhop/MG/Deathrun/etc. CS2 Timer plugin using Co

[**MetaMod**](https://cs2.poggu.me/metamod/installation/)

[**CounterStrikeSharp** *(v215 and up)*](https://github.com/roflmuffin/CounterStrikeSharp/releases)
[**CounterStrikeSharp** *(v281 and up)*](https://github.com/roflmuffin/CounterStrikeSharp/releases)

[**SharpTimerModelSetter** *(optional but recommended for custom player models)*](https://github.com/johandrevwyk/STCustomModels)

[**MovementUnlocker** *(optional but recommended)*](https://github.com/Source2ZE/MovementUnlocker)
[**MovementUnlocker** *(optional but recommended for surf and bhop servers)*](https://github.com/Source2ZE/MovementUnlocker)

[**RampBugFix** *(optional but recommended for surf servers)*](https://github.com/Interesting-exe/CS2Fixes-RampbugFix/)

[**Web panel** *(optional but recommended)*](https://github.com/Letaryat/sharptimer-web-panel)

[**SharpTimer-WallLists** *(optional but recommended)*](https://github.com/M-archand/SharpTimer-WallLists/tree/PointsList)
[**SharpTimer-WallLists** *(optional but recommended)*](https://github.com/M-archand/SharpTimer-WallLists)

[**CS2-TeleportAnglesFix** *(optional but recommended)*](https://github.com/M-archand/CS2-TeleportAnglesFix)

[**STFixes** *(optional but recommended)*](https://github.com/rcnoob/STFixes)

[**Flashing HUD Fix** *(optional but recommended)*](https://github.com/deabb/CS2FlashingHtmlHudFix)


## Install
* Download the [latest release](https://github.com/Letaryat/poor-sharptimer/releases),
Expand Down Expand Up @@ -146,7 +154,7 @@ SharpTimer is a "simple" Surf/KZ/Bhop/MG/Deathrun/etc. CS2 Timer plugin using Co
- [x] Max
- [x] Height
- [x] Width
- [x] Sync
- [ ] Sync
- [ ] Jump Types
- [x] Long Jump
- [x] BunnyHop
Expand All @@ -162,4 +170,7 @@ SharpTimer is a "simple" Surf/KZ/Bhop/MG/Deathrun/etc. CS2 Timer plugin using Co
- [ ] Strafe Sync Bar on HUD


## Author: [@DEA_BB](https://twitter.com/dea_bb)
## Authors:
[DEA_BB](https://twitter.com/dea_bb)
[Letaryat](https://github.com/Letaryat)
[rcnoob](https://github.com/rcnoob)
7 changes: 2 additions & 5 deletions cfg/SharpTimer/config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ sharptimer_remove_legs true
sharptimer_remove_collision true // Whether player collision should be removed or not. Default value: true
sharptimer_remove_damage true // Whether dealing damage should be disabled or not (will crash with cs2fixes since they hook/detour damage regardless of you using their feature). Default value: true
sharptimer_remove_crouch_fatigue true // Whether the player should get no crouch fatigue or not. Default value: true
sharptimer_trigger_push_fix false // When enabled all trigger_push ents will only push once OnStartTouch. Default value: false
sharptimer_hide_all_players false // Whether all players should be hidden or not. Default value: false
sharptimer_bhop_block_ticks 16 // Ticks allowed on bhop_block. Default value: 16
sharptimer_spawn_on_respawnpos false // Teleports player to respawnpos on spawn. Default value: false
sharptimer_stage_times_enabled true // Whether stage time records are enabled by default or not. Default value: true
Expand Down Expand Up @@ -101,9 +99,8 @@ sharptimer_enable_noclip false
sharptimer_global_rank_points_enabled false // Whether the plugin should reward players with global points for completing maps. MySQL Requierd. Default value: false
sharptimer_display_rank_tags_chat true // Whether the plugin should display rank tags infront of players names in chat or not. Default value: true
sharptimer_display_rank_tags_scoreboard true // Whether the plugin should display rank tags infront of players names in scoreboard or not. Default value: true
sharptimer_global_rank_free_points_enabled true // Whether the plugin should reward players with free points for completing maps without beating their PB (31xMapTier). Default value: true
sharptimer_global_rank_max_free_rewards 20 // How many times the player should recieve free 'participation' points for finishing the map without a new PB. Default value: 20
sharptimer_global_rank_min_points_threshold 1000 // Players with Points below this amount will be treated as Unranked. Default value: 1000
sharptimer_global_rank_min_points_threshold 1 // Players with Points below this amount will be treated as Unranked. Default value: 1
sharptimer_global_rank_bonus_points_multiplier 0.5 // Multiplier for bonus course completion points. Default value: 0.5


//REPLAYS
Expand Down
13 changes: 3 additions & 10 deletions src/Commands/ChatCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ public async Task RankCommandHandler(CCSPlayerController? player, string steamId
foreach (var bonusRespawnPose in bonusRespawnPoses)
{
var bonusNumber = bonusRespawnPose.Key;
var bonusPbTicks = enableDb ? await GetPreviousPlayerRecordFromDatabase(player, steamId, currentMapName!, playerName, bonusNumber, style) : await GetPreviousPlayerRecord(player, steamId, bonusNumber);
var bonusPbTicks = enableDb ? await GetPreviousPlayerRecordFromDatabase(steamId, currentMapName!, playerName, bonusNumber, style) : await GetPreviousPlayerRecord(steamId, bonusNumber);

/// Skip this bonus since the player doesn't have a saved time
if (bonusPbTicks <= 0) continue;
Expand All @@ -697,7 +697,7 @@ public async Task RankCommandHandler(CCSPlayerController? player, string steamId
serverPlacement = await GetPlayerServerPlacement(player, steamId, playerName, false, true, false);
}

int pbTicks = enableDb ? await GetPreviousPlayerRecordFromDatabase(player, steamId, currentMapName!, playerName, 0, style) : await GetPreviousPlayerRecord(player, steamId, 0);
int pbTicks = enableDb ? await GetPreviousPlayerRecordFromDatabase(steamId, currentMapName!, playerName, 0, style) : await GetPreviousPlayerRecord(steamId, 0);

Server.NextFrame(() =>
{
Expand Down Expand Up @@ -889,6 +889,7 @@ public void RespawnBonusPlayer(CCSPlayerController? player, CommandInfo command)

[ConsoleCommand("css_startpos", "Saves a custom respawn point within the start trigger")]
[ConsoleCommand("css_setresp", "Saves a custom respawn point within the start trigger")]
[ConsoleCommand("css_ssp", "Saves a custom respawn point within the start trigger")]
[CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)]
public void SetRespawnCommand(CCSPlayerController? player, CommandInfo command)
{
Expand Down Expand Up @@ -1054,14 +1055,6 @@ public void RespawnPlayerCommand(CCSPlayerController? player, CommandInfo comman
}
}


[ConsoleCommand("say !r", "Alias for css_r to teleport to start")]
[CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)]
public void RespawnPlayerAliasCommand(CCSPlayerController? player, CommandInfo command)
{
RespawnPlayerCommand(player, command);
}

[ConsoleCommand("css_end", "Teleports you to end")]
[CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)]
public void EndPlayerCommand(CCSPlayerController? player, CommandInfo command)
Expand Down
37 changes: 14 additions & 23 deletions src/Commands/ConfigConvars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,46 +84,37 @@ public void SharpTimerGlobalRanksConvar(CCSPlayerController? player, CommandInfo
globalRanksEnabled = bool.TryParse(args, out bool globalRanksEnabledValue) ? globalRanksEnabledValue : args != "0" && globalRanksEnabled;
}

[ConsoleCommand("sharptimer_global_rank_free_points_enabled", "Whether the plugin should reward players with free points for completing maps without beating their PB (31xMapTier). Default value: true")]
[ConsoleCommand("sharptimer_global_rank_min_points_threshold", "Players with Points below this amount will be treated as Unranked. Default value: 1")]
[CommandHelper(whoCanExecute: CommandUsage.SERVER_ONLY)]
public void SharpTimerGlobalRanksEnableFreeRewardsConvar(CCSPlayerController? player, CommandInfo command)
{
string args = command.ArgString;

globalRanksFreePointsEnabled = bool.TryParse(args, out bool globalRanksFreePointsEnabledValue) ? globalRanksFreePointsEnabledValue : args != "0" && globalRanksFreePointsEnabled;
}

[ConsoleCommand("sharptimer_global_rank_max_free_rewards", "How many times the player should recieve free 'participation' points for finishing the map without a new PB. Default value: 20")]
[CommandHelper(whoCanExecute: CommandUsage.SERVER_ONLY)]
public void SharpTimerGlobalRanksMaxFreeRewardsConvar(CCSPlayerController? player, CommandInfo command)
public void SharpTimerGlobalRanksMinPointsConvar(CCSPlayerController? player, CommandInfo command)
{
string args = command.ArgString;

if (int.TryParse(args, out int maxFreePoints) && maxFreePoints > 0)
if (int.TryParse(args, out int minPoints) && minPoints > 0)
{
maxGlobalFreePoints = maxFreePoints;
SharpTimerConPrint($"SharpTimer free 'participation' rewards set to {maxFreePoints} times.");
minGlobalPointsForRank = minPoints;
SharpTimerConPrint($"SharpTimer min points for rank set to {minPoints} points.");
}
else
{
SharpTimerConPrint("Invalid free 'participation' rewards value. Please provide a positive float.");
SharpTimerConPrint("Invalid min points for rank value. Please provide a positive integer.");
}
}

[ConsoleCommand("sharptimer_global_rank_min_points_threshold", "Players with Points below this amount will be treated as Unranked. Default value: 1000")]
[ConsoleCommand("sharptimer_global_rank_bonus_points_multiplier", "Multiplier for bonus course completion points. Default value: 0.5")]
[CommandHelper(whoCanExecute: CommandUsage.SERVER_ONLY)]
public void SharpTimerGlobalRanksMinPointsConvar(CCSPlayerController? player, CommandInfo command)
public void SharpTimerGlobalRanksBonusPointsConvar(CCSPlayerController? player, CommandInfo command)
{
string args = command.ArgString;

if (int.TryParse(args, out int minPoints) && minPoints > 0)
if (double.TryParse(args, out double bonusMultiplier) && bonusMultiplier > 0)
{
minGlobalPointsForRank = minPoints;
SharpTimerConPrint($"SharpTimer min points for rank set to {minPoints} points.");
globalPointsBonusMultiplier = bonusMultiplier;
SharpTimerConPrint($"SharpTimer bonus points multiplier set to {bonusMultiplier}");
}
else
{
SharpTimerConPrint("Invalid min points for rank value. Please provide a positive integer.");
SharpTimerConPrint("Invalid bonus points multipler. Please provide a positive integer.");
}
}

Expand Down Expand Up @@ -1078,7 +1069,7 @@ public void SharpTimerOnlyAMultiplierConvar(CCSPlayerController? player, Command
}
}

[ConsoleCommand("sharptimer_style_multiplier_onlyw", "Point modifier for onlys. Default value: 1.33")]
[ConsoleCommand("sharptimer_style_multiplier_onlys", "Point modifier for onlys. Default value: 1.33")]
[CommandHelper(whoCanExecute: CommandUsage.SERVER_ONLY)]
public void SharpTimerOnlySMultiplierConvar(CCSPlayerController? player, CommandInfo command)
{
Expand All @@ -1095,7 +1086,7 @@ public void SharpTimerOnlySMultiplierConvar(CCSPlayerController? player, Command
}
}

[ConsoleCommand("sharptimer_style_multiplier_onlyw", "Point modifier for onlyd. Default value: 1.33")]
[ConsoleCommand("sharptimer_style_multiplier_onlyd", "Point modifier for onlyd. Default value: 1.33")]
[CommandHelper(whoCanExecute: CommandUsage.SERVER_ONLY)]
public void SharpTimerOnlyDMultiplierConvar(CCSPlayerController? player, CommandInfo command)
{
Expand Down
Loading

0 comments on commit 5316e92

Please sign in to comment.