Récupération nom équipe socket

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

View file

@ -11,8 +11,6 @@
char teamCT[5][150];
char teamT[5][150];
char clientId[128];
char nomTeamDeux[150];
char nomTeamUn[150];
int allId[20];
int nbAllId = 0;
@ -26,7 +24,7 @@ public Plugin myinfo =
description = "Bot communiquant avec le bot discord \
https://github.com/Lunki51/cs-picker afin dautomatiser \
lInfoLan 2021",
version = "1.5.5",
version = "1.5.6",
url = "https://git.gnous.eu/Rick/infolanBot"
};
@ -130,15 +128,9 @@ 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)
{
@ -219,6 +211,10 @@ 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));