SA-MP Forums Archive
Stats summary inside dialog - not working. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Stats summary inside dialog - not working. (/showthread.php?tid=107054)



Stats summary inside dialog - not working. - Striker_Moe - 07.11.2009

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?


Re: Stats summary inside dialog - not working. - Badger(new) - 07.11.2009

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



Re: Stats summary inside dialog - not working. - jonybomb - 07.11.2009

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


Re: Stats summary inside dialog - not working. - Striker_Moe - 07.11.2009

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.




Re: Stats summary inside dialog - not working. - jonybomb - 07.11.2009

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


Re: Stats summary inside dialog - not working. - Badger(new) - 07.11.2009

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


Re: Stats summary inside dialog - not working. - DiddyBop - 07.11.2009

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