Suppression du kick & nom équipe dans score socket
This commit is contained in:
parent
23f3635d68
commit
5280fc6f08
1 changed files with 13 additions and 4 deletions
17
infolan.sp
17
infolan.sp
|
@ -11,6 +11,8 @@
|
||||||
char teamCT[5][150];
|
char teamCT[5][150];
|
||||||
char teamT[5][150];
|
char teamT[5][150];
|
||||||
char clientId[128];
|
char clientId[128];
|
||||||
|
char nomTeamDeux[150];
|
||||||
|
char nomTeamUn[150];
|
||||||
|
|
||||||
int allId[20];
|
int allId[20];
|
||||||
int nbAllId = 0;
|
int nbAllId = 0;
|
||||||
|
@ -24,7 +26,7 @@ public Plugin myinfo =
|
||||||
description = "Bot communiquant avec le bot discord \
|
description = "Bot communiquant avec le bot discord \
|
||||||
https://github.com/Lunki51/cs-picker afin d’automatiser \
|
https://github.com/Lunki51/cs-picker afin d’automatiser \
|
||||||
l’InfoLan 2021",
|
l’InfoLan 2021",
|
||||||
version = "1.5.4",
|
version = "1.5.5",
|
||||||
url = "https://git.gnous.eu/Rick/infolanBot"
|
url = "https://git.gnous.eu/Rick/infolanBot"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -32,7 +34,7 @@ public void OnPluginStart()
|
||||||
{
|
{
|
||||||
HookEvent("player_activate", SetTeamPlayer);
|
HookEvent("player_activate", SetTeamPlayer);
|
||||||
HookEvent("cs_win_panel_round", UpdateScoreBoard);
|
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);
|
RegServerCmd("!team", SetTeam);
|
||||||
/* pour le debug
|
/* pour le debug
|
||||||
|
@ -128,9 +130,15 @@ public Action SetTeam(int args)
|
||||||
int team = (!strcmp(arg, "ct", false) ? 1 : 2);
|
int team = (!strcmp(arg, "ct", false) ? 1 : 2);
|
||||||
GetCmdArg(2, arg, sizeof(arg));
|
GetCmdArg(2, arg, sizeof(arg));
|
||||||
if (team == 1)
|
if (team == 1)
|
||||||
|
{
|
||||||
ServerCommand("mp_teamname_1 %s", arg)
|
ServerCommand("mp_teamname_1 %s", arg)
|
||||||
|
nomTeamUn = arg;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ServerCommand("mp_teamname_2 %s", arg)
|
ServerCommand("mp_teamname_2 %s", arg)
|
||||||
|
nomTeamDeux = arg;
|
||||||
|
}
|
||||||
|
|
||||||
if (args == 7)
|
if (args == 7)
|
||||||
{
|
{
|
||||||
|
@ -211,8 +219,9 @@ public void SocketUpdateScore(Handle socket, any arg)
|
||||||
{
|
{
|
||||||
char requestStr[1024];
|
char requestStr[1024];
|
||||||
char json[64];
|
char json[64];
|
||||||
FormatEx(json, sizeof(json), "{\"port\": %d, \"ct\": %d, \"t\": %d}",
|
FormatEx(json, sizeof(json), "{\"port\": %d, \"%s\": %d, \"%s\": %d}",
|
||||||
port, CS_GetTeamScore(CS_TEAM_CT), CS_GetTeamScore(CS_TEAM_T));
|
port, nomTeamUn, CS_GetTeamScore(CS_TEAM_CT),
|
||||||
|
nomTeamDeux, CS_GetTeamScore(CS_TEAM_T));
|
||||||
FormatEx(
|
FormatEx(
|
||||||
requestStr,
|
requestStr,
|
||||||
sizeof(requestStr),
|
sizeof(requestStr),
|
||||||
|
|
Loading…
Reference in a new issue