13/02/2018, 12:31 PM
Quisiera que empezará un ejemplo:
de 12PM A 1PM Y DE 8PM A 9PM
de 12PM A 1PM Y DE 8PM A 9PM
Código PHP:
#include amxmodx
#include hamsandwich
new gIsHappyTime;
new const HappyTime[][] = {"22"}; // Puedes agregar mas horas aqui
public plugin_init()
{
register_plugin("HappyHour + Respawn ?)" , "0.1", "kikizon" );
register_event( "HLTV" , "check_happytime" , "a" , "1=0" , "2=0" );
RegisterHam(Ham_Killed, "player", "PlayerKilled", true);
register_clcmd( "say /respawn", "clcmdRespawn" );
}
public PlayerKilled(victim, attacker, shouldgibs)
{
if( !gIsHappyTime ) return;
clcmdRespawn(victim);
}
public clcmdRespawn( index )
{
if( !gIsHappyTime )
{
client_print( index , print_chat, "La happy Hour no esta activa vete prro >:V" );
return PLUGIN_HANDLED;
}
if( is_user_alive( index ))
{
client_print( index , print_chat, "No puedes revivir si ya estas vivo :genius: >:V" );
return PLUGIN_HANDLED;
}
ExecuteHamB( Ham_CS_RoundRespawn, index );
return PLUGIN_HANDLED;
}
public check_happytime()
{
gIsHappyTime = false;
static hour[3], i; get_time("%H", hour, 2 );
for( i = 0; i < sizeof HappyTime ; ++i )
if(equal(hour, HappyTime[ i ]) )
gIsHappyTime = true;
}
Aprender: Necesaria unión entre el Querer, el Saber y el Poder