#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Misson"
#define VERSION "1.0"
#define AUTHOR "Duc Duy"
new my_team
new players_t[32],players_ct[32], ict,ite
get_players(players_t,ite,"ae","TERRORIST")
get_players(players_ct,ict,"ae","CT")
my_team = cs_get_user_team(id)
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "win_lose", "a")
}
public win_lose()
{
if (my_team ==CS_TEAM_T){
if (ite == 0 && ict<>0){
message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
write_byte(1) // status: 0: off; 1: on; 2:flash
write_string(lose)
write_byte(255) // red
write_byte(255) // green
write_byte(255) // blue
message_end()
hide_spr()
} else {
message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
write_byte(1) // status: 0: off; 1: on; 2:flash
write_string(win)
write_byte(255) // red
write_byte(255) // green
write_byte(255) // blue
message_end()
hide_spr()
}
}
if (my_team ==CS_TEAM_CT){
if (ite == 0 && ict<>0){
message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
write_byte(1) // status: 0: off; 1: on; 2:flash
write_string(win)
write_byte(255) // red
write_byte(255) // green
write_byte(255) // blue
message_end()
hide_spr()
} else {
message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
write_byte(1) // status: 0: off; 1: on; 2:flash
write_string(lose)
write_byte(255) // red
write_byte(255) // green
write_byte(255) // blue
message_end()
hide_spr()
}
}
}
public hide_spr
{
new id = ID_HIDESPR
hide_spr(id, lose)
hide_spr(id, win)
}