Sarrus1 / FaceitLevels-for-kento-RankMe

A Sourcemod plugin module for Kento RankMe to display players' rank using faceit icons.
https://forums.alliedmods.net/showthread.php?t=329077
9 stars 1 forks source link

Client index 0 is invalid #4

Closed Shaneajm closed 2 years ago

Shaneajm commented 2 years ago

Hello. I'm getting the following errors when trying to use this plugin:

Server Info

Game Server OS: Linux Complied on: sourcemod-1.10.0-git6545 Running on SourceMod 1.11.0.6906 RankMe version: 3.0.3.Kento.33.3

Errors

Exception reported: Client index 0 is invalid
L 08/29/2022 - 04:14:27: [SM] Blaming: Levels-kento-rankme.smx
L 08/29/2022 - 04:14:27: [SM] Call stack trace:
L 08/29/2022 - 04:14:27: [SM]   [0] IsClientConnected
L 08/29/2022 - 04:14:27: [SM]   [1] Line 207, C:\Users\Shane\Downloads\sourcemod-1.10.0-git6545-windows\addons\sourcemod\scripting\Levels-kento-rankme.sp::IsValidClient
L 08/29/2022 - 04:14:27: [SM]   [2] Line 99, C:\Users\Shane\Downloads\sourcemod-1.10.0-git6545-windows\addons\sourcemod\scripting\Levels-kento-rankme.sp::OnPluginStart
L 08/29/2022 - 04:14:27: [SM]   [4] ServerCommandEx
L 08/29/2022 - 04:23:36: [SM] Exception reported: Client index 0 is invalid
L 08/29/2022 - 04:23:36: [SM] Blaming: Levels-kento-rankme.smx
L 08/29/2022 - 04:23:36: [SM] Call stack trace:
L 08/29/2022 - 04:23:36: [SM]   [0] IsClientConnected
L 08/29/2022 - 04:23:36: [SM]   [1] Line 207, C:\Users\Shane\Downloads\sourcemod-1.10.0-git6545-windows\addons\sourcemod\scripting\Levels-kento-rankme.sp::IsValidClient
L 08/29/2022 - 04:23:36: [SM]   [2] Line 148, C:\Users\Shane\Downloads\sourcemod-1.10.0-git6545-windows\addons\sourcemod\scripting\Levels-kento-rankme.sp::OnRoundEnd

Attempted Fix

Changing the code to int i=1 makes the icon visible but fails to update and shows the incorrect level.

ReloadSkillLevelsMins();
      for(int i=0; i<MAXPLAYERS+1; i++)
      {
        if(IsValidClient(i)&&RankMe_IsPlayerLoaded(i))
        RefreshSkillLevel(i);
      }

}

Any help would be appreciated!

Sarrus1 commented 2 years ago

Hi, just saw this, were you able to fix your issue?