[AMXX] Round Restart

Vaata eelmist teemat Vaata järgmist teemat Go down

avatar
Tonight


Postitusi : 14447
Maine : 2592
Liitus : 19/02/2012
Staatus : @Faval
Vaata kasutaja profiili

PostitamineTonight on 25.02.12 22:04

Made by: Mucx

Idee on lihtne, teeb peale esimest roundi restartround.

Kood:
#include < amxmodx >

new g_Round;
new g_Restart;

public plugin_init( ) {
        register_plugin( "Restart Round" , "0.1" , "Mucx" );
       
        register_event( "TextMsg" ,    "Game_Commencing" ,    "a" ,  "2&#Game_C" );
        register_event( "HLTV" ,        "New_Round" ,          "a" ,  "1=0" , "2=0" );
       
        register_logevent( "Round_End" , 2 , "1=Round_End" );
}

public Game_Commencing( ) {
        g_Round = 0;
        g_Restart = true;
}

public New_Round( )
        g_Round++;

public Round_End( ) {
        if( g_Round == 1 && g_Restart ) {
                set_cvar_num( "sv_restartround", 1 );
                g_Restart = false;
        }
}


Kood:
#include < amxmodx >

new Round;
new Restart;
new RoundTime;

public plugin_init() {
    register_plugin( "Restart Round" , "1.0" , "Mucx" );
   
    register_event( "TextMsg"    , "GameCommencing"    , "a" , "2&#Game_C" );
    register_event( "HLTV"        , "NewRound"        , "a" ,    "1=0" ,    "2=0" );
   
    register_logevent( "RoundEnd" , 2 , "1=Round_End" );
   
    RoundTime = get_cvar_pointer( "mp_roundtime" );
}

public GameCommencing( ) {
    Restart = true;
    Round = 0;
}

public NewRound( ) {
    Round++;
    if( Restart && Round == 1 ) {
        new Float:MsgTime = get_pcvar_float( RoundTime ) * 60;
       
        set_hudmessage( 255 , 255 , 255 , 0.01 , 0.90 , 0 , 6.0 , MsgTime );
        show_hudmessage( 0 , "Warmup Round" );
    }
}

public RoundEnd( ) {
    if( Restart && Round == 1 ) {
        set_cvar_num( "sv_restartround", 1 );
        Restart = false;
    }
}

Vaata eelmist teemat Vaata järgmist teemat Tagasi üles

Soovid reklaamidest vabaneda?

Selleks logi sisse või tee endale kasutaja.

Liitu foorumiga

Tee endale kasutaja ning osale aruteludes.


Tee uus kasutaja

Logi sisse

Omad foorumis juba kasutajat? Logi sisse.


Logi sisse

 
Permissions in this forum:
Sa ei saa vastata siinsetele teemadele