%s name and %s surname?
#1

Could be "makeable"

Name: %s
Surname: %s

I mean if is possible to know a include for the second park (basically after the "_" is considerated surname)
Reply
#2

Here you go, I hope it helps

pawn Код:
new FullName[MAX_PLAYER_NAME], FirstName[MAX_PLAYER_NAME], LastName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, FullName, sizeof(FullName));
    strmid(FirstName, FullName, 0, strfind(FullName, "_"));
    strmid(LastName, FullName, strfind(FullName, "_")+1, strlen(FullName));
    //printf("Full Name: %s\nFirst Name: %s\nLast Name: %s", FullName, FirstName, LastName);
Reply
#3

How could i make like:

/show id

Send a message to the ID with
NAME:
SURNAME:
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)