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 i = 0; i < NumberOfNamesFromFile; i++)
{
// Use containi or even your partial name check code ( I can't comprehend what it does exactly at the moment :)
if(containi(username, names[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]
__________________