Raised This Month: $51 Target: $400
 12% 

Solved help me with colorchat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
theuser
Member
Join Date: Jul 2020
Old 07-07-2020 , 04:38   help me with colorchat
Reply With Quote #1

heloo

PHP Code:
ColorChat(0TEAM_COLOR,"%s : ^4/t1",name
this is part of codes of slash commands plugin

PHP Code:
 new name[32]
get_user_info(id"name"name31)
  if(
get_user_team(id,name) == 1)
    
ColorChat(0RED,"%s : ^4/spec",name)
  else if(
get_user_team(id,name) == 2)
     
ColorChat(0BLUE,"%s : ^4/spec",name)
  else
     
ColorChat(0GREY,"%s : ^4/spec",name
i try this, plugin compile but compiler get lose indention eror from this lines !

With this order, the name of the admin becomes the color of his team, but if the admin is in the terrorist team and another player in the counter-terrorist team, the player sees the name of the admin in the color of his team.

What should I do if the admin is in the terrorist team, his name is red, if he is counter-terrorist, his name is blue and if he is in the spectators, his name should be gray?

sorry for my bad english <3

Last edited by theuser; 07-10-2020 at 07:20.
theuser is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-07-2020 , 05:40   Re: help me with colorchat
Reply With Quote #2

Loose identation comes from the unaligned code. This does not affect the plugin. Indent the code properly.

Use cromchat if you want more options for color matching (check my signature).
__________________

Last edited by OciXCrom; 07-07-2020 at 14:39.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
theuser
Member
Join Date: Jul 2020
Old 07-07-2020 , 07:51   Re: help me with colorchat
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Loose identation comes from the unalligned code. This does not affect the plugin. Indent the code properly.

Use cromchat if you want more options for color matching (check my signature).
Yes, it was true, the error was fixed by adjusting the distances,
Now how can I add the admin name with a live or dead tag?
I adjusted chat color with 3 conditions. Do I have to add other conditions for the admin to be alive or dead with is_user_alive() ? , or is there a shorter way?

I will definitely replace cromchat soon.

Last edited by theuser; 07-07-2020 at 07:51.
theuser is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 07-07-2020 , 08:22   Re: help me with colorchat
Reply With Quote #4

Quote:
Originally Posted by theuser View Post
Now how can I add the admin name with a live or dead tag?
I adjusted chat color with 3 conditions. Do I have to add other conditions for the admin to be alive or dead with is_user_alive() ? , or is there a shorter way?
Code:
ColorChat(0, BLUE, "%s %s : ^4/spec", is_user_alive(id) ? "*ALIVE*" : "*DEAD*",name)

Last edited by ZaX; 07-07-2020 at 08:23.
ZaX is offline
theuser
Member
Join Date: Jul 2020
Old 07-07-2020 , 09:51   Re: help me with colorchat
Reply With Quote #5

Quote:
Originally Posted by ZaX View Post
Code:
ColorChat(0, BLUE, "%s %s : ^4/spec", is_user_alive(id) ? "*ALIVE*" : "*DEAD*",name)
ty <3
theuser is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-07-2020 , 14:47   Re: help me with colorchat
Reply With Quote #6

With cromchat you can match the target's color like this:

Code:
CC_SendMatched(0, id, "%s %s : ^4/spec", is_user_alive(id) ? "*ALIVE*" : "*DEAD*",name)

No need for additional checks.

Also, if you're using AMXX 1.9/1.10, no need to get the user's name either. Just use "%n" and pass the id:

Code:
CC_SendMatched(0, id, "%s %n : ^4/spec", is_user_alive(id) ? "*ALIVE*" : "*DEAD*", id)

PS: such questions are more fitting in the Scripting Help section.
__________________

Last edited by OciXCrom; 07-07-2020 at 14:50.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 07-08-2020 , 03:14   Re: help me with colorchat
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
CC_SendMatched
What does this code do?
__________________
Jailbreak AD 2.0

The greatest civilization of 🇮🇷IRAN🇮🇷
alferd is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 07-08-2020 , 03:24   Re: help me with colorchat
Reply With Quote #8

@alferd
Check the include file, you will find everything in there.
ZaX is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-08-2020 , 07:28   Re: help me with colorchat
Reply With Quote #9

https://amxx-bg.info/api/cromchat/CC_SendMatched
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 07-08-2020, 19:20
theuser
This message has been deleted by theuser.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-08-2020 , 21:45   Re: help me with colorchat
Reply With Quote #10

Show the full code.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 06:18.


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