Find ID
#1

Good night.
I have a doubt. I wonder if you have any function for me to find the ID of the player by his nickname.
If someone can help I would be grateful.
Reply
#2

pawn Код:
CMD:getid(playerid, params[])
{
    new str[1000], targetid, Name[MAX_PLAYER_NAME];
    if(sscanf(params, "u", targetid))
    {
        return 1;
    }
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF} Player not connected");
    {
        GetPlayerName(targetid, Name1, sizeof(Name1));
        format(str, sizeof(str), "%s ID is: %d", Name1, targetid, str2);
        SendClientMessage(playerid, FF0066, str);
    }
    return 1;
}
test player name is Cerealguy and you type /getid Cereal or complete name, you recive message Cerealguy ID is: 1
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)