SA-MP Forums Archive
SendClientMessage cuts after a few words - 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)
+--- Thread: SendClientMessage cuts after a few words (/showthread.php?tid=442703)



SendClientMessage cuts after a few words - Sellize - 08.06.2013

Yeah so when it shows the format it doesnt show the lines and it only shows your stats until the word kill and it cuts from there
Код:
CMD:stats(playerid, params[])
{
	if(PlayerInfo[playerid][pAlive] > 0)
	{
		new result[128];
		new score = GetPlayerScore(playerid);
		new cash = GetPlayerMoney(playerid);
		new admin = PlayerInfo[playerid][pAdmin];
		new kills = PlayerInfo[playerid][pKills];
		new deaths = PlayerInfo[playerid][pDeaths];
		format(result,sizeof(result), "{F71414}Score: {FFFFFF}[%d]{F01AAC} | {F71414}Money: {FFFFFF}[%d]{F01AAC} | {F71414}Admin level: {FFFFFF}[%d]{F01AAC} | {F71414}Kills: {FFFFFF}[%d]{F01AAC} | {F71414}Deaths: {FFFFFF}[%d]", score, cash, admin, kills, deaths);
		SendClientMessage(playerid, -1, "{FF0808}-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
 		SendClientMessage(playerid, -1, result);
 		SendClientMessage(playerid, -1, "{FF0808}-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
	}
	else
	{
 		SendClientMessage(playerid, -1, "{8F8F8F}You have to be alive to do this.");
	}
    return 1;
}



Re: SendClientMessage cuts after a few words - admantis - 08.06.2013

The string where you're storing the text is too small (the array 128 cells, yet the whole string is 186 characters). Split it in different lines.


Re: SendClientMessage cuts after a few words - Sellize - 08.06.2013

Cool but why doesnt it show the red lines i made?


Re: SendClientMessage cuts after a few words - admantis - 08.06.2013

Because they're over 128 characters long, trim it.


Re: SendClientMessage cuts after a few words - gtakillerIV - 08.06.2013

Cause they're alot of characters.

EDIT: Guy above me posted before me.