ShowPlayerDialog -
MiGu3X - 30.04.2013
Hello i wnana ask u guys today if it is possible to add player name strings (%s) on dialogs.
If not, how do people do it?
Thanks
Re: ShowPlayerDialog -
RajatPawar - 30.04.2013
pawn Код:
new my_dialog_string[60], name[24]; GetPlayerName(playerid, name, 24);
format(my_dialog_string, 60, "Hello %s!", name);
ShowPlayerDialog(playerid, DIALOG_WHATEVER_ID, DIALOG_STLYE_MESSAGE, my_dialog_string, ... );
Re: ShowPlayerDialog -
L.Hudson - 30.04.2013
pawn Код:
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s", name);
ShowPlayerDialog(playerid, [yourdialogid], DIALOG_STYLE_MSGBOX, "Name",string,"Done","Cancel");
as simple as that
EDIT: too late ^^
Re: ShowPlayerDialog -
DaRk_RaiN - 30.04.2013
Sure you can.
pawn Код:
new string[115],pname[24];//The dialog string and the player name string.
GetPlayerName(playerid,pname,sizeof(pname));//Getting the playername
format(string,sizeof(string),"Your name is %s",pname);//This will get the player name and the out put coulf be what ever you want, ClientMessage,GameText,Textdraw ect..
ShowPlayerDialog(playerid, 450, DIALOG_STYLE_MSGBOX, ".::Your dialog title::." ,string, "Close" , "" );//This will be the output, it will be sent as a Dialog.
P.S:The code above is just an example, it might work, or not
Re: ShowPlayerDialog -
JaKe Elite - 30.04.2013
it is possible
pawn Код:
new string[128], pName[24];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof string, "Welcome %s to i'm trap server", pName);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Test Dialog", string, "Noob", "NVM");
Re: ShowPlayerDialog -
Youice - 30.04.2013
PHP код:
new str[128], str2[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(str, sizeof(str), "my name is: %s", name);
format(str2, sizeof(str2), "my id is: %d", playerid);
ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_INPUT, str, str2, "Okay", "Close");
That's just an example, learn how to use
format
Re: ShowPlayerDialog -
PT - 30.04.2013
Hello Another exemple:
pawn Код:
#define PTD 123
new PT[70], ptname[24];
GetPlayerName(playerid, ptname, sizeof(ptname));
format(PT,sizeof(PT),"Your name is %s",ptname);
ShowPlayerDialog(playerid, PTD, DIALOG_STYLE_MSGBOX, ".... Your Name ...." , PT, "OK" , "" );
PT
Re: ShowPlayerDialog -
MiGu3X - 30.04.2013
Thanks i just didnt knew that much about dialogs