Raised This Month: $ Target: $400
 0% 

Plugin autokick players with the nick "Player"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sysgame
New Member
Join Date: Mar 2010
Old 08-12-2011 , 13:09   Re: Plugin autokick players with the nick "Player"
Reply With Quote #1

Now I have a file that contains all of the nickname and I want to make a loop of this type

This is correct?

PHP Code:
new g_array_created;
// Arrays
new Array:g_spam;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Create the Array
    
g_spam ArrayCreate(321)
    
g_array_created true
    register_dictionary
("nickname.txt")
}

public 
client_connect(id)
{    
    new 
szName];
    
get_user_nameidszName);
   
   for(new 
0ArraySize(g_spam); i++)
        {
    
ArrayGetString(g_spamibuffer31);
    if( 
equaliszNameg_spam[i] ) )
    {
         
emessage_beginMSG_ONESVC_DISCONNECT_id );
         
ewrite_string"Please change your name." );
         
emessage_end( );
    }
        }
        


Last edited by sysgame; 08-12-2011 at 13:28.
sysgame is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-12-2011 , 14:51   Re: Plugin autokick players with the nick "Player"
Reply With Quote #2

You don't understand what each function does it seems... and you didn't apply any logic either, where is the array actually assigned to the contents of the file ?

http://www.amxmodx.org/funcwiki.php < start here, all natives and stocks available are listed and briefly explained there... start by inputing register_dictionary to see what it actually does (which is nothing related to your needs).

For file reading functions there are tutorials you know, it wouldn't hurt to read them instead of blindly trying out stuff
__________________
Hunter-Digital 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 03:22.


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