User
Pass
2FA
 
 

[rezolvat]Cerere plugin

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support
Author Message320
pavelescu98

[dead.Andrei]



Status: Offline
(since 22-01-2018 21:28)
Joined: 18 Jan 2015
Posts: 848, Topics: 132
Location: Nicaieri...Dar acasa.

Reputation: 6.2
Votes: 47

 
Post Posted: 07-03-2015, 11:57:36 | Translate post to: ... (Click for more languages)

As dori un plugin ca sa echilibreze echipele la respawn, am cautat pe net , dar nu am gasit. Am gasit numai cu buguri.
Multumesc anticipat.




"Fotbalul nu iti place. Il iubesti, il traiesti, il respiri, e parte din tine." Gabi Balint

0 0
  
Back to top
View user's profile Send private message
HamSwit

[Viking Way]



Status: Offline
(since 29-03-2015 16:27)
Joined: 02 Nov 2014
Posts: 285, Topics: 49
Location: Romania

Reputation: 83.3
Votes: 3

       
Post Posted: 07-03-2015, 12:04:08 | Translate post to: ... (Click for more languages)

Code:

#include < amxmodx >
#include < cstrike >

#define PLUGIN "CS16 Ballancer"
#define VERSION "0.1"
#define AUTHOR "aNNakin"

new gi_MaxPlayers;

new const gs_Teams[ ][ ] =
{
   "TERRORIST",
   "CT"
};

// - - - - - - - - -
#define   INTERVAL 30   /* din cate in cate secunde se vor verifica echipele */
const i_Immunity = 1;   /* 1 = adminii au imunitate, 0 adminii nu au imunitate */
// - - - - - - - - -

public plugin_init ( )
{
   register_plugin ( PLUGIN, VERSION, AUTHOR );
   gi_MaxPlayers = get_maxplayers ( );
   set_task ( float ( INTERVAL ), "CheckTeams", _, _, _, "b" );
}

public CheckTeams ( )
{
   new i_TsNum = get_team_num ( 1 );
   new i_CTsNum = get_team_num ( 2 );
   
   while ( ( i_TsNum - i_CTsNum ) > 1 )
   {
      i_TsNum--; ++i_CTsNum;
      transfer_user ( 1, 2 );
   }
   
   while ( ( i_TsNum - i_CTsNum ) < -1 )
   {
      i_TsNum++; --i_CTsNum;
      transfer_user ( 2, 1 );
   }
      
}

stock get_team_num ( i_Team )
{
   new i_Count, i_Index;
   
   for ( i_Index = 1; i_Index <= gi_MaxPlayers; i_Index++ )
      if ( get_user_team ( i_Index ) == i_Team )
         i_Count++;
         
   return i_Count;
}

stock transfer_user ( i_From, i_To )
{
   new i_Players[ 32 ], i_Num;
   get_players ( i_Players, i_Num, "ae", gs_Teams[ ( i_From - 1 ) ] )
   
   ChoosePlayer:
   new i_Player = i_Players[ random_num ( 0, i_Num-1 ) ];
   
   if ( ! is_user_alive ( i_Player ) || ( i_Immunity && get_user_flags ( i_Player ) & ADMIN_IMMUNITY ) )
      goto ChoosePlayer;
   
   switch ( i_To )
   {
      case 1: cs_set_user_team ( i_Player, CS_TEAM_T );
      case 2: cs_set_user_team ( i_Player, CS_TEAM_CT );
   }
   
   set_hudmessage ( 255, 85, 0, 0.01, 0.26, 0, 6.0, 7.0 );
   show_hudmessage ( i_Player, "Ai fost transferat la cealalalta echipa^npentru a echilibra jocul.")
   
   //client_print ( i_Player, print_chat, "Ai fost transferat la cealalalta echipa pentru a echilibra jocul." );
}

0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID

  Topic locked


Topic is closed, you cannot post any messages in it anymore

Locked by TwisTer, 23 March 2015 18:05



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support  


The time now is 31-07-2025, 08:00:53
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password