- Minor changes
- Added `css_gravity` command
- Added `css_money` command
- Changed Utc time to LocalTime
- Updated translations (ChatGPT generated)
- Updated css version
This commit is contained in:
Dawid Bepierszcz
2024-03-07 13:34:31 +01:00
parent da6fb2fc22
commit 2ab2f9c4dc
27 changed files with 731 additions and 489 deletions

View File

@@ -38,6 +38,24 @@ public static class PlayerExtensions
playerPawnValue.VelocityModifier = speed;
}
public static void SetGravity(this CCSPlayerController controller, float gravity)
{
CCSPlayerPawn? playerPawnValue = controller.PlayerPawn.Value;
if (playerPawnValue == null) return;
playerPawnValue.GravityScale = gravity;
}
public static void SetMoney(this CCSPlayerController controller, int money)
{
var moneyServices = controller.InGameMoneyServices;
if (moneyServices == null) return;
moneyServices.Account = money;
Utilities.SetStateChanged(controller, "CCSPlayerController", "m_pInGameMoneyServices");
}
public static void SetHp(this CCSPlayerController controller, int health = 100)
{
if (health <= 0 || !controller.PawnIsAlive || controller.PlayerPawn.Value == null) return;
@@ -103,6 +121,8 @@ public static class PlayerExtensions
if (CS2_SimpleAdmin.Instance == null)
return;
newName = CS2_SimpleAdmin._localizer?["sa_unknown"] ?? "Unknown";
SchemaString<CBasePlayerController> playerName = new SchemaString<CBasePlayerController>(controller, "m_iszPlayerName");
playerName.Set(newName + " ");