Name contain
I want to check if there is players with a similar name as the player i am using the command on.. I want to be able to type for example /ban Chu, if the player i am going to ban's name is "Chuck", but if there are other people on the server which names contains Chu, it will give an error message saying there are too many people with a similar name, and that you should provide more information. I know you are supposed to use "strlen" and a for loop in some way.. But i can't figure out how. So.. Run the command if the part of the name entered is unique and nobody else currently on the server has it, but give an error if someone else has a name which contains for example "Chu" . How do i do this? Thanks.
note: I do not want to check specific names in the code itself, i want this to work on whatever player you use it on Just made this quickly, i know it has alot of flaws in it's code and looks bad, and you don't need to fix that for me, i just made this quickly and haven't really cleared it up from junk and i will do that later.. But you get the point. The comment is where i want to check. PHP Code:
|
Re: Name contain
cmd_target()
|
Re: Name contain
Quote:
|
Re: Name contain
cmd_target does exactly that
|
Re: Name contain
Still can't get it working really though.. Having some problems here. What am i doing wrong? I'm only getting "Player not found" message
PHP Code:
|
Re: Name contain
Code:
/* Flags: |
Re: Name contain
Quote:
|
Re: Name contain
Code:
] say "/report Rose He sucks"All I did was add CMDTARGET_ALLOW_SELF to cmd_target() because I also have nobody to test with. Maybe you are getting multiple matches, because that would produce the same error. Say your bots are named Bob1 and Bob2, cmd_target can't pick one if you just write "Bob" and will return 0. |
Re: Name contain
Quote:
|
| All times are GMT -4. The time now is 06:01. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.