You're totally wrong. Let me explain every single thing that you did wrong:
1. You don't need to create a global array in this situation, same as the integers. You should just create them in the function itself.
2. You're setting the hud's parameters in the init, wtf? Do it in the function, same as 1.
3. The tag mismatch, is because you're using get_user_team() native which returns numbers with CS_TEAM_T/CS_TEAM_CT. You should use 1/2 or change to cs_get_user_team().
4. You don't need to decrease the number in the death msg because get_players() has "a" flag which returns only alive players.
5. You don't need to use the loop to show the alive players.
So, the right thing to do, is simple:
PHP Code:
#include <amxmodx>
#define VERSION "1.0"
public plugin_init()
{
register_plugin("Show Alive Players", VERSION, "IDK")
set_task(1.0, "showAlivePlayers", .flags = "b")
}
public showAlivePlayers()
{
new iPlayers[32], iNum[2]
get_players(iPlayers, iNum[0], "ae", "CT")
get_players(iPlayers, iNum[1], "ae", "TERRORIST")
if((iNum[0] + iNum[1]) <= 1)
return
set_hudmessage(0, 255, 0, 0.009, 0.00, 0, 6.0, 105.0, 0.3, 0.3, 1)
show_hudmessage(0, "CTs: %d TRs: %d", iNum[0], iNum[1])
}
__________________