Whats Wrong ?
#1

Код:
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
Reply
#2

Can you even compile this?

PHP код:
new watsnew900 ];
   
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(watsnewstrcat(watsnew"\n{1cd8ea}==============================================================\n");
format(info2,sizeof(info2),"%s Faction Informations",PlayerInfo[playerid][PTeamName]);
    
ShowPlayerDialog(playerid,3000,DIALOG_STYLE_MSGBOX,info2,watsnew,"Close",""); 
Reply
#3

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
Reply
#4

Quote:
Originally Posted by ThatFag
Посмотреть сообщение
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
How are we supposed to help you without that you show us what Errors you get?
Reply
#5

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.
Reply
#6

What you mean by "original string" ?
can you give me an example , im kinda new to strings and dialog.
Reply
#7

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
Reply
#8

pawn Код:
new watsnew[320] = "\n{1cd8ea}==============================================================\n" \
    "\n {3696EB}Members online:{FFFFFF}%d\n\n {3696EB}Members:{FFFFFF}%d\n" \
    "\n{3696EB}Gun Stock:{FFFFFF}%d\n\nStock Status:{FFFFFF}%s\n" \
    "\n{1cd8ea}==============================================================\n";
format(watsnew, sizeof watsnew, watsnew, c, dini_Int(tmpf, "factionmembers"), dini_Int(tmpf, "factionguns"), wat);
Reply
#9

Thanks Konstantinos it worked
Thanks others for your opinions .
Repped +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)