Raised This Month: $ Target: $400
 0% 

{REQ EDIT]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 02-07-2010 , 14:16   Re: {REQ EDIT]
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define OFFSET_TEAM    114

enum
{
TEAM_NULL// LOL NULL
TEAM_T,
TEAM_CT,
TEAM_SPECTATOR
}

new 
g_iCounter 0;
new 
p_Rounds;
new 
g_Msg_TeamInfo;
new 
g_iMaxPlayers;

// HERE HERE HERE HERE
new szText[ ] = "Text text text text"
new RoundRestartTime 1
// HERE HERE HERE HERE

public plugin_init()
{
register_plugin"Team Switch""1.5""TBagT" );

p_Rounds register_cvar"ats_rounds""15" );
register_event("TextMsg""RoundRestart_Attempt""a""2&#Game_C""2&Game_W");
register_logevent("logevent_round_start2"2"1=Round_Start")
register_logevent("logevent_round_end2"2"1=Round_End")
g_iMaxPlayers get_maxplayers();
g_Msg_TeamInfo get_user_msgid"TeamInfo" );
set_task(5.0"cmdText"0__"b")
}

public 
server_changelevelmap[] )
{
g_iCounter 0;
}

public 
plugin_pause()
{
g_iCounter 0;
}

public 
RoundRestart_Attempt()
{
g_iCounter 0;
}
public 
logevent_round_end2()
{
if( 
get_playersnum() > )
{
    if ( 
g_iCounter >= get_pcvar_nump_Rounds ) )
    {
        
g_iCounter 0;
        
        new 
teamoppTeam;
        for( new 
<= g_iMaxPlayers i++ )
        {
            if( !
is_user_connected) )    continue;
            
            
team get_user_team);
            if( 
team == TEAM_SPECTATOR )    continue;
            
            
set_hudmessage20000, -1.0, -1.016.012.0 );
            
show_hudmessage0"Switching teams!" );
            
            
oppTeam team 1;
            
fm_set_user_teamioppTeam );
        }
        
        
server_cmd("sv_restart %d"RoundRestartTime)
        
server_exec()
    }
    else
    {
        
set_hudmessage01000, -1.0, -1.016.012.0 );
        
show_hudmessage0"Teams will switch in: %d (rounds)", ( get_pcvar_nump_Rounds ) - g_iCounter ) );
    }
}

}
public 
logevent_round_start2()
{
g_iCounter++;
}
fm_set_user_teamindexiTeam )
{
static const 
Teams[][] =
{
""// NULL
"TERRORIST",
"CT"
}

set_pdata_intindexOFFSET_TEAMiTeam );
dllfuncDLLFunc_ClientUserInfoChangedindexengfuncEngFunc_GetInfoKeyBufferindex ) );

message_beginMSG_ONE_UNRELIABLEg_Msg_TeamInfo, { 00}, index );
write_byteindex );
write_stringTeamsiTeam ] );
message_end();

return 
1;
}

public 
cmdText() 
{
    
client_print(0print_chat"%s"szText)

To change the text change the var szText. The restart is on 1, you can change it in the var RoundRestartTime
That 2 vars are marked with comments
Points 1 & 2 are made. But with the 3 i have little trouble (i don't understand)
Quote:
Originally Posted by Storas1337 View Post
3.If possible CALCULATE CT AND T SCORE with player cvar .score
You want to show the score when player write ".score" in chat?
Mxnn 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 07:20.


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