Extender última ronda.
#1
Qué tal a todos. Vi que muchos andan buscando un plugin, que lo que haga es hacer extender la última ronda y que no se corte a la mitad cuando tenga que cambiar de mapa. De esta forma lo utilizo yo, no hace falta desactivar ningún plugin solo lo agregan.

Código PHP:
#include <amxmodx>

#pragma semicolon 1;

new const NOMBRE[] = "Última ronda";
new const 
VERSION[] = "v1.0";
new const 
CREADOR[] = "Federicomb";

enum (+= 1000) {
    
TASK_CHEQUEO 789150,
    
TASK_CAMBIOMAPA
};

new 
g_UltimaRonda 0;
new 
g_TimeLimit 20// Aca tienen que poner el tiempo del mapa que tienen configurado en su servidor, ejemplo 20 minutos.

public plugin_init()
{
    
register_plugin(NOMBREVERSIONCREADOR);
    
    
register_event("SendAudio""Round_end""a""2=%!MRAD_terwin""2=%!MRAD_ctwin""2=%!MRAD_rounddraw");
    
    
set_task(10.0"Configuracion"TASK_CHEQUEO__"d"1);
}

public 
Round_end()
{
    if (
g_UltimaRonda == 1)
        
set_task(5.0"Cambio_mapa"TASK_CAMBIOMAPA__"a"1);
}

public 
Configuracion()
{
    if (
get_playersnum())
    {
        
g_UltimaRonda 1;
        
g_TimeLimit get_cvar_num("mp_timelimit");
        
server_cmd("mp_timelimit 0");
        
ChatColor(0"!g[AMXX] !yÚltima ronda, el mapa cambiará al finalizar la misma");
    }
}

public 
server_changelevel(map[])
{
    if (
g_UltimaRonda == 1)
        
Cambio_mapa();
}

public 
Cambio_mapa()
{
    
remove_task(TASK_CAMBIOMAPA);
    
g_UltimaRonda 0;
    if (
get_cvar_num("mp_timelimit") == 0)
    {
        
server_cmd("mp_timelimit %d"g_TimeLimit);
    }
}

stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^4");
    
replace_all(msg190"!y""^1");
    
replace_all(msg190"!team""^3");
    
replace_all(msg190"!team2""^0");
    
    if (
idplayers[0] = id; else get_players(playerscount"ch");
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }


Espero que les sirva y le puedan dar utilidad, saludos.
Believe, be yourself and don't hold on to just one dream ❤

https://github.com/FEDERICOMB96
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)