Raised This Month: $ Target: $400
 0% 

Problem characters (name and symbol)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
CsIosefin
Senior Member
Join Date: Aug 2009
Old 05-08-2010 , 09:30   Problem characters (name and symbol)
Reply With Quote #1

Code:
#include <amxmodx>

new const Caracters[] = "!'.,/"

public plugin_init() 
{
	register_plugin("Characters", "1.0", "Teams")
}

public client_connect(id)
{
	static name[32]
	get_user_name(id, name, 31)

	for(new i = 0; i < strlen(name); i++)
	{
		for(new j = 0; j < 10; j++)
		{
			if(name[i] == Caracters[j])
			{
				server_cmd("kick #%d %s", get_user_userid(id), "The name can not contain characters.")
			}

			if(strlen(name[i]) < 3 )
			{
				server_cmd("kick #%d %s", get_user_userid(id), "The name can not be less than three characters.")
			}
		}
	}

	return PLUGIN_CONTINUE
}

public client_infochanged(id)
{
	new newname[32], oldname[32]
	get_user_info(id, "name", newname, 31)
	get_user_name(id, oldname, 31)
	
	if(equali(newname, oldname))
		return PLUGIN_CONTINUE
      
	set_task(1.0, "client_connect", id)
   
	return PLUGIN_CONTINUE
}
What is, why not get the logs ... all understand ...
Code:
L 05/08/2010 - 04:17:51: [AMXX] Displaying debug trace (plugin "caracters.amxx")
L 05/08/2010 - 04:17:51: [AMXX] Run time error 4: index out of bounds 
L 05/08/2010 - 04:17:51: [AMXX]    [0] caracter.sma::client_connect (line 19)
Can you tell me what is wrong ...? Thanks very much!
CsIosefin is offline
 


Thread Tools
Display Modes

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 03:42.


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