%s name and %s surname?
#4

Sure here you go using ZCMD and sscanf:

pawn Код:
CMD:showid(playerid, params[])
{
    new id;
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /showid [Player ID/Part of Name]");
    new str[128], FullName[MAX_PLAYER_NAME], FirstName[MAX_PLAYER_NAME], LastName[MAX_PLAYER_NAME];
    GetPlayerName(id, FullName, sizeof(FullName));
    strmid(FirstName, FullName, 0, strfind(FullName, "_"));
    strmid(LastName, FullName, strfind(FullName, "_")+1, strlen(FullName));
    format(str, sizeof(str), "FIRST NAME: %s", FirstName);
    SendClientMessage(playerid, -1, str);
    format(str, sizeof(str), "Last NAME: %s", LastName);
    SendClientMessage(playerid, -1, str);
    return 1;
}
Reply


Messages In This Thread
%s name and %s surname? - by Gooday - 31.03.2012, 19:40
Re: %s name and %s surname? - by SpiritEvil - 31.03.2012, 19:58
Re: %s name and %s surname? - by Gooday - 31.03.2012, 20:19
Re: %s name and %s surname? - by SpiritEvil - 31.03.2012, 20:23

Forum Jump:


Users browsing this thread: 1 Guest(s)