SA-MP Forums Archive
Problem error - 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: Problem error (/showthread.php?tid=274134)



Problem error - NeyMar96 - 04.08.2011

I,have this error:
PHP код:
error 075input line too long (after substitutions
This code gives the error:
PHP код:
format(stringsizeof(string),"{00C0FF}%s(%d) {FFFFFF}- дсиаис щмк\n\n\r\r {00FF00}Level: {FF0000}%d  {00FF00}Kills: {FF0000}%d {00FF00}Points: {FF0000}%d\n\n\r\r {00FF00}Health: {FF0000}%.1f {00FF00}Armour: {FF0000}%.1f {00FF00}Money: {FF0000}%d\n\n\r\r {00FF00}Game Time: %d:%d:%d",GetName(playerid),playerid,PlayerInfo[playerid][Level],PlayerInfo[playerid][Kills],PlayerInfo[playerid][Points],health,Armour,GetPlayerMoneyEx(playerid),GetPVarInt(playerid,"HoursPlayed"),GetPVarInt(playerid,"MinutesPlayed"),GetPVarInt(playerid,"SecondsPlayed"));
ShowPlayerDialog(playerid,11,DIALOG_STYLE_MSGBOX,"{7FFF00}Stats System:",string,"ъцевд йщрд","ца"); 



Re: Problem error - [HiC]TheKiller - 04.08.2011

The format line is too long, split it up into multiple lines.


Re: Problem error - NeyMar96 - 04.08.2011

How to do it?


Re: Problem error - Scarred - 04.08.2011

Using strcat.

Here's an example from my statistics command off an old gamemode of mine:

pawn Код:
format(string, sizeof(string), "{0FA0D1}Name: {FFFFFF}%s (ID: %d)\n{0FA0D1}VIP Rank: {FFFFFF}%s (%d)\n{0FA0D1}Money: {FFFFFF}$%d", pName(playerid), playerid, VIPName, PVar[playerid][VIPLevel], PVar[playerid][pMoney]);
        strcat(holder, string, sizeof(holder));
//Format another string here, and then use strcat(holder, string, sizeof(holder) again.
        ShowPlayerDialog(playerid, STATS, DIALOG_STYLE_MSGBOX, "{0FA0D1}Los Santos Turf War: Statistics", holder, "Hide", "");



Re: Problem error - MadeMan - 04.08.2011

pawn Код:
format(string, sizeof(string),"{00C0FF}%s(%d) {FFFFFF}- дсиаис щмк\n\n\r\r {00FF00}Level: {FF0000}%d  {00FF00}Kills: {FF0000}%d {00FF00}Points: {FF0000}%d\n\n\r\r {00FF00}Health: {FF0000}%.1f {00FF00}Armour: {FF0000}%.1f {00FF00}Money: {FF0000}%d\n\n\r\r {00FF00}Game Time: %d:%d:%d",
    GetName(playerid),playerid,PlayerInfo[playerid][Level],PlayerInfo[playerid][Kills],PlayerInfo[playerid][Points],health,Armour,GetPlayerMoneyEx(playerid),GetPVarInt(playerid,"HoursPlayed"),GetPVarInt(playerid,"MinutesPlayed"),GetPVarInt(playerid,"SecondsPlayed"));