playername in dialog
#1

pawn Код:
new pname[MAX_PLAYER_NAME];
                    INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    GetPlayerName(playerid, pname, sizeof(pname));
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Account - Logged in Sucessfully",""COL_WHITE"You are now logged in, Welcome back %s!","Ok", pname,"");
warning 202: number of arguments does not match definition
Line:
pawn Код:
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Account - Logged in Sucessfully",""COL_WHITE"You are now logged in, Welcome back %s!","Ok", pname,"");
Reply
#2

You can't do that, you have to use format first.
pawn Код:
format( st, sizeof( st ), "Welcome back, %s", pname );
ShowPlayerDialog( ....., st, ...);
Reply
#3

https://sampwiki.blast.hk/wiki/ShowPlayerDialog where are you getting the "pname" from, you'll need to format it. https://sampwiki.blast.hk/wiki/format
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)