Raised This Month: $ Target: $400
 0% 

What i'm doing wrong?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
denis_dnl
New Member
Join Date: Jul 2010
Old 07-04-2010 , 14:57   What i'm doing wrong?
Reply With Quote #1

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 PLUGINVERSIONAUTHOR );

public 
client_putinserver id ) {
new 
name60 ];

get_user_name idnamecharsmax 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 ( 0sizeof g_ConnectNames ); i++ ) {
if ( 
equali nameg_ConnectNames] ) )
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
denis_dnl is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-04-2010 , 18:19   Re: What i'm doing wrong?
Reply With Quote #2

That's because the plugin doesn't compile. Read the compile errors then fix them.

Also, use contain() instead of your for loop and use set_user_info(id, "name", g_NewName) instead of client_cmd().
__________________
fysiks is offline
Reply


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 07:14.


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