Raised This Month: $32 Target: $400
 8% 

Module: CS Team Changer Ultimate [avoids crashes in aggressive changes]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 07-31-2011 , 15:15   Module: CS Team Changer Ultimate [avoids crashes in aggressive changes]
Reply With Quote #1


- Counter-Strike Team Changer -


Download
View CPP file

I see that all plugins that change the teams excessively contain delay to avoid crashes. Native get_user_team is not used because of receiving wrong values and there are tasks with TeamInfo message.

Using this extension you may change the teams without any crash, indifferently you are using an aggressive changing type or not!

Also, this extension updates the AMX Mod X team indexes at clients then you will be able to use get_user_team native without problems, it will return fair values.

The difference between this and CStrike module is here (42).

An example is listed below.

PHP Code:
static iPlayers32 ], iNumiiPlayer;
get_playersiPlayersiNum );

for( 
0iNumi++ )
{
     
iPlayer iPlayers];

     switch( 
get_user_teamiPlayer ) )
     {
           case 
_:CSTEAM_TERRORISTcs_set_teamiPlayerCSTEAM_CT );
           case 
_:CSTEAM_CTcs_set_teamiPlayerCSTEAM_TERRORIST );
     }

     
// If you will use again this function, get_user_team native will give you a fair result!
     // The players will be transfering from a team to other without problems.



It is tested, it works perfectly with thirty two players. It changes sixteen players from Terrorists to Counter-terrorists and sixteen players from Counter-terrorists to Terrorists in the same time without any headaches instead of CStrike extension that crashes the server.

The header file is the one listed below.

PHP Code:
/**
 * Counter-Strike Team Changer
 * by Hattrick (Claudiu HKS)
 */

#if defined _cs_team_changer_included
  #endinput
#endif

#define _cs_team_changer_included

#if AMXX_VERSION_NUM >= 175
  #pragma reqlib cs_team_changer

  #if !defined AMXMODX_NOAUTOLOAD
    #pragma loadlib cs_team_changer
  #endif
#else
  #pragma library cs_team_changer
#endif

/** There are the teams you may use.
 */
enum CSTeam
{
  
CSTEAM_UNASSIGNED 0,
  
CSTEAM_TERRORIST 1,
  
CSTEAM_CT 2,
  
CSTEAM_SPECTATOR 3
};

/** You may do 64 transfers once a second using this extension! Server will not crash!
 * CStrike extension using cs_set_user_team native will crash server when approximately 24 transfers are reached!
 */

/** Transfers a player from a team to other one. The player's model will not be touched. The server will not be forged.
 * This native will automatically send a TeamInfo message. Will also change the team offset and the team index declared by AMX Mod X extension.
 */
native cs_set_team(ClientCSTeam:Team);

/** Changes the player's team index declared by AMX Mod X extension. The team offset and the scores' table will not be touched.
 * There will not be a TeamInfo message.
 */
native cs_set_team_id(ClientCSTeam:Team);

/** Changes the player's team offset. Scores' table will not be touched.
 */
native cs_set_team_offset(ClientCSTeam:Team);

/** Sends a fast TeamInfo message. The player will be transfered at the team you want but only in the scores' table.
*/
native cs_set_team_tablescore(ClientCSTeam:Team); 
Attached Files
File Type: zip CS Team Changer.zip (309.8 KB, 2276 views)
__________________

Last edited by claudiuhks; 02-20-2015 at 00:14.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode