Suppression du kick & nom équipe dans score socket

This commit is contained in:
rick 2021-05-29 02:27:02 +02:00
parent 23f3635d68
commit 5280fc6f08
Signed by: Rick
GPG key ID: 2B593F087240EE99

View file

@ -11,6 +11,8 @@
char teamCT[5][150];
char teamT[5][150];
char clientId[128];
char nomTeamDeux[150];
char nomTeamUn[150];
int allId[20];
int nbAllId = 0;
@ -24,7 +26,7 @@ public Plugin myinfo =
description = "Bot communiquant avec le bot discord \
https://github.com/Lunki51/cs-picker afin dautomatiser \
lInfoLan 2021",
version = "1.5.4",
version = "1.5.5",
url = "https://git.gnous.eu/Rick/infolanBot"
};
@ -32,7 +34,7 @@ public void OnPluginStart()
{
HookEvent("player_activate", SetTeamPlayer);
HookEvent("cs_win_panel_round", UpdateScoreBoard);
HookEvent("cs_match_end_restart", TestRestart, EventHookMode_Pre);
//HookEvent("cs_match_end_restart", TestRestart, EventHookMode_Pre);
RegServerCmd("!team", SetTeam);
/* pour le debug
@ -128,9 +130,15 @@ public Action SetTeam(int args)
int team = (!strcmp(arg, "ct", false) ? 1 : 2);
GetCmdArg(2, arg, sizeof(arg));
if (team == 1)
{
ServerCommand("mp_teamname_1 %s", arg)
nomTeamUn = arg;
}
else
{
ServerCommand("mp_teamname_2 %s", arg)
nomTeamDeux = arg;
}
if (args == 7)
{
@ -211,8 +219,9 @@ public void SocketUpdateScore(Handle socket, any arg)
{
char requestStr[1024];
char json[64];
FormatEx(json, sizeof(json), "{\"port\": %d, \"ct\": %d, \"t\": %d}",
port, CS_GetTeamScore(CS_TEAM_CT), CS_GetTeamScore(CS_TEAM_T));
FormatEx(json, sizeof(json), "{\"port\": %d, \"%s\": %d, \"%s\": %d}",
port, nomTeamUn, CS_GetTeamScore(CS_TEAM_CT),
nomTeamDeux, CS_GetTeamScore(CS_TEAM_T));
FormatEx(
requestStr,
sizeof(requestStr),