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

Chat With Your Country!


Post New Thread Reply   
 
Thread Tools Display Modes
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 11-04-2010 , 19:14   Re: Chat With Your Country!
Reply With Quote #11

It doesn't block any chat. It only puts it in country chat if the message has '!' as the first character. So for example "!Hi my name is bob." would result in

[United States] Bob: Hi my name is bob.

And if it was team chat with '!' then

[United States] (TERRORIST) Bob: Hi my name is bob.

For the first one it would show to everyone from their country. If second it would only show to their team that's from their country.

You could stlil talk regular, without using '!', and it would show up as normal, as well as with team chat. No chat get's deleted or blocked, unless the country name shows as 'error'.

Hope that clears it up. If you have suggestions as for how I could make it clearer in the description, please post.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-04-2010 , 20:06   Re: Chat With Your Country!
Reply With Quote #12

You could make an option so admins see all messages.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 11-04-2010 , 20:57   Re: Chat With Your Country!
Reply With Quote #13

v1.1 released - added cvar that connor suggested.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
stevamirkovic
Junior Member
Join Date: Apr 2009
Old 11-15-2010 , 05:26   Re: Chat With Your Country!
Reply With Quote #14

Compile errors.

Plugin failed to compile! Please try contacting the author.
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/alliedmodders/forums/files/5/9/0/3/5/76742.attach(41) : fatal error 100: cannot read from file: "colorchat"

Compilation aborted.
1 Error.
stevamirkovic is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-15-2010 , 06:37   Re: Chat With Your Country!
Reply With Quote #15

You need to compile locally.
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-03-2011 , 15:32   Re: Chat With Your Country!
Reply With Quote #16

You need to cache players[i] and countries[id] in loops, as soon as they are used more than one time.
You should create and fill message2 only if needed (aka when 1st checks are passed).
You don't need to strtok, just pass message2[1] so the '!' is not printed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
.MMYTH.
BANNED
Join Date: Sep 2010
Location: Brasil - RS
Old 01-04-2011 , 11:54   Re: Chat With Your Country!
Reply With Quote #17

change the colorchat include for this:

PHP Code:
stock client_printc(const id, const input[], any:...)
{
    new 
msg[191], players[32], count 1
    vformat
(msg,190,input,3)
    
replace_all(msg,190,"\g","^4")
    
replace_all(msg,190,"\n","^1")
    
replace_all(msg,190,"\t","^3")
    
    if(
id)
        
players[0] = id
    
else
        
get_players(players,count,"ch")
    
    for(new 
i=0;i<count;i++)
        
    if(
is_user_connected(players[i]))
    {
        
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i])
        
write_byte(players[i])
        
write_string(msg)
        
message_end()
    }

.MMYTH. is offline
Send a message via MSN to .MMYTH.
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-04-2011 , 12:23   Re: Chat With Your Country!
Reply With Quote #18

Quote:
Originally Posted by .MMYTH. View Post
change the colorchat include for this:
No don't do this.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 01-05-2011 , 19:20   Re: Chat With Your Country!
Reply With Quote #19

Fixed the other two things, but not sure what you mean by this:

"You need to cache players[i] and countries[id] in loops, as soon as they are used more than one time."

Could you please explain?
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-06-2011 , 02:32   Re: Chat With Your Country!
Reply With Quote #20

Read AM wiki, plugins optimizations part.
__________________
- 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 12:55.


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