Raised This Month: $ Target: $400
 0% 

switch players team each round


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 07-08-2007 , 20:48   Re: switch players team each round
Reply With Quote #3

Code:
//import miscellaneous natives including register_logevent() #include <amxmodx> //import Counter-Strike related natives #include <cstrike> //called when the plugin starts public plugin_init() {     //used to identify the plugin     register_plugin("PLUGIN", "VERSION", "AUTHOR");     //registers a function to be called at the end of a round     register_logevent("roundEnd", 2, "1=Round_End"); } public roundEnd() {     //stores the maximum number of players the server can accomodate     new maxPlayers = get_maxplayers();     //loops over each player slot     for(new i = 1; i <= maxPlayers; i++)     {         //if a player isn't connected in this slot, skip the remaining         //code inside the loop but continue iteration         if(!is_user_connected(i))         {             continue;         }                 //determines which team the player in this slot belongs to         switch(cs_get_user_team(i))         {             //if the player in this slot is a T, switch them to CT             case CS_TEAM_T: cs_set_user_team(i, CS_TEAM_CT);             //if the player in this slot is a CT, switch them to T             case CS_TEAM_CT: cs_set_user_team(i, CS_TEAM_T);         }     } }

The Function Reference will come in handy in future.

Last edited by Lee; 07-08-2007 at 21:29.
Lee is offline
 



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 21:35.


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