Raised This Month: $ Target: $400
 0% 

Players chat colors problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-02-2013 , 12:13   Re: Players chat colors problem
Reply With Quote #1

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.
__________________
Black Rose is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-02-2013 , 12:26   Re: Players chat colors problem
Reply With Quote #2

colorchat may be integrated in next amxx release.

Waiting for this eventuality, you can use this : http://forums.alliedmods.net/showthread.php?p=851160
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode