Here is a crappy example:
PHP Code:
public function(id)
{
new aimed, body, team1, team2;
get_user_aiming(id, aimed, body);
team1 = get_user_team(id);
team2 = get_user_team(aimed);
if(team1 == team2)
{
// Both teams are the same, show the message
set_hudmessage(0, 255, 0, 1.0, -1.0);
show_hudmessage(id, "CP: Number");
}
}