Raised This Month: $ Target: $400
 0% 

Problem characters (name and symbol)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
CsIosefin
Senior Member
Join Date: Aug 2009
Old 05-08-2010 , 10:16   Re: Problem characters (name and symbol)
Reply With Quote #3

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 < sizeof Caracters; 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
}
I put sizeof, but now I'm not going to the server, I still require at least 3 characters, I ask nothing more, all this tells me.

EDIT:

I did, I repaired!
Okay, thank you very much xPaw support!

Last edited by CsIosefin; 05-08-2010 at 10:42.
CsIosefin is offline
 



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