Modificare plugin

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
idle.
Membru, skill 0
Membru, skill 0
Posts: 18
Joined: 02 Dec 2008, 15:44
Detinator Steam: Da
CS Status: Nu cred in femei .
Detinator server CS: NU
Location: Bucuresti

25 Sep 2010, 18:25

As dorii si eu un cvar la acest plugin sa dea restart la a 2 a runda el este setat sa dea la prima ..

Code: Select all

#include < amxmodx >

enum Color
{
    YELLOW = 1,
    GREEN,
    TEAM_COLOR,
    GREY,
    RED,
    BLUE,
}

new TeamInfo;
new SayText;
new MaxSlots;

new TeamName[ ][ ] = 
{
    "",
    "TERRORIST",
    "CT",
    "SPECTATOR"
}


new bool: g_Restart = true;

public plugin_init ( )
{
    register_plugin ( "Auto Restart", "1.0", "aNNakin" );
    
    register_event ( "TextMsg", "game_comencing", "a", "2&#Game_C" );
    register_logevent ( "round_end", 2, "1=Round_End" );

    TeamInfo = get_user_msgid ( "TeamInfo" );
    SayText = get_user_msgid ( "SayText" );
    MaxSlots = get_maxplayers ( );
}

public game_comencing ( )
    g_Restart = true;

public round_end ( )
{
    if( g_Restart )
    {
        server_cmd ( "sv_restart 2" );
        ColorChat( 0, GREEN, "^x04 Auto Restart Round !" );
    }

    g_Restart = false;
}

public ColorChat( id, Color:type, const msg[ ], { Float, Sql, Result, _ }:... )
{
    static message[ 256 ];

    switch( type )
    {
        case YELLOW: message[ 0 ] = 0x01;
        case GREEN: message[ 0 ] = 0x04;
        
        default: message[ 0 ] = 0x03;
    }

    vformat( message[ 1 ], 251, msg, 4 );

    message[ 192 ] = '^0';

    new team, ColorChange, index, MSG_Type;
    
    if( id )
    {
        MSG_Type = MSG_ONE;
        index = id;
    }
    else
    {
        index = FindPlayer ( );
        MSG_Type = MSG_ALL;
    }
    
    team = get_user_team( index );    
    ColorChange = ColorSelection( index, MSG_Type, type );

    ShowColorMessage( index, MSG_Type, message);
        
    if( ColorChange )
        Team_Info( index, MSG_Type, TeamName[ team ] );
}

ShowColorMessage ( id, type, message[ ] )
{
    message_begin ( type, SayText, _, id );
    write_byte ( id )        
    write_string ( message );
    message_end ();    
}

Team_Info ( id, type, team[ ] )
{
    message_begin (type, TeamInfo, _, id );
    write_byte ( id );
    write_string ( team );
    message_end ();

    return 1;
}

ColorSelection ( index, type, Color:Type )
{
    switch( Type )
    {
        case RED:
            return Team_Info( index, type, TeamName[ 1 ] );
        case BLUE:
            return Team_Info( index, type, TeamName[ 2 ] );
        case GREY:
            return Team_Info(index, type, TeamName[ 0 ] );
    }

    return 0;
}

FindPlayer ( )
{
    for ( new i = 1; i <= MaxSlots; i++ )
        if ( is_user_connected( i ) )
            return i;
    
    return -1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
RoyalServer 2
User avatar
b[L]u
Membru, skill +1
Membru, skill +1
Posts: 314
Joined: 31 May 2010, 14:27
Detinator Steam: Nu
Has thanked: 26 times
Been thanked: 8 times

25 Sep 2010, 20:22

ia vezi acu
| Afiseaza codul
#include < amxmodx >

enum Color
{
    YELLOW = 1,
    GREEN,
    TEAM_COLOR,
    GREY,
    RED,
    BLUE,
}

new TeamInfo;
new SayText;
new MaxSlots;

new TeamName[ ][ ] =
{
    "",
    "TERRORIST",
    "CT",
    "SPECTATOR"
}


new bool: g_Restart = true;

public plugin_init ( )
{
    register_plugin ( "Auto Restart", "1.0", "aNNakin" );
   
    register_event ( "TextMsg", "game_comencing", "a", "2&#Game_C" );
    register_logevent ( "round_end", 2, "2=Round_End" );

    TeamInfo = get_user_msgid ( "TeamInfo" );
    SayText = get_user_msgid ( "SayText" );
    MaxSlots = get_maxplayers ( );
}

public game_comencing ( )
    g_Restart = true;

public round_end ( )
{
    if( g_Restart )
    {
        server_cmd ( "sv_restart 2" );
        ColorChat( 0, GREEN, "^x04 Auto Restart Round !" );
    }

    g_Restart = false;
}

public ColorChat( id, Color:type, const msg[ ], { Float, Sql, Result, _ }:... )
{
    static message[ 256 ];

    switch( type )
    {
        case YELLOW: message[ 0 ] = 0x01;
        case GREEN: message[ 0 ] = 0x04;
       
        default: message[ 0 ] = 0x03;
    }

    vformat( message[ 1 ], 251, msg, 4 );

    message[ 192 ] = '^0';

    new team, ColorChange, index, MSG_Type;
   
    if( id )
    {
        MSG_Type = MSG_ONE;
        index = id;
    }
    else
    {
        index = FindPlayer ( );
        MSG_Type = MSG_ALL;
    }
   
    team = get_user_team( index );   
    ColorChange = ColorSelection( index, MSG_Type, type );

    ShowColorMessage( index, MSG_Type, message);
       
    if( ColorChange )
        Team_Info( index, MSG_Type, TeamName[ team ] );
}

ShowColorMessage ( id, type, message[ ] )
{
    message_begin ( type, SayText, _, id );
    write_byte ( id )       
    write_string ( message );
    message_end ();   
}

Team_Info ( id, type, team[ ] )
{
    message_begin (type, TeamInfo, _, id );
    write_byte ( id );
    write_string ( team );
    message_end ();

    return 1;
}

ColorSelection ( index, type, Color:Type )
{
    switch( Type )
    {
        case RED:
            return Team_Info( index, type, TeamName[ 1 ] );
        case BLUE:
            return Team_Info( index, type, TeamName[ 2 ] );
        case GREY:
            return Team_Info(index, type, TeamName[ 0 ] );
    }

    return 0;
}

FindPlayer ( )
{
    for ( new i = 1; i <= MaxSlots; i++ )
        if ( is_user_connected( i ) )
            return i;
   
    return -1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Nick: MiSteR D
Image
idle.
Membru, skill 0
Membru, skill 0
Posts: 18
Joined: 02 Dec 2008, 15:44
Detinator Steam: Da
CS Status: Nu cred in femei .
Detinator server CS: NU
Location: Bucuresti

25 Sep 2010, 22:11

nu merge , nu se mai da deloc restart
User avatar
b[L]u
Membru, skill +1
Membru, skill +1
Posts: 314
Joined: 31 May 2010, 14:27
Detinator Steam: Nu
Has thanked: 26 times
Been thanked: 8 times

25 Sep 2010, 22:56

acu ar trebui sa-ti mearga
| Afiseaza codul
#include < amxmodx >

enum Color
{
    YELLOW = 1,
    GREEN,
    TEAM_COLOR,
    GREY,
    RED,
    BLUE,
}

new TeamInfo;
new SayText;
new MaxSlots;

new TeamName[ ][ ] =
{
    "",
    "TERRORIST",
    "CT",
    "SPECTATOR"
}


new bool: g_Restart = true;

public plugin_init ( )
{
    register_plugin ( "Auto Restart", "1.0", "aNNakin" );
   
    register_event ( "TextMsg", "game_comencing", "a", "2&#Game_C" );
    register_logevent ( "round_end", 3, "1=Round_End" );

    TeamInfo = get_user_msgid ( "TeamInfo" );
    SayText = get_user_msgid ( "SayText" );
    MaxSlots = get_maxplayers ( );
}

public game_comencing ( )
    g_Restart = true;

public round_end ( )
{
    if( g_Restart )
    {
        server_cmd ( "sv_restart 2" );
        ColorChat( 0, GREEN, "^x04 Auto Restart Round !" );
    }

    g_Restart = false;
}

public ColorChat( id, Color:type, const msg[ ], { Float, Sql, Result, _ }:... )
{
    static message[ 256 ];

    switch( type )
    {
        case YELLOW: message[ 0 ] = 0x01;
        case GREEN: message[ 0 ] = 0x04;
       
        default: message[ 0 ] = 0x03;
    }

    vformat( message[ 1 ], 251, msg, 4 );

    message[ 192 ] = '^0';

    new team, ColorChange, index, MSG_Type;
   
    if( id )
    {
        MSG_Type = MSG_ONE;
        index = id;
    }
    else
    {
        index = FindPlayer ( );
        MSG_Type = MSG_ALL;
    }
   
    team = get_user_team( index );   
    ColorChange = ColorSelection( index, MSG_Type, type );

    ShowColorMessage( index, MSG_Type, message);
       
    if( ColorChange )
        Team_Info( index, MSG_Type, TeamName[ team ] );
}

ShowColorMessage ( id, type, message[ ] )
{
    message_begin ( type, SayText, _, id );
    write_byte ( id )       
    write_string ( message );
    message_end ();   
}

Team_Info ( id, type, team[ ] )
{
    message_begin (type, TeamInfo, _, id );
    write_byte ( id );
    write_string ( team );
    message_end ();

    return 1;
}

ColorSelection ( index, type, Color:Type )
{
    switch( Type )
    {
        case RED:
            return Team_Info( index, type, TeamName[ 1 ] );
        case BLUE:
            return Team_Info( index, type, TeamName[ 2 ] );
        case GREY:
            return Team_Info(index, type, TeamName[ 0 ] );
    }

    return 0;
}

FindPlayer ( )
{
    for ( new i = 1; i <= MaxSlots; i++ )
        if ( is_user_connected( i ) )
            return i;
   
    return -1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
daca nu merge ce e mai sus incearca si asta
| Afiseaza codul
#include < amxmodx >

enum Color
{
    YELLOW = 1,
    GREEN,
    TEAM_COLOR,
    GREY,
    RED,
    BLUE,
}

new TeamInfo;
new SayText;
new MaxSlots;

new TeamName[ ][ ] =
{
    "",
    "TERRORIST",
    "CT",
    "SPECTATOR"
}


new bool: g_Restart = true;

public plugin_init ( )
{
    register_plugin ( "Auto Restart", "1.0", "aNNakin" );
   
    register_event ( "TextMsg", "game_comencing", "a", "2&#Game_C" );
    register_logevent ( "round_end", 3, "1=Round_End" );

    TeamInfo = get_user_msgid ( "TeamInfo" );
    SayText = get_user_msgid ( "SayText" );
    MaxSlots = get_maxplayers ( );
}

public game_comencing ( )
    g_Restart = true;

public round_end ( )
{
    if( g_Restart )
    {
        server_cmd ( "sv_restart 3" );
        ColorChat( 0, GREEN, "^x04 Auto Restart Round !" );
    }

    g_Restart = false;
}

public ColorChat( id, Color:type, const msg[ ], { Float, Sql, Result, _ }:... )
{
    static message[ 256 ];

    switch( type )
    {
        case YELLOW: message[ 0 ] = 0x01;
        case GREEN: message[ 0 ] = 0x04;
       
        default: message[ 0 ] = 0x03;
    }

    vformat( message[ 1 ], 251, msg, 4 );

    message[ 192 ] = '^0';

    new team, ColorChange, index, MSG_Type;
   
    if( id )
    {
        MSG_Type = MSG_ONE;
        index = id;
    }
    else
    {
        index = FindPlayer ( );
        MSG_Type = MSG_ALL;
    }
   
    team = get_user_team( index );   
    ColorChange = ColorSelection( index, MSG_Type, type );

    ShowColorMessage( index, MSG_Type, message);
       
    if( ColorChange )
        Team_Info( index, MSG_Type, TeamName[ team ] );
}

ShowColorMessage ( id, type, message[ ] )
{
    message_begin ( type, SayText, _, id );
    write_byte ( id )       
    write_string ( message );
    message_end ();   
}

Team_Info ( id, type, team[ ] )
{
    message_begin (type, TeamInfo, _, id );
    write_byte ( id );
    write_string ( team );
    message_end ();

    return 1;
}

ColorSelection ( index, type, Color:Type )
{
    switch( Type )
    {
        case RED:
            return Team_Info( index, type, TeamName[ 1 ] );
        case BLUE:
            return Team_Info( index, type, TeamName[ 2 ] );
        case GREY:
            return Team_Info(index, type, TeamName[ 0 ] );
    }

    return 0;
}

FindPlayer ( )
{
    for ( new i = 1; i <= MaxSlots; i++ )
        if ( is_user_connected( i ) )
            return i;
   
    return -1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Nick: MiSteR D
Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests