Raised This Month: $ Target: $400
 0% 

Need Some Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-07-2009 , 18:31   Re: Need Some Help
Reply With Quote #5

Yes, continue causes it to skip any following lines in the while loop.

client_connects -> client_connect (fyi)

client_infochanged() is called serveral times (in my experience) during connection so there wouldn't be a need to have client_connect.

This won't work if executed when the player is dead/spectating/noteam which is the case when they are connecting:
PHP Code:
client_cmd(id"name %s"SETNAME

Also, I would try to make things more modular. Meaning, I would make a function that looks for [partial] matches of the supplied string and one of the names found in the list of names retrieved from the ini file.

My example:
PHP Code:
bool:does_contain_restricted_name(username[])
{
    for(new 
0NumberOfNamesFromFilei++)
    {
        
// Use containi or even your partial name check code ( I can't comprehend what it does exactly at the moment :)
        
if(containi(usernamenames[i]))
        {
            return 
true
        
}
    }
    return 
false

Then I would use (in client_infochanged) something like:

PHP Code:
if( does_contain_restricted_name(newname) )
{
    
// Change name/kick person here.
    
return PLUGIN_HANDLED
}

return 
PLUGIN_CONTINUE 
EDIT: Oh, and I think you will need to declare the string length for your names loaded from the file:

PHP Code:
new names[MAXNAMES][] 

PHP Code:
new names[MAXNAMES][32
__________________

Last edited by fysiks; 06-07-2009 at 18:34.
fysiks 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 13:53.


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