Raised This Month: $ Target: $400
 0% 

show country chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 12-02-2011 , 22:23   show country chat
Reply With Quote #1

Hi.

Code:
#include <amxmodx>
#include <amxmisc>
#include <geoip>

new countries[33][46]
new ips[33][30]

public plugin_init()
{
	register_clcmd("say", "cmdSay")
}

public client_connect(id)
{
	get_user_ip(id, ips[id], charsmax(ips))
	geoip_country(ips[id], countries[id], charsmax(countries))
}

public cmdSay(id)
{
	new message2[200]
	read_args(message2, charsmax(message2))
		
	new name[32]
	get_user_name(id, name, 31)

	new country[46]
	copy(country, charsmax(country), countries[id])
			
	client_print(0, print_chat, "[%s] %s : %s", country, name, message2[1])
}
The result is like this.

[Japan] Player : Hello
Player : Hello

The original chat "Player : Hello" Please tell me how to delete the

Last edited by RuRuRu612754; 12-02-2011 at 22:23.
RuRuRu612754 is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 12-02-2011 , 23:11   Re: show country chat
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> #include <geoip> new countries[33][46] new ips[33][30] public plugin_init() {     register_clcmd("say", "cmdSay") } public client_connect(id) {     get_user_ip(id, ips[id], charsmax(ips))     geoip_country(ips[id], countries[id], charsmax(countries)) } public cmdSay(id) {     new message2[200]     read_args(message2, charsmax(message2))       new name[32]     get_user_name(id, name, 31)     new country[46]     copy(country, charsmax(country), countries[id])         client_print(0, print_chat, "[%s] %s : %s", country, name, message2[1])     return PLUGIN_HANDLED }
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 12-02-2011 , 23:51   Re: show country chat
Reply With Quote #3

K.K.Lv

thanks!!

The result is like this.

[Japan] Player : Hello"

Why?

delete the "

client_print(0, print_chat, "[%s] %s : %s", country, name, message2[1])

Last edited by RuRuRu612754; 12-02-2011 at 23:52.
RuRuRu612754 is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 12-03-2011 , 04:16   Re: show country chat
Reply With Quote #4

Code:
//Plugin passes through operation.  Whatever called it continues. #define PLUGIN_CONTINUE          0 //Plugin halts continued operation (plugins following in the plugins.ini won't be called). //Whatever called it will eventually supercede. #define PLUGIN_HANDLED      1 //Continue calling plugins but halt the operation #define PLUGIN_HANDLED_MAIN 2
__________________
QQ:116268742

Last edited by K.K.Lv; 12-03-2011 at 04:19.
K.K.Lv is offline
Send a message via MSN to K.K.Lv
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 12-03-2011 , 05:10   Re: show country chat
Reply With Quote #5

K.K.Lv

thanks

However, the result is as follows.

[Japan] Player : Hello"

Code:
#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <geoip>

//Plugin passes through operation.  Whatever called it continues.
#define PLUGIN_CONTINUE          0
//Plugin halts continued operation (plugins following in the plugins.ini won't be called).
//Whatever called it will eventually supercede.

#define PLUGIN_HANDLED    1

//Continue calling plugins but halt the operation

#define PLUGIN_HANDLED_MAIN 2 

new countries[33][46]
new ips[33][30]

public plugin_init()
{
	register_clcmd("say", "cmdSay")
}

public client_connect(id)
{
	get_user_ip(id, ips[id], charsmax(ips))
	geoip_country(ips[id], countries[id], charsmax(countries))
}

public cmdSay(id)
{
	new message2[200]
	read_args(message2, charsmax(message2))
			
	new name[32]
	get_user_name(id, name, 31)

	new country[46]
	copy(country, charsmax(country), countries[id])

	ColorChat(0, TEAM_COLOR, "^x01[%s] ^x03%s ^x01: %s", country, name, message2[1])
	client_print(0, print_chat, "[%s] %s : %s", country, name, message2[1])

	return PLUGIN_HANDLED
}
RuRuRu612754 is offline
Xpawn
Junior Member
Join Date: Dec 2011
Old 12-03-2011 , 06:22   Re: show country chat
Reply With Quote #6

This is Incorrect your's postreply

this is the correct

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <geoip>

new countries[33][46]
new 
ips[33][30]

public 
plugin_init()
{
    
register_clcmd("say""cmdSay")
}

public 
client_connect(id)
{
    
get_user_ip(idips[id], charsmax(ips))
    
geoip_country(ips[id], countries[id], charsmax(countries))
}

public 
cmdSay(id)
{
    new 
message2[200]
    
read_args(message2charsmax(message2))
            
    new 
name[32]
    
get_user_name(idname31)

    new 
country[46]
    
copy(countrycharsmax(country), countries[id])
    
    
client_print(0print_chat"[%s] %s : %s"countrynamemessage2[1])

    return 
PLUGIN_HANDLED

No colored chat !!!

But there is an error with IP And country

I tested the plugin and this is what I do
Quote:
] say
[error] LR Gaming|[E]cho_CStr!Ke
the plugin say
[error] LR Gaming|[E]cho_CStr!Ke


The name is correct but IP and country are false
__________________
New Member

Last edited by Xpawn; 12-03-2011 at 06:32.
Xpawn is offline
Send a message via MSN to Xpawn
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-03-2011 , 07:48   Re: show country chat
Reply With Quote #7

PHP Code:
/*    Formatright ɠ2010, ConnorMcLeod

    This plugin is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this plugin; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <geoip>

#define MAX_PLAYERS        32

new g_szCountry[MAX_PLAYERS+1][46]

#define VERSION "0.0.1"
#define PLUGIN "Country Chat"

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_message(get_user_msgid("SayText"), "Message_SayText")
}

public 
client_putinserver(id)
{
    static 
szIp[16]
    
get_user_ip(idszIpcharsmax(szIp), 1)
    
geoip_country(szIpg_szCountry[id], charsmax(g_szCountry[]))
}

public 
Message_SayText()
{
    new 
id get_msg_arg_int(1)
    new 
szChannel[40]
    
get_msg_arg_string(2szChannelcharsmaxszChannel ) )
    if( 
equal(szChannel"#Cstrike_Chat"13) )
    {
        if( 
equal(szChannel"#Cstrike_Chat_All") )
        {
            
format(szChannelcharsmax(szChannel), "^4[%s] ^3%%s1 ^1:  %%s2"g_szCountry[id])
        }
        else
        {
            
format(szChannelcharsmax(szChannel), "^4[%s] %s"g_szCountry[id], szChannel)
        }
        
set_msg_arg_string(2szChannel)
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-03-2011 at 07:50.
ConnorMcLeod is offline
Xpawn
Junior Member
Join Date: Dec 2011
Old 12-03-2011 , 11:31   Re: show country chat
Reply With Quote #8

GooD job ConnorMcLeod

PHP Code:
/*    Formatright ɠ2010, ConnorMcLeod 

    This plugin is free software; 
    you can redistribute it and/or modify it under the terms of the 
    GNU General Public License as published by the Free Software Foundation. 

    This program is distributed in the hope that it will be useful, 
    but WITHOUT ANY WARRANTY; without even the implied warranty of 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    GNU General Public License for more details. 

    You should have received a copy of the GNU General Public License 
    along with this plugin; if not, write to the 
    Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
    Boston, MA 02111-1307, USA. 
*/ 

#include <amxmodx> 
#include <geoip> 

#define MAX_PLAYERS        32 

new g_szCountry[MAX_PLAYERS+1][46

#define VERSION "0.0.1" 
#define PLUGIN "Country Chat" 

public plugin_init() 

    
register_plugin(PLUGINVERSION"ConnorMcLeod"
    
register_message(get_user_msgid("SayText"), "Message_SayText"


public 
client_putinserver(id

    static 
szIp[16
    
get_user_ip(idszIpcharsmax(szIp), 1
    
geoip_country(szIpg_szCountry[id], charsmax(g_szCountry[])) 


public 
Message_SayText() 

    new 
id get_msg_arg_int(1
    new 
szChannel[40
    
get_msg_arg_string(2szChannelcharsmaxszChannel ) ) 
    if( 
equal(szChannel"#Cstrike_Chat"13) ) 
    { 
        if( 
equal(szChannel"#Cstrike_Chat_All") ) 
        { 
            
format(szChannelcharsmax(szChannel), "^4[%s] ^3%%s1 ^1:  %%s2"g_szCountry[id]) 
        } 
        else 
        { 
            
format(szChannelcharsmax(szChannel), "^4[%s] %s"g_szCountry[id], szChannel
        } 
        
set_msg_arg_string(2szChannel
    } 

__________________
New Member
Xpawn is offline
Send a message via MSN to Xpawn
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 12-03-2011 , 13:06   Re: show country chat
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
/*    Formatright ɠ2010, ConnorMcLeod
 
    This plugin is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this plugin; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/
 
#include <amxmodx>
#include <geoip>
 
#define MAX_PLAYERS        32
 
new g_szCountry[MAX_PLAYERS+1][46]
 
#define VERSION "0.0.1"
#define PLUGIN "Country Chat"
 
public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_message(get_user_msgid("SayText"), "Message_SayText")
}
 
public 
client_putinserver(id)
{
    static 
szIp[16]
    
get_user_ip(idszIpcharsmax(szIp), 1)
    
geoip_country(szIpg_szCountry[id], charsmax(g_szCountry[]))
}
 
public 
Message_SayText()
{
    new 
id get_msg_arg_int(1)
    new 
szChannel[40]
    
get_msg_arg_string(2szChannelcharsmaxszChannel ) )
    if( 
equal(szChannel"#Cstrike_Chat"13) )
    {
        if( 
equal(szChannel"#Cstrike_Chat_All") )
        {
            
format(szChannelcharsmax(szChannel), "^4[%s] ^3%%s1 ^1:  %%s2"g_szCountry[id])
        }
        else
        {
            
format(szChannelcharsmax(szChannel), "^4[%s] %s"g_szCountry[id], szChannel)
        }
        
set_msg_arg_string(2szChannel)
    }

Quote:
Originally Posted by Xpawn View Post
GooD job ConnorMcLeod

PHP Code:
/*    Formatright ɠ2010, ConnorMcLeod 
 
    This plugin is free software; 
    you can redistribute it and/or modify it under the terms of the 
    GNU General Public License as published by the Free Software Foundation. 
 
    This program is distributed in the hope that it will be useful, 
    but WITHOUT ANY WARRANTY; without even the implied warranty of 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    GNU General Public License for more details. 
 
    You should have received a copy of the GNU General Public License 
    along with this plugin; if not, write to the 
    Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
    Boston, MA 02111-1307, USA. 
*/ 
 
#include <amxmodx> 
#include <geoip> 
 
#define MAX_PLAYERS        32 
 
new g_szCountry[MAX_PLAYERS+1][46
 
#define VERSION "0.0.1" 
#define PLUGIN "Country Chat" 
 
public plugin_init() 

    
register_plugin(PLUGINVERSION"ConnorMcLeod"
    
register_message(get_user_msgid("SayText"), "Message_SayText"

 
public 
client_putinserver(id

    static 
szIp[16
    
get_user_ip(idszIpcharsmax(szIp), 1
    
geoip_country(szIpg_szCountry[id], charsmax(g_szCountry[])) 

 
public 
Message_SayText() 

    new 
id get_msg_arg_int(1
    new 
szChannel[40
    
get_msg_arg_string(2szChannelcharsmaxszChannel ) ) 
    if( 
equal(szChannel"#Cstrike_Chat"13) ) 
    { 
        if( 
equal(szChannel"#Cstrike_Chat_All") ) 
        { 
            
format(szChannelcharsmax(szChannel), "^4[%s] ^3%%s1 ^1:  %%s2"g_szCountry[id]) 
        } 
        else 
        { 
            
format(szChannelcharsmax(szChannel), "^4[%s] %s"g_szCountry[id], szChannel
        } 
        
set_msg_arg_string(2szChannel
    } 

LOL

Edit, the plugin is great ( Do not undestand a wrong way connor ( : ) but xpawn, you are just so funny : )
And stupid...

Last edited by .Dare Devil.; 12-03-2011 at 13:24.
.Dare Devil. is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 12-04-2011 , 02:40   Re: show country chat
Reply With Quote #10

Thanks for ConnorMcLeod

and all answer thanks

ConnorMcLeod is Very nice AMX plugin maker
I will respect him

Last edited by RuRuRu612754; 12-04-2011 at 02:41.
RuRuRu612754 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 01:11.


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