Posts: 383
Threads: 70
Joined: Feb 2016
Код:
new watsnew[ 900 ];
\n{1cd8ea}==============================================================\n");
format(watsnew,sizeof(watsnew), " \n {3696EB}Members online:{FFFFFF}%d \n",c);
format(watsnew,sizeof(watsnew), " \n {3696EB}Members:{FFFFFF}%d \n",dini_Int(tmpf, "factionmembers"));
format(watsnew,sizeof(watsnew), "\n{3696EB}Gun Stock:{FFFFFF}%d \n",dini_Int(tmpf, "factionguns"));
format(watsnew,sizeof(watsnew), "\nStock Status:{FFFFFF}%s\n",wat);
format(watsnew,sizeof(watsnew), "\n{1cd8ea}==============================================================\n");
format(info2,sizeof(info2),"%s Faction Informations",PlayerInfo[playerid][PTeamName]);
ShowPlayerDialog(playerid,3000,DIALOG_STYLE_MSGBOX,info2,watsnew,"Close","");
Its showing only the ===== on dialog
its meant to show whole one but idk what is wrong the script is complied and no errors or anything please give me a hand
Posts: 775
Threads: 78
Joined: Dec 2014
Can you even compile this?
PHP код:
new watsnew[ 900 ];
strcat(watsnew, "{1cd8ea}==============================================================\n");
strcat(watsnew, " \n {3696EB}Members online:{FFFFFF}%d \n",c);
strcat(watsnew, " \n {3696EB}Members:{FFFFFF}%d \n",dini_Int(tmpf, "factionmembers"));
strcat(watsnew, "\n{3696EB}Gun Stock:{FFFFFF}%d \n",dini_Int(tmpf, "factionguns"));
strcat(watsnew, "\nStock Status:{FFFFFF}%s\n",wat);
strcat(watsnew, strcat(watsnew, "\n{1cd8ea}==============================================================\n");
format(info2,sizeof(info2),"%s Faction Informations",PlayerInfo[playerid][PTeamName]);
ShowPlayerDialog(playerid,3000,DIALOG_STYLE_MSGBOX,info2,watsnew,"Close","");
Posts: 383
Threads: 70
Joined: Feb 2016
I've already tried that but it gives me some errors.
I checked some other posts that had same problem and they solved it by using format but at me aint working
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
The format() function erases the string and the dialog is showing the last line, not the first. The original string needs to be formatted in as well, or you can use a temporary variable and then concatenate that to the output string. I prefer the latter option because it's clearer, albeit it probably slightly slower.
Posts: 383
Threads: 70
Joined: Feb 2016
What you mean by "original string" ?
can you give me an example , im kinda new to strings and dialog.
Posts: 596
Threads: 75
Joined: Nov 2015
forexample you format this string:
Код:
format(string, sizeof(string), "Hello\n");
After that you format another string in the same variable:
Код:
format(string, sizeof(string), "Its me K0P");
Actually what it will do is replace "Its me K0P" with "Hello"
If you want to join 2 or more strings,use strcat(); function
Posts: 383
Threads: 70
Joined: Feb 2016
Thanks Konstantinos it worked
Thanks others for your opinions
![Cheesy](images/smilies/biggrin.png)
.
Repped +