You should really learn to debug if you want to create plugins.
Here's a small tutorial:
Code:
server_print("Called case 2:1")
if(is_user_alive(id) & get_user_team(id) == 1)
ColorChat(0, RED, "%s : %s", name, text2);
if(!is_user_alive(id) && get_user_team(id) == 1)
ColorChat(0, RED, "*DEAD* %s : %s", name, text2);
if(is_user_alive(id) & get_user_team(id) == 2)
ColorChat(0, BLUE, "%s : %s", name, text2);
if(!is_user_alive(id) && get_user_team(id) == 1)
ColorChat(0, BLUE, "*DEAD* %s : %s", name, text2);
if(is_user_alive(id) & get_user_team(id) == 3)
ColorChat(0, GREY, "%s : %s", name, text2);
if(!is_user_alive(id) && get_user_team(id) == 3)
ColorChat(0, GREY, "*DEAD* %s : %s", name, text2);
server_print("Finished case 2:2")
+
Code:
public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
server_print("Called ColorChat")
// ...
server_print("Finished ColorChat")
}
Here's the console output:
Code:
Called case 2:1
Finished case 2:2
This tells you that ColorChat never gets called. This tells you that the problem is somewhere in the Case 2, but not inside the ColorChat function.
If you look closely at your statements you'll see that you've used bitwise operators as long as the user is alive. I.e: if(is_user_alive(id)
& get_user_team(id) == 1)
If you change them to && it will work fine. You're welcome.
__________________