Raised This Month: $ Target: $400
 0% 

find_player() & cmd_target()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
capndurk
Senior Member
Join Date: Feb 2006
Old 03-12-2006 , 00:51   find_player() & cmd_target()
Reply With Quote #1

"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?
capndurk is offline
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 03-12-2006 , 15:22  
Reply With Quote #2

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!
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
capndurk
Senior Member
Join Date: Feb 2006
Old 03-12-2006 , 16:40  
Reply With Quote #3

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.
capndurk is offline
Reply


Thread Tools
Display Modes

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 20:26.


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