Revert player count logic

This commit is contained in:
Redox 2022-05-22 22:06:40 +02:00 committed by Brandon Sturgeon
parent adf0e09caf
commit a01fd1cbc8
3 changed files with 2 additions and 15 deletions

View File

@ -13,7 +13,7 @@ ChatTransit.PlayerConnect = (data) =>
Data:
SteamName: name
SteamId: steamId and SteamIDTo64 steamId
PlayerCountCurrent: ChatTransit.PlayerCount
PlayerCountCurrent: player\GetCount! + 1
PlayerCountMax: game\MaxPlayers!
ChatTransit.PlayerInitialSpawn = (ply) =>

View File

@ -12,7 +12,7 @@ ChatTransit.PlayerDisconnected = (data) =>
Data:
SteamName: ply and ply\Nick! or name
SteamId: ply and ply\SteamID64! or SteamIDTo64 steamId
PlayerCountCurrent: ChatTransit.PlayerCount
PlayerCountCurrent: player\GetCount! - 1
PlayerCountMax: game\MaxPlayers!
Content: reason

View File

@ -1,13 +0,0 @@
gameevent.Listen "player_connect"
gameevent.Listen "player_disconnect"
with ChatTransit
.PlayerCount = 0
.TrackPlayerCountConnected = ->
.PlayerCount = .PlayerCount + 1
.TrackPlayerCountDisconnected = ->
.PlayerCount = .PlayerCount - 1
hook.Add "player_connect", "CFC_ChatTransit_PlayerCountTracker", .TrackPlayerCountConnected
hook.Add "player_disconnect", "CFC_ChatTransit_PlayerCountTracker", .TrackPlayerCountDisconnected