Ayuda con VoteMap
#1
Hola a todos, como dice el titulo he intentado agregarle la opción de ampliar la duración del mapa actual en este votemap hecho por claans, pero no se me ocurre la metodología.

Ojala puedan ayudarme, muchas gracias.

Código PHP:
#include < amxmodx >

new const PLUGIN[ ] =     "Vote Map"
new const AUTHOR[ ] =    "cLAANS"
new const VERSION[ ] =    "1.0"

new const g_menu_mapas[ ][ ] = 
{
    { 
"de_dust2"     },
    { 
"de_nuke"     },
    { 
"de_inferno"     },
    { 
"de_train"     },
    { 
"de_tuscan"     },
    { 
"de_forge"     },
    { 
"de_russka"     },
    { 
"de_cbble"     
}

new 
g_iVotessizeof g_menu_mapas ];
new 
g_iMenuVoteMapa;

public 
plugin_init( ) 
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
register_clcmd"vote""VoteMenu");
}

public 
VoteMenu( ) 
{
    new 
RandomMapassizeof g_menu_mapas ];
    
    for ( new 
sizeof RandomMapas i++ )
        
RandomMapas] = i;
    
    
g_iMenuVoteMapa menu_create"\y[VoteMap]\w Votacion del mapa""HandlerVote" );
    
    new 
iMapaRandominfo];
    
    for( new 
i++ ) 
    {    
        
iMapaRandom randomsizeof RandomMapas ) + i;
        
        
info] = RandomMapasiMapaRandom ];
        
menu_additemg_iMenuVoteMapag_menu_mapasiMapaRandom ], info);
        
        
RandomMapasiMapaRandom ] = RandomMapas];
    }
    
    
menu_additem(g_iMenuVoteMapa"Extender Mapa Actual")

    new 
players32 ], playersnum;
    
    
get_playersplayersplayersnum"c" );
    
    for( new 
playersnum i++ ) menu_displayplayers], g_iMenuVoteMapa );
    
    
set_task10.0"VoteMenuEnd" );
}

public 
HandlerVoteidmenuitem 
{
    if( 
item == MENU_EXIT ) return;
    
    new 
info], dummy;
    
menu_item_getinfo(menuitemdummyinfo1__dummy)

    if( 
item == ) {
        
client_printidprint_chat"Has votado por Extender el Mapa" );
        
// Como lo haria aqui?
        
return;
    }
    
    
client_printidprint_chat"Has votado por el mapa %s"g_menu_mapasinfo] ] );
    
g_iVotesinfo] ]++;
}

public 
VoteMenuEnd( ) 
{
    
menu_destroyg_iMenuVoteMapa );
    
    new 
cell[sizeof g_menu_mapas], Drawwinner;
    
calc_vote(g_iVotessizeof g_menu_mapascellDraw);
    
    
// if (?) client_print( 0, print_chat, "El mapa actual se extendera 15 minutos" );

    
if (Draw) {
        
winner random(Draw+1);
        
client_print0print_chat"El mapa ganador fue: %s debido a un empate"g_menu_mapaswinner ] );
    } else {
        for(new 
1sizeof g_iVotesi++) if(g_iVotes[i] > g_iVotes[winner]) winner i;
        
client_print0print_chat"El mapa ganador fue: %s con %d votos"g_menu_mapaswinner ], g_iVoteswinner ] );
    }
    
    
arrayset(g_iVotes0sizeof g_iVotes);


stock calc_vote(Vote[], sizecell[], &draw) {
    new 
iznocheck
    
for(/*nothing*/sizei++) {
        
cell[i] = -1
        
for(0sizez++) {
            if(
nocheck & (<< (31))) continue
            if(
cell[i] == -|| Vote[cell[i]] <= Vote[z]) cell[i] = z
        
}
        
nocheck |= (<< (cell[i] & 31))
    }
    for(
1sizei++) {
        if(
Vote[cell[i-1]] != Vote[cell[i]]) break
        
draw++
    }

Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)