Code:
#include <amxmodx>
public plugin_init()
{
register_plugin("Last 2 players alive", "1.0", "author")
register_event("DeathMsg", "death_msg", "a")
}
public death_msg(id){
new players_ct[32], players_t[32], ict, ite, name[32]
get_players(players_ct,ict,"ae","CT")
get_players(players_t,ite,"ae","TERRORIST")
//new victim = read_data(2)
// new victim_team = get_user_team(victim,"",0)
if (ict==1&&ite==1)
{
get_user_name(players_ct[0],name,32)
set_hudmessage(50,255,0,-1.0,0.30,0, 6.0, 8.0, 1.0, 2.0, 6)
show_hudmessage(players_t[0],"1vs1 with %s !",name)
get_user_name(players_t[0],name,32)
set_hudmessage(50,255,0,-1.0,0.30,0, 6.0, 8.0, 1.0, 2.0, 6)
show_hudmessage(players_ct[0],"1vs1 with %s !",name)
if(ite==1)
{
message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), {0,0,0}, 0 ) ;
write_short ( 1<<10 ) ;
write_short ( 1<<10 ) ;
write_short ( 0x0000 ) ;
write_byte ( 255 ) ;
write_byte ( 0 ) ;
write_byte ( 0 ) ;
write_byte ( 80 ) ;
message_end ( ) ;
}
if(ict==1)
{
message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), {0,0,0}, 0 ) ;
write_short ( 1<<10 ) ;
write_short ( 1<<10 ) ;
write_short ( 0x0000 ) ;
write_byte ( 0 ) ;
write_byte ( 0 ) ;
write_byte ( 255 ) ;
write_byte ( 80 ) ;
message_end ( ) ;
}
if(ict==1&&ite==1)
{
client_cmd ( 0 , "spk misc/mysound.wav" )
}
}
}
public plugin_precache( )
{
precache_sound ( "misc/mysound.wav" )
}
but seems nothing happens when 1 vs 1 :-s. What could be the error