IDK if this works i made it in a few minutes,test and reply here.
You have to #include them at the top of the script and put sscanf in plugins folder. ++ You have to make new line in your server.cfg called "plugins sscanf" or if you get errors "plugins sscanf2".
PHP код:
CMD:locate(playerid,params[])
{
new ID,msg[256],name[MAX_PLAYER_NAME];
new Float:X,Float:Y,Float:Z;
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,-1,"ERROR: You must login before using that");
if(sscanf(params,"u",ID)) return SendClientMessage(playerid,-1,"SYNTAX: /Locate [ID/Name]"); // If you fail a command you will get this message.
if(ID == playerid) return SendClientMessage(playerid,-1,"You can't locate yourself"); // I think you understand this :D
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"ERROR: Player is not connected"); // If ID is not connected return 0.
GetPlayerPos(ID,X,Y,Z); // We are taking ID's position. To know where he is.
GetPlayerName(ID,name,sizeof(name)); // We are taking ID's name.
SetPlayerMapIcon(playerid,12, X,Y,Z,0,3,MAPICON_GLOBAL_CHECKPOINT); // You could use setplayercheckpoints or markers etc... This is an example.
format(msg,256,"You located %s whose id is: %d on the map.",name,ID); // Prepared message
SendClientMessage(playerid,-1,msg); // Sent message
return 1;
}