I want to use Hud_message in end timelimit and frage !
im used this for timelimit but im not sur
Код:
new string[10];
get_cvar_string("amx_timeleft", string, 10);
if(equal(string, "00:60"))
{
set_hudmessage(255, 255, 0, 0.0, 0.20, 0, 6.0, 12.0)
show_hudmessage(0, "Next Mod is %s ", gamemodes[next_gamemode])
}
Код:
#define VERSION "1.0"
#include <amxmodx>
#include <nvault>
new const gamemodes[ ][ ] =
{
"tdm",
"arena",
"arcade"
}
new cvar_count
public plugin_init( )
{
register_plugin( "Gamemodes changer", VERSION, "Milashkasiya" )
cvar_count = register_cvar( "gmc_count", "5" )
//set_task(0.9, "plugin_end", _, _, _, "b");
}
public plugin_end( )
{
new vault = nvault_open( "gmchanger" )
if( vault != INVALID_HANDLE )
{
new current_gamemode[ 8 ]
get_cvar_string( "sv_ag_gamemode", current_gamemode, charsmax(current_gamemode) )
//set_task(0.9, "check", _, _, _, "b");
new count = nvault_get( vault, current_gamemode ) + 1
if( !(count % get_pcvar_num(cvar_count)) )
{
new next_gamemode = next_gamemode_index( current_gamemode )
server_cmd( gamemodes[next_gamemode] )
server_exec( )
}
new count_str[ 8 ]
num_to_str( count, count_str, charsmax(count_str) )
nvault_set( vault, current_gamemode, count_str )
nvault_close( vault )
new string[10];
get_cvar_string("amx_timeleft", string, 10);
if(equal(string, "00:60"))
{
set_hudmessage(255, 255, 0, 0.0, 0.20, 0, 6.0, 12.0)
show_hudmessage(0, "Next Mod is %s ", gamemodes[next_gamemode])
}
}
}
next_gamemode_index( const current[] )
{
new i
for( i = 0; i < sizeof gamemodes; i++ )
{
if( equal(gamemodes[i], current) )
break
}
return ++i % sizeof gamemodes
}