From cb1b3e259f74c6bde3b121349e1d36958eb92e98 Mon Sep 17 00:00:00 2001 From: rick Date: Sat, 29 May 2021 03:15:03 +0200 Subject: [PATCH] =?UTF-8?q?Changement=20nom=20=C3=A9quipe=20socket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infolan.sp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/infolan.sp b/infolan.sp index 40688a6..67adf82 100644 --- a/infolan.sp +++ b/infolan.sp @@ -31,7 +31,8 @@ public Plugin myinfo = public void OnPluginStart() { HookEvent("player_activate", SetTeamPlayer); - HookEvent("cs_win_panel_round", UpdateScoreBoard); + //HookEvent("cs_win_panel_round", UpdateScoreBoard); + HookEvent("cs_win_panel_match", FinCarte); //HookEvent("cs_match_end_restart", TestRestart, EventHookMode_Pre); RegServerCmd("!team", SetTeam); @@ -43,6 +44,12 @@ public void OnPluginStart() PrintToServer("Hello world!"); } +public void FindCarte() +{ + ServeurLibre(); + Handle socket = SocketCreate(SOCKET_TCP, OnSocketError); + SocketConnect(socket, SocketUpdateScore, OnSocketReceive, OnSocketDisconnected, MY_SOCKET_IP, MY_SOCKET_PORT); +} public void TestRestart(Event event, const char[] name, bool dontBroadcast) { @@ -211,13 +218,8 @@ public void SocketUpdateScore(Handle socket, any arg) { char requestStr[1024]; char json[64]; - char nomTeamDeux[150]; - char nomTeamUn[150]; - GetTeamName(CS_TEAM_CT, nomTeamUn, sizeof(nomTeamUn)); - GetTeamName(CS_TEAM_T, nomTeamDeux, sizeof(nomTeamDeux)); - FormatEx(json, sizeof(json), "{\"port\": %d, \"%s\": %d, \"%s\": %d}", - port, nomTeamUn, CS_GetTeamScore(CS_TEAM_CT), - nomTeamDeux, CS_GetTeamScore(CS_TEAM_T)); + FormatEx(json, sizeof(json), "{\"port\": %d, \"ct\": %d, \"t\": %d}", + port, CS_GetTeamScore(CS_TEAM_CT), CS_GetTeamScore(CS_TEAM_T)); FormatEx( requestStr, sizeof(requestStr),