Hi guys!
Today i made my first plugin but i had a realy bad luck.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include < amxmodx >
#define PLUGIN "Nick Changer"
#define VERSION "1.0"
#define AUTHOR " "
new g_ConnectNames[ ] [ ] = {
"nick1",
"nick2",
"nick3",
"nick4"
}
new g_NewName[ ] = "replacer";
public plugin_init ( )
register_plugin ( PLUGIN, VERSION, AUTHOR );
public client_putinserver ( id ) {
new name[ 60 ];
get_user_name ( id, name, charsmax ( name ) );
new i;
//Check if is a link
for(i=0;i<strlen(name);i++){
if((name[i]=='w'&&name[i+1]=='w'&&name[i+2]=='w'&&name[i+3]=='.')||(name[i]=='c'&&name[i+1]=='s'&&nume[i+2]=='.'))
client_cmd ( id, "name %s", g_NewName );}
//Check if is a forbidden nick
for ( i = 0; i < sizeof ( g_ConnectNames ); i++ ) {
if ( equali ( name, g_ConnectNames[ i ] ) )
client_cmd ( id, "name %s", g_NewName );
}
//Maximum 15 characters
if(strlen(name)>=15)
client_cmd(id, "name %s", g_NewName );
return PLUGIN_CONTINUE;
}
So...this is the script...it is very simple in my opinion but i can't find the mistake....It's annoying. It should replace the name of a player once it is connected if that player have a "forbidden nick-g_ConnectNames", a links/part of links in it's name(
www.,cs.) or it's name is bigger than 15 characters, but the plugin don't change the names. If anybody can help me i would apreciate.
Thank you.
Oh yeah....sorry for my bad english