Improved player index

The latest version of cssharp adds player.Index instead of entityIndex and does not allow to compile
This commit is contained in:
daffyyyy
2023-11-30 02:20:16 +01:00
parent 00f920713d
commit be51e4d1e9
7 changed files with 60 additions and 64 deletions

View File

@@ -229,9 +229,9 @@ namespace WeaponPaints
internal async Task SyncWeaponPaintsToDatabase(CCSPlayerController? player)
{
if (!Utility.IsPlayerValid(player)) return;
if (player == null || !Utility.IsPlayerValid(player)) return;
int playerIndex = (int)player!.EntityIndex!.Value.Value;
int playerIndex = (int)player.Index;
string steamId = new SteamID(player.SteamID).SteamId64.ToString();
using var connection = new MySqlConnection(_databaseConnectionString);