Need Some Help
the ideea is that if a player connects with a name like: server.ro to my server i want to make his name: unnamed and disconnect him and after disconnect him, to print in client console a message asking him to connect after he changes his name... ( and also if the word "server" is part of his name it would react the same...) also i want the plugin to see if the player changes his name in game, search thru the list of restricted names and if is the same as with one of the restricted names turn it back to the old one...
here is what i made until now.. and pelase don`t tell me not to reinvent a plugin... i just want to learn and this i can learn only redoing some plugins...[yeah, i know a lot of plugins that do almost the same thing.. but i want to know what i`m doing wrong... here ] PHP Code:
|
Re: Need Some Help
Are you saying that it doesn't work at all? Are there any errors, that is where I start to get things working.
Anyways, The first thing that I noticed is your for loop. I was taught to never change the incrementing variable inside the for loop. So, I would use a while loop and get rid of "a" completey: PHP Code:
And, always make sure that all of your parentheses are closed. |
Re: Need Some Help
oke, 10x
one more question... PHP Code:
PHP Code:
|
Re: Need Some Help
I personally always enclose any multi-operand conditional in parenthesis. It is not required but it makes code easier to edit\read [IMO]
ie. PHP Code:
|
Re: Need Some Help
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:
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:
PHP Code:
PHP Code:
PHP Code:
|
| All times are GMT -4. The time now is 13:53. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.