I didn't like the behaviour of the stock SM function FindTarget so I made this instead. Issue with FindTarget is that when you type a name and there are multiple matches it does pretty much nothing (other than an error).

This include file defines a stock function SelectTarget that works similar to FindTarget, but opens a menu to the client with all the possible matches if there are more than 1.

If there were 3 players on the server named "Ta", "Tac" and "Taco" and the user input was "Ta", then a menu shows up to the client with those 3 possible matches and the callback is called for whichever is chosen.
If the user input was instead "Taco", there is only 1 match and the callback is called immediately.

// Since this is intended to display a menu: // Filters say to ignore admin immunity levels and also not select botsint count = ProcessTargetString(target, client, displayTo, sizeof(displayTo), COMMAND_FILTER_NO_IMMUNITY|COMMAND_FILTER_NO_BOTS); if (count < 1) {// This handles "target not found" and the likeReplyToTargetError(client, count); return Plugin_Handled; }

// displayTo[0] through displayTo[count-1] now contain client indexes of all matching clients that you can iterate through using a for loopfor (int i = 0; i < count; i++) {// Do something with displayTo[i]PrintToChat( displayTo[i], "[SM] This is boring and uses a for loop instead of a callback :(" ); } return Plugin_Handled;}

The loop would apply to all clients that match the target name instead of just the 1. The whole point is you're selecting 1 player through a menu (if there are multiple matches).
You need a callback if the client is gonna be a selecting that player through a menu at a later point.

You could use ProcessTargetString in the stock function itself and wrap it with the menu/callback stuff but I had issues with it before in terms of bot/self selection so I do the StrContains with all clients instead.