Update Commands.cs

This commit is contained in:
Nereziel
2024-02-03 17:46:01 +01:00
parent 8e7b4a2d40
commit d83783b7af

View File

@@ -21,7 +21,7 @@ namespace WeaponPaints
IpAddress = player?.IpAddress?.Split(":")[0]
};
if (!commandsCooldown.TryGetValue((int)player.UserId, out DateTime cooldownEndTime) ||
if (!commandsCooldown.TryGetValue((int)player!.UserId, out DateTime cooldownEndTime) ||
DateTime.UtcNow >= (commandsCooldown.TryGetValue((int)player.UserId, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
{
commandsCooldown[(int)player.UserId] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);