find_player() & cmd_target()
"j" - return index of last found player.
This is one of the flags that you are able to put in the find_player() command. I was just wondering if this ciphers through every player and finds duplicates (for parts of names entered) or if it just literally returns the last found player. Also, if the flag is left out, does it determine if there's a duplicate then? // Edit // Does cmd_target search by name only, or id and steam id and ip address too? Also, does it cipher through duplicate names and notify the user executing the command? |
in regards to find_player, here is an example: players ABC, ABD, and ABE are connected. you search "with given part of name" (flag "b"), using "AB" for the search string. without the "j" flag, it returns the first it comes across (ABC), with the "j" flag it returns the last it comes across (ABE). i believe the order of its search is based on user ids (player 2 will be found before player 5, player 7 will be found before player 12, etcetera).
looking at the source code for cmd_target (it is a stock in amxmisc.inc, you can look for yourself), it appears as if it searches for part of name first. if it finds someone, then it checks to see if there is anyone else that matches that name. if so, it will tell you that multiple players were found and nothing will happen. if nothing at all is found, it searches through steam ids, and if nothing is found still it searches for user ids, provided the searching string starts with '#' (ie: #12). hopefully this answers all your questions. good luck! |
Thanks for the information, I think I'll just create my own command that searches for part of name, user id, and steam id and finds duplicates. That way I avoid any problems with the natives already created. I can specify to my liking this way :).
+karma for taking the time to help me, man. Thanks, and keep it up. |
| All times are GMT -4. The time now is 20:26. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.