This command returns the name of player id 0
#1

Hello, this command i have it returns the name of the id 0 only.

So if i do /getid 1 i'll get the name of the ID 0 instead of ID 1.

pawn Код:
CMD:getid(playerid, params[])
{
    new string[128], id;
    new name[MAX_PLAYER_NAME];
    GetPlayerName(id,name,sizeof(name));
    if(sscanf(params, "u", id))
    {
        SendClientMessage(playerid, -1, "{F70505}Usage: {FFFFFF}/getid <part of name>");
    }
    else
    {
        if(IsPlayerConnected(id))
        {
            format(string, sizeof(string), "The ID that matches %s is %d.", name, id);
           SendClientMessage(playerid, red, string);
        }
        else
        {
            SendClientMessage(playerid, red, "That player is not connected or is not logged in.");
        }
    }
    return 1;
}
Thanks for help.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)