Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Action Command_Counter(int client, any args)
- {
- if (client != Warden)
- {
- return Plugin_Handled;
- }
- else if ((client == Warden || (gc_bCounterDeputy.BoolValue)) && gc_bCounter.BoolValue)
- {
- int iTarget = GetClientAimTarget(client, true);
- if(iTarget == -1)
- {
- PrintToChat(client, "%s Стоп! укажи прицел на заключенных чтобы посчитать",chat_tag);
- return Plugin_Handled;
- }
- float wardenOrigin[3];
- GetClientAbsOrigin(client, wardenOrigin);
- int iAlives, counter = 0;
- int left, i;
- int[] iLeftClients = new int[MaxClients];
- for (i = 1; i <= MaxClients; ++i) if (IsClientInGame(i))
- {
- if (GetClientTeam(i) == CS_TEAM_T)
- {
- if(IsPlayerAlive(i))
- {
- ++iAlives;
- }
- g_bCounted[i] = false;
- g_fDistance[i] = 0.0;
- float clientOrigin[3];
- GetClientAbsOrigin(i, clientOrigin);
- float distance = GetVectorDistance(clientOrigin, wardenOrigin, false);
- if (ClientViews(client, i))
- {
- counter++;
- g_bCounted[i] = true;
- g_fDistance[i] = distance;
- }
- else if(GetClientTeam(i) == CS_TEAM_T && client != counter)
- {
- iLeftClients[left++] = i;
- }
- }
- }
- if(iAlives == counter)
- {
- PrintToChatAll("%s Все [%i/%i] заключенных на месте!",chat_tag, counter ,iAlives);
- }
- else if(counter != iAlives)
- {
- PrintToChatAll("%s (%i человек в бегах) в строю [%i/%i]",chat_tag, left ,counter ,iAlives);
- if(left)
- {
- char szBuffer[256];
- GetClientName(iLeftClients[0], szBuffer, sizeof(szBuffer));
- for(i = 1; i < left; ++i)
- {
- Format(szBuffer, sizeof(szBuffer), ", %s", iLeftClients[i])
- }
- PrintToChatAll("В бегах: %s", szBuffer);
- }
- }
- }
- return Plugin_Handled;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement