Ok, I would like to hook, when T's and CT's win. Doing it right now like that:
PHP Code:
public plugin_init()
{
register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")
}
public t_win()
{
client_print(0, print_chat, "[Team] T's win!")
}
public ct_win()
{
client_print(0, print_chat, "[Team] CT's win!")
}
This works perfectly, and both get called once when their team wins. However, when I add some more stuff, it does give the winner team another +1 round as win, and all players die when there was a bomb explosion, all players were outside of the range for sure. And also, it calls sometimes both events multiple times. Could anyone help me with that? There are no other 3rd party plugins installed.
PHP Code:
public plugin_init()
{
register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")
}
public t_win()
{
client_print(0, print_chat, "[Team] All CTs should die now!")
cvar = get_pcvar_num(amx_sl_silentkill)
new iPlayers[32], iNum, id
get_players(iPlayers, iNum)
for(new i; i<iNum; i++)
{
id = iPlayers[i]
if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
{
if(cvar)
{
user_silentkill(id)
}
else
{
user_kill(id, 1)
}
}
}
}
public ct_win()
{
client_print(0, print_chat, "[Team] All T's should die now!")
cvar = get_pcvar_num(amx_sl_silentkill)
new iPlayers[32], iNum, id
get_players(iPlayers, iNum)
for(new i; i<iNum; i++)
{
id = iPlayers[i]
if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
{
if(cvar)
{
user_silentkill(id)
}
else
{
user_kill(id, 1)
}
}
}
}
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.