Hi, i wrote this inc file for targeted commands (/example @me). If the target is not found or no target was specified, this script can open a menu to the client, to pick a player from a list using PickPlayer().
There is an example in the gist, that might be outdated, but it should be a good reference.
Actual usage would be:
PHP Code:
void callback(int result, int userid) {
int client = GetClientOfUserId(userid);
if (!client || !result) return; //result 0 = cancelled by user/menu timeout
if (result < 0) PrintToChat(client, "Target error"); // <0 are target COMMAND_TARGET_* values
doWhatever(result); //result = client index
}
//...
PickPlayer(client, COMMAND_FILTER_*, callback, GetClientUserId(client));
https://gist.github.com/DosMike/d8c3...09d845e113877a
__________________