Quote:
Originally Posted by Zerk0o0o0
In top middle of screen. If you can, green color for activate and red for disabled?
|
PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < fun >
const TASK_ID = 1202;
new stoprespawn, timer, g_msgsync, pcvar_timer;
public plugin_init( ) {
register_plugin( "HnS respawn", "1.0", "balck" );
register_event( "HLTV", "eventRoundStart", "a", "1=0", "2=0" );
RegisterHam( Ham_Killed, "player", "every_dead", 1 );
pcvar_timer = register_cvar("amx_timerespawn", "10");
g_msgsync = CreateHudSyncObj();
}
public client_putinserver( id ) {
set_task( 1.0, "respawn", id );
}
public every_dead( id ) {
if( is_user_connected( id ) ) {
set_task( 1.0, "respawn", id );
}
}
public eventRoundStart( ){
timer = get_pcvar_num(pcvar_timer);
remove_task( TASK_ID );
stoprespawn = 0;
sethdmsg();
}
public sethdmsg()
{
if(timer >= 1){
set_hudmessage(0, 255, 0, 0.28, 0.02, 0, 6.0, 0.5);
ShowSyncHudMsg(0, g_msgsync, "Respawn enable: %d", timer);
--timer;
}
else
if(timer == 0 && !stoprespawn){
set_hudmessage(150, 0, 0, 0.28, 0.02, 0, 6.0, 3.0);
show_hudmessage(0, "Respawn is disable");
stoprespawn = 1;
remove_task( TASK_ID );
}
set_task( 1.0, "sethdmsg", TASK_ID );
}
public respawn( id ) {
if( !stoprespawn ){
if( !is_user_alive( id ) && get_user_team( id ) == 1 ) {
ExecuteHamB( Ham_CS_RoundRespawn, id );
give_item( id, "weapon_knife" );
}
}
}
__________________