AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Auto Swap Teams v 1.6 - no more overflow!!!! (https://forums.alliedmods.net/showthread.php?t=90898)

wangbochiang 04-24-2009 07:37

Auto Swap Teams v 1.6 - no more overflow!!!!
 
6 Attachment(s)
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:oops:
and Sorry my bad english :oops:


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
:oops:

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:wink:


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.:mrgreen:




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?:wink: (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:mrgreen:



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:oops:

Auto_Swap_Teams_15.sma - 504 views

wangbochiang 04-24-2009 07:41

Re: Half Rounds Auto Swap Teams
 
Quote:

Originally Posted by alan_el_more (Post 812922)
sma?

sorry :|
my internet link here very slow...

alan_el_more 04-24-2009 07:51

Re: Half Rounds Auto Swap Teams
 
Rename the plugin by Auto_Swap_Teams.sma :D

wangbochiang 04-24-2009 08:01

Re: Half Rounds Auto Swap Teams
 
Quote:

Originally Posted by alan_el_more (Post 812937)
Rename the plugin by Auto_Swap_Teams.sma :D


OK... Thanks for Remind:oops:

alan_el_more 04-24-2009 08:05

Re: Half Rounds Auto Swap Teams
 
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]) 

:arrow:
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"


wangbochiang 04-24-2009 08:31

Re: Half Rounds Auto Swap Teams
 
Quote:

Originally Posted by alan_el_more (Post 812945)
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]) 

:arrow:
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 :oops:

I'll test plugins when I have much time =]

alan_el_more 04-24-2009 08:41

Re: Half Rounds Auto Swap Teams
 
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")
    }



wangbochiang 04-24-2009 09:15

Re: Half Rounds Auto Swap Teams
 
Quote:

Originally Posted by alan_el_more (Post 812966)
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!:shock:

IneedHelp 04-24-2009 13:16

Re: Half Rounds Auto Swap Teams v 1.1
 
You could make only one loop to switch the team instead of 2 getting the team.

SnoW 04-24-2009 13:16

Re: Half Rounds Auto Swap Teams
 
Quote:

Originally Posted by alan_el_more (Post 812945)
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]) 

:arrow:
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"


:arrow:
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"



All times are GMT -4. The time now is 14:21.

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