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

[REQ] auto switch teams


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
betalama
Member
Join Date: Nov 2008
Old 08-22-2010 , 11:19   [REQ] auto switch teams
Reply With Quote #1

Hello,

Looking for script auto switch players.After 15 rounds players will be transfered from CT to T and conversely.After 16 wins (T or CT) match will be stoped and players will see HUD message who is winner (like CT vs T 16:10).

Its possible ADD results score after one half of map?Thank you.
betalama is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-22-2010 , 20:53   Re: [REQ] auto switch teams
Reply With Quote #2

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Auto-Team Switcher"
#define VERSION "1.0"
#define AUTHOR "Nikhil"

new roundnumber=0
new ctwins=0
new twins=0
public plugin_init() {
    
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("end_round"2"1=Round_End")
    
register_event("SendAudio""ctwin""a""%!MRAD_BOMBDEF")
    
register_event("SendAudio""twin""a""2&%!MRAD_terwin")
    
register_event("SendAudio""ctwin""a""2&%!MRAD_ctwin")
    
register_event"TextMsg""ctwin""a""2&#All_Hostages_R" );

}

public 
end_round() {
    
roundnumber++
    
    if(
roundnumber==15){
    
    new 
players[32], numplayer
    get_players
(playersnum)
    new 
team[32]
    for(new 
i;i<num;i++) {
        
player=players[i]
        
get_user_team(playerteam31)
        
        if(
equali(team"Terrorist")) cs_set_user_team(playerCS_TEAM_CT)
        
        else if(
equali(team"CT")) cs_set_user_team(playerCS_TEAM_T)
    }
}
    
}

public 
ctwin() {
    
    
ctwins++
    if(
ctwins==16)
    {
        
set_hudmessage(0255255, -1.00.3506.012.00.10.21)
        
show_hudmessage(0"Counter-Terrorists Win!!!\n T:%i CT:%i"twinsctwins)

    }
}

public 
twin() {
    
    
twins++
    if(
twins==16)
    {
        
set_hudmessage(0255255, -1.00.3506.012.00.10.21)
        
show_hudmessage(0"Terrorists Win!!!\n T:%i CT:%i"twinsctwins)

    }

That should work. What do you mean add results score after one half of map?

Last edited by nikhilgupta345; 08-23-2010 at 02:18.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
betalama
Member
Join Date: Nov 2008
Old 08-23-2010 , 16:56   Re: [REQ] auto switch teams
Reply With Quote #3

doesnt work, swap team after 14 rounds, sometimes huddmessage appears before half of match is ended (CT wins or T wins).
Score is bad (T after switching got CT score).

Its possible before switch make snapshot for prooving?
betalama is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-23-2010 , 17:16   Re: [REQ] auto switch teams
Reply With Quote #4

Quote:
Originally Posted by betalama View Post
doesnt work, swap team after 14 rounds, sometimes huddmessage appears before half of match is ended (CT wins or T wins).
Score is bad (T after switching got CT score).

Its possible before switch make snapshot for prooving?
Change roundnumber from 15 to 16 for the switching early. What do you mean hud shows up before half? It should show at end of game.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
betalama
Member
Join Date: Nov 2008
Old 08-30-2010 , 14:27   Re: [REQ] auto switch teams
Reply With Quote #5

hudmessage really doesnt work.After score 8:7 or similar u get message with
Counter-Terrorists Win!!!\n T:%i CT

betalama is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 08-30-2010 , 21:05   Re: [REQ] auto switch teams
Reply With Quote #6

Why do you use get_user_team() and then cs_set_user_team()?
__________________
RedRobster is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-30-2010 , 21:23   Re: [REQ] auto switch teams
Reply With Quote #7

Couldn't remember what the return values were for cs_set_user_team and didn't feel like looking it up :/ Lol, but idk how I didn't remember them, pretty easy
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 08-30-2010 , 21:31   Re: [REQ] auto switch teams
Reply With Quote #8

The same things that you use to set it...CS_TEAM_T, CS_TEAM_CT, etc.

Just when you do "new team" do "new CsTeams:team"
__________________
RedRobster is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-30-2010 , 21:36   Re: [REQ] auto switch teams
Reply With Quote #9

:/

Any idea why the code's not working though?
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Reply



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 20:54.


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