Stats summary inside dialog - not working.
#1

Hi there. Iґve created this command:

Код:
	if (strcmp("/showkills", cmdtext, true, 10) == 0)
	{
		new string1[48],string2[48],string3[48],string4[48],string5[48],mstring[48];
		format(string1, sizeof string1, "USA kills: %d", TeamKills[2]);
		format(string2, sizeof string2, "Germany kills: %d", TeamKills[1]);
		format(string3, sizeof string3, "Russia kills: %d", TeamKills[4]);
		format(string4, sizeof string4, "China kills: %d", TeamKills[3]);
		format(string5, sizeof string5, "Medic heals: %d", TeamKills[5]);
		format(mstring, sizeof mstring, "%s\n%s\n%s\n%s\n%s", string1,string2,string3,string4,string5);
		ShowPlayerDialog(playerid,743,DIALOG_STYLE_MSGBOX,"Kill summary (1 hour)",mstring,"Okay","Cancel");
		return 1;
	}
But it looks like this ingame:



Whereґs the problem?
Reply
#2

Your string for all of them is too small.
Try:
pawn Код:
new mstring[128];
Reply
#3

I have a question, what is the diference of string[128] and string[48]?
Reply
#4

Yeh ofcourse lol, didnt notice that.

Quote:

I have a question, what is the diference of string[128] and string[48]?

(Explained noobish)
The number after it defines the number of letters inside the string.

You have seen my screenshot, didnt you? You can see, the text is not displayed fully. Thats because the string was too small.

Reply
#5

Hmm, i already think it lol, but now I have sure. tnhx
Reply
#6

The number between the []s is how many characters you can have. So, string[2] can only have 2 characters e.g. Hi
Reply
#7

idk but this server looks good. u just got anotha playa.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)