Raised This Month: $14 Target: $400
 3% 

Auto Swap Teams v 1.6 - no more overflow!!!!


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
wangbochiang
Member
Join Date: Aug 2006
Location: Taiwan - Taichung
Old 04-24-2009 , 08:37   Auto Swap Teams v 1.6 - no more overflow!!!!
Reply With Quote #1

Auto Swap Teams v 1.6
last update(dd/mm/yyyy) 07/11/2012

Hello everyone, this is my first plugins
If plugins not good, please forgive me
and Sorry my bad english


This plugin can be compile via official online compiler,
That is mean you can click "Get Plugin" to download .amxx file.



update 1.6
Fix all the bugs and FSB_Allowoverflow Problem when 12+ players,
Now this plugin can running in 32 players.
If you wanna keep score I suggest turn ast_live to 0,
but it wont keep the team score. team score will stay as normal, won't change (CT->T)

ALSO PLEASE NOTICE LANG FILE HAS UPDATE.
Code:
[en]
SWITCHING_TEAMS = ==== Switching Teams ====
ROUNDS1 = ROUNDS
ROUNDS1_CHAT = [NOTICE] Rounds
ROUNDS2 = ROUNDS
ROUNDS1_CHAT = [NOTICE] Rounds
LIVE_NOTICE = [NOTICE]After [LIVE ON 3] Will Play On New Team
LIVE = [NOTICE] LIVE LIVE LIVE Good Luck & Have Fun!!!
NEW_TEAM = [NOTICE] Your Team has been changed, please notice your mission 

target.
GOOD_GAME = Team Switched, Have a Good Game.
update 1.5
I rewrite almost half of the code tree 'cause after long time I came
back and I even don't know what I was wrote


I changed all of the cvar easy to remember.
'cause I can't remember the cvar that i was used.
& I change my swap_team() code to xPaw version.. thx you


the sv_restart and restartround bug is already fixed on 1.5,
After six hours testing and editing with million cups of coffee,
I finally made this plugin works fine.




How To This Plug-in Work?:
This plugins will auto swap teams after the cvar you set on ast_half_rounds
example:
I set ast_half_rounds to 8, than My server Will Swap All player's team
to another team when rounds 8 end (Ct->T;T->Ct)and restartround,so player can play each team
on the same map
, when rounds goes to 16,Server will change map to amx_nextmap.
just like some server plugins in Counter-Strike:Source





Features:
only need to set ast_half_rounds
plz del mp_maxrounds from server.cfg



Command:
ast_enable (1/0) // Enable the plugins (def: 1)
ast_half_rounds (num) // Automatically change the teams of the round number (def: 8 )
ast_live (1/0) //Set it, Would you like to live on 3 after team changed? (def: 1) recommand


Installation:
put .txt file to your lang dir.
put .sma file to your scripting dir.
compile it and put .amxx file in plugins dir.
add Auto_Swap_Teams_15.amxx in bottom of the plugins.ini
add cvar in amxx.cfg or server.cfg
change server map and you are good to go



Requirements:
AMX Mod X 1.8.1 or higher.



Special Thanks To:
alan_el_more //Help me fix my bad plugin to good =]
t0m3xxx //Some ideas =]
crazyeffect //multilangual made =]
xPaw //help me to fix my plugins to wonderful =]


To Do List:
  • multilangual.
  • center hudder text.
  • Live on 3 after swap teams.
  • Vote next map after swap teams.
  • Play some music during switching team.
  • Add some extra massege at round start.
  • Based on mp_timelimit and have cvar can switch it.


BIG BUG :
DONT USE ANY HAVE USE COMMAND "sv_restart" PLUGINS
DURING THE GAME. IT WILL CRASH HUD ROUND COUNDER X(

(fixed on 1.5, thx xPaw)


ML now have:
Code:
[en] - > wangbochiang
[tc] - > wangbochiang
[es] - > Neeeeeeeeeel.-
[fr] - > teol
[de] - > Torge
Translation Request Post


thanks history
Code:
1.0 -> very poor code tree,i'm so newbie
1.1 -> thanks alan_el_more rewrite my bad plugins
1.2 -> thanks t0m3xxx give me some ideas,and help me do it
1.3 -> thanks crazyeffect made a multilangual for my plugins
1.5 -> thanks xpaw for more better code tree from his code skills.
1.6 -> thanks many people did the translation!
Sorry my bad english

Auto_Swap_Teams_15.sma - 504 views
Attached Files
File Type: txt Auto_Swap_Teams.txt (2.1 KB, 2028 views)
File Type: sma Get Plugin or Get Source (Auto_Swap_Teams.sma - 4480 views - 3.6 KB)
__________________
Catch me on : @twitter

Last edited by wangbochiang; 11-08-2012 at 21:26. Reason: version update
wangbochiang is offline
Send a message via MSN to wangbochiang Send a message via Yahoo to wangbochiang Send a message via Skype™ to wangbochiang
Old 04-24-2009, 08:37
alan_el_more
This message has been deleted by alan_el_more.
wangbochiang
Member
Join Date: Aug 2006
Location: Taiwan - Taichung
Old 04-24-2009 , 08:41   Re: Half Rounds Auto Swap Teams
Reply With Quote #2

Quote:
Originally Posted by alan_el_more View Post
sma?
sorry
my internet link here very slow...
__________________
Catch me on : @twitter
wangbochiang is offline
Send a message via MSN to wangbochiang Send a message via Yahoo to wangbochiang Send a message via Skype™ to wangbochiang
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-24-2009 , 08:51   Re: Half Rounds Auto Swap Teams
Reply With Quote #3

Rename the plugin by Auto_Swap_Teams.sma
__________________
alan_el_more is offline
wangbochiang
Member
Join Date: Aug 2006
Location: Taiwan - Taichung
Old 04-24-2009 , 09:01   Re: Half Rounds Auto Swap Teams
Reply With Quote #4

Quote:
Originally Posted by alan_el_more View Post
Rename the plugin by Auto_Swap_Teams.sma

OK... Thanks for Remind
__________________
Catch me on : @twitter
wangbochiang is offline
Send a message via MSN to wangbochiang Send a message via Yahoo to wangbochiang Send a message via Skype™ to wangbochiang
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-24-2009 , 09:05   Re: Half Rounds Auto Swap Teams
Reply With Quote #5

use pcvars instead of cvars and change this:
PHP Code:
client_print(CT[i],print_chat,"* [AST] You're Team is CT now"CT[i])
client_print(T[i], print_chat"* [AST] You're Team is T now"T[i]) 

PHP Code:
client_print(CT[i],print_chat,"* [AST] You're Team is CT now")
client_print(T[i], print_chat"* [AST] You're Team is T now"
__________________
alan_el_more is offline
Old 04-24-2009, 09:14
vato loco [GE-S]
This message has been deleted by vato loco [GE-S]. Reason: ...
wangbochiang
Member
Join Date: Aug 2006
Location: Taiwan - Taichung
Old 04-24-2009 , 09:31   Re: Half Rounds Auto Swap Teams
Reply With Quote #6

Quote:
Originally Posted by alan_el_more View Post
use pcvars instead of cvars and change this:
PHP Code:
client_print(CT[i],print_chat,"* [AST] You're Team is CT now"CT[i])
client_print(T[i], print_chat"* [AST] You're Team is T now"T[i]) 

PHP Code:
client_print(CT[i],print_chat,"* [AST] You're Team is CT now")
client_print(T[i], print_chat"* [AST] You're Team is T now"
thanks that

I'll test plugins when I have much time =]
__________________
Catch me on : @twitter
wangbochiang is offline
Send a message via MSN to wangbochiang Send a message via Yahoo to wangbochiang Send a message via Skype™ to wangbochiang
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-24-2009 , 09:41   Re: Half Rounds Auto Swap Teams
Reply With Quote #7

To fulfill the role that has said, would have to be something like that:
PHP Code:
#include <amxmodx>
#include <cstrike>

new enablehalf_roundsrounds_count

public plugin_init() 
{
    
register_plugin("Auto Swap Teams""0.1""#Kz.Tw | nobody")
    
half_rounds register_cvar("amx_half_rounds","8")
    
enable register_cvar("swap_teams""1")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_event("TextMsg""Event_TextMsg""a""2&#Game_C")
}

public 
event_round_start()
{
    if(
get_pcvar_num(enable))
    {
        
rounds_count++
        if(
rounds_count == get_pcvar_num(half_rounds))
            
swap_teams()
    }
}

public 
Event_TextMsg()
    
rounds_count 0

public swap_teams()
{
    new 
CT[32],T[32]
    new 
chCTchT
    
new tround
    
    client_print
(0,print_chat,"* [AST] Switching Teams ")
    
tround get_pcvar_num(half_rounds)*2
    set_cvar_num
("mp_maxrounds"tround)    
    
get_players(CT,chCT,"e","CT")
    
get_players(T,chT,"e","TERRORIST")

    for(new 
0chCTi++)
    {
        
cs_set_user_team(CT[i], CS_TEAM_T)

        
client_print(CT[i],print_chat,"* [AST] You're Team is CT now")
    }

    for(new 
0chTi++)
    {
        
cs_set_user_team(T[i], CS_TEAM_CT)
        
        
client_print(T[i], print_chat"* [AST] You're Team is T now")
    }

__________________
alan_el_more is offline
wangbochiang
Member
Join Date: Aug 2006
Location: Taiwan - Taichung
Old 04-24-2009 , 10:15   Re: Half Rounds Auto Swap Teams
Reply With Quote #8

Quote:
Originally Posted by alan_el_more View Post
To fulfill the role that has said, would have to be something like that:
PHP Code:
#include <amxmodx>
#include <cstrike>

new enablehalf_roundsrounds_count

public plugin_init() 
{
    
register_plugin("Auto Swap Teams""0.1""#Kz.Tw | nobody")
    
half_rounds register_cvar("amx_half_rounds","8")
    
enable register_cvar("swap_teams""1")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
.....


works!!!
thanks a lot!
__________________
Catch me on : @twitter
wangbochiang is offline
Send a message via MSN to wangbochiang Send a message via Yahoo to wangbochiang Send a message via Skype™ to wangbochiang
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 04-24-2009 , 14:16   Re: Half Rounds Auto Swap Teams v 1.1
Reply With Quote #9

You could make only one loop to switch the team instead of 2 getting the team.
__________________
IneedHelp is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-24-2009 , 14:16   Re: Half Rounds Auto Swap Teams
Reply With Quote #10

Quote:
Originally Posted by alan_el_more View Post
use pcvars instead of cvars and change this:
PHP Code:
client_print(CT[i],print_chat,"* [AST] You're Team is CT now"CT[i])
client_print(T[i], print_chat"* [AST] You're Team is T now"T[i]) 

PHP Code:
client_print(CT[i],print_chat,"* [AST] You're Team is CT now")
client_print(T[i], print_chat"* [AST] You're Team is T now"

PHP Code:
client_print(CT[i],print_chat,"* [AST] Your Team is CT now")
client_print(T[i], print_chat"* [AST] Your Team is T now"
SnoW is offline
Send a message via MSN to SnoW
Reply


Thread Tools
Display Modes

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 14:30.


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