add fixes from 1.4c

This commit is contained in:
Nereziel
2024-02-03 17:44:40 +01:00
parent e0fce7a4b4
commit 8e7b4a2d40
3 changed files with 8 additions and 10 deletions

View File

@@ -10,8 +10,7 @@ namespace WeaponPaints
{
if (!Config.AdditionalSetting.CommandWpEnabled || !Config.AdditionalSetting.SkinEnabled || !g_bCommandsAllowed) return;
if (!Utility.IsPlayerValid(player)) return;
if (player == null || player.Index <= 0) return;
int playerIndex = (int)player!.Index;
if (player == null || !player.IsValid || player.UserId == null || player.Index <= 0 || player.IsBot) return;
PlayerInfo playerInfo = new PlayerInfo
{
@@ -22,8 +21,6 @@ namespace WeaponPaints
IpAddress = player?.IpAddress?.Split(":")[0]
};
if (player == null || player.UserId == null) return;
if (!commandsCooldown.TryGetValue((int)player.UserId, out DateTime cooldownEndTime) ||
DateTime.UtcNow >= (commandsCooldown.TryGetValue((int)player.UserId, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
{