Quote:
Originally Posted by romeo72
Hello, everyone.
I have a question and I hope that you can help me further. is it possible to activate the zombie plague plugin at certain times of the day? for example every day from 7 p.m. to 6 a.m. in the morning.
if so, would that also be possible with other plugins?
Thank you very much !!!
best regards
|
Yes it's possible try this way:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new const StartTime[ ] = "07:00:00" /* Hour : Minute : Secound */
new const StopTime[ ] = "06:00:00"
new const MOD [ ] = "zombieplague.amxx";
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
if( ActivateMod( StopTime ) )
{
if( pause( "cd", MOD ) )
{
log_amx( "%s has been stopped!", MOD )
}
}
else if( ActivateMod( StartTime ) )
{
if( unpause( "cd", MOD ) )
{
log_amx( "%s has been started!", MOD )
}
}
}
bool:ActivateMod( const szDate[ ] )
{
return get_systime( ) >= parse_time( szDate, "%H:%M:%S" );
}
__________________