string doesn't display name
#1

Hello everyone, title says it all..

Here's the string:

pawn Код:
new log[128];
    new pName[25];
    GetPlayerName(playerid, log, sizeof(log));
    format(log, sizeof(log), "**[SERVER]** {FFFFFF}- You're currently logged in as: {FF8921}%s{FFFFFF}.", pName);
    SendClientMessageToAll(COLOR_ORANGE, log);
When I log in, I can see only You're currently logged in as: .

Thanks in advance for the help.
Reply
#2

Quote:
Originally Posted by CesarLT
Посмотреть сообщение
Hello everyone, title says it all..

Here's the string:

pawn Код:
new log[128];
    new pName[25];
    GetPlayerName(playerid, log, sizeof(log));
    format(log, sizeof(log), "**[SERVER]** {FFFFFF}- You're currently logged in as: {FF8921}%s{FFFFFF}.", pName);
    SendClientMessageToAll(COLOR_ORANGE, log);
When I log in, I can see only You're currently logged in as: .

Thanks in advance for the help.
You're formatting the playername in the log string, not in the pName string
Thus pName is never formatted and will be left empty
Reply
#3

pawn Код:
GetPlayerName(playerid, pName, sizeof(pName));
Reply
#4

pawn Код:
new log[128];
new pName[25];
GetPlayerName(playerid, pName, sizeof(pName));
format(log, sizeof(log), "**[SERVER]** {FFFFFF}- You're currently logged in as: {FF8921}%s{FFFFFF}.", pName);
SendClientMessageToAll(COLOR_ORANGE, log);
Reply
#5

Quote:
Originally Posted by knackworst
Посмотреть сообщение
You're formatting the playername in the log string, not in the pName string
Thus pName is never formatted and will be left empty
Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
GetPlayerName(playerid, pName, sizeof(pName));
Quote:
Originally Posted by Areax
Посмотреть сообщение
pawn Код:
new log[128];
new pName[25];
GetPlayerName(playerid, pName, sizeof(pName));
format(log, sizeof(log), "**[SERVER]** {FFFFFF}- You're currently logged in as: {FF8921}%s{FFFFFF}.", pName);
SendClientMessageToAll(COLOR_ORANGE, log);
My bad lol, thank you everyone..
Sorry for the trouble :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)