View Single Post
Author Message
reBane
Senior Member
Join Date: May 2020
Old 03-07-2023 , 13:46   [ANY] playerpicker.inc
Reply With Quote #1

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 resultint userid) {
    
int client GetClientOfUserId(userid);
    if (!
client || !result) return; //result 0 = cancelled by user/menu timeout
    
if (result 0PrintToChat(client"Target error"); // <0 are target COMMAND_TARGET_* values
    
doWhatever(result); //result = client index
}
//...
    
PickPlayer(clientCOMMAND_FILTER_*, callbackGetClientUserId(client)); 
https://gist.github.com/DosMike/d8c3...09d845e113877a
__________________
Plugins & LibrariesListingGitHubDosMikeTools ▶ ToDo
reBane is offline