update: changement de noms de variables
This commit is contained in:
parent
80e3bffd56
commit
5bfc39ef9c
1 changed files with 12 additions and 11 deletions
23
infolan.sp
23
infolan.sp
|
@ -8,12 +8,12 @@
|
||||||
#define MY_SOCKET_PORT 3000
|
#define MY_SOCKET_PORT 3000
|
||||||
#define STEAMID_LENGTH 128
|
#define STEAMID_LENGTH 128
|
||||||
|
|
||||||
char teamCT[5][150];
|
char teamCT[10][128];
|
||||||
char teamT[5][150];
|
char teamT[10][128];
|
||||||
char clientId[128];
|
|
||||||
|
|
||||||
int allId[20];
|
/* liste de tous les clients connectés */
|
||||||
int nbAllId = 0;
|
int listClients[20];
|
||||||
|
int nbClients = 0;
|
||||||
|
|
||||||
int port = -1;
|
int port = -1;
|
||||||
|
|
||||||
|
@ -75,14 +75,15 @@ public void OnConfigsExecuted()
|
||||||
//public void OnClientAuthorized(int client, const char[] auth)
|
//public void OnClientAuthorized(int client, const char[] auth)
|
||||||
public void SetTeamPlayer(Event event, const char[] name, bool dontBroadcast)
|
public void SetTeamPlayer(Event event, const char[] name, bool dontBroadcast)
|
||||||
{
|
{
|
||||||
|
char clientId[128];
|
||||||
int client = GetClientOfUserId(event.GetInt("userid"));
|
int client = GetClientOfUserId(event.GetInt("userid"));
|
||||||
GetClientAuthId(client, AuthId_Steam2, clientId, sizeof(clientId));
|
GetClientAuthId(client, AuthId_Steam2, clientId, sizeof(clientId));
|
||||||
if (!strcmp(clientId, "BOT", true)) { return; }
|
if (!strcmp(clientId, "BOT", true)) { return; }
|
||||||
if (FindAdminByIdentity("steam", clientId) != INVALID_ADMIN_ID)
|
if (FindAdminByIdentity("steam", clientId) != INVALID_ADMIN_ID)
|
||||||
{
|
{
|
||||||
ChangeClientTeam(client, CS_TEAM_SPECTATOR);
|
ChangeClientTeam(client, CS_TEAM_SPECTATOR);
|
||||||
allId[nbAllId] = client;
|
listClients[nbClients] = client;
|
||||||
nbAllId++;
|
nbClients++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -97,15 +98,15 @@ public void SetTeamPlayer(Event event, const char[] name, bool dontBroadcast)
|
||||||
{
|
{
|
||||||
ChangeClientTeam(client, CS_TEAM_CT);
|
ChangeClientTeam(client, CS_TEAM_CT);
|
||||||
allGood = true;
|
allGood = true;
|
||||||
allId[nbAllId] = client;
|
listClients[nbClients] = client;
|
||||||
nbAllId++;
|
nbClients++;
|
||||||
}
|
}
|
||||||
else if (!strcmp(teamT[i], clientId, false))
|
else if (!strcmp(teamT[i], clientId, false))
|
||||||
{
|
{
|
||||||
ChangeClientTeam(client, CS_TEAM_T);
|
ChangeClientTeam(client, CS_TEAM_T);
|
||||||
allGood = true;
|
allGood = true;
|
||||||
allId[nbAllId] = client;
|
listClients[nbClients] = client;
|
||||||
nbAllId++;
|
nbClients++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue