error 037: invalid string (possibly non-terminated string) - 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: error 037: invalid string (possibly non-terminated string) (
/showthread.php?tid=630371)
error 037: invalid string (possibly non-terminated string) -
AnoTek - 13.03.2017
This is the command where is the error:
Code:
CMD:hqs(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi.");
if(IsPlayerConnected(playerid))
{
if(CP[playerid] != 0) return SendClientMessage(playerid, COLOR_GOLD, "Ai deja un punct rosu activ. Foloseste comanda '/killcp' pentru a renunta la el.");
{
ShowPlayerDialog(playerid, dGPS+3, DIALOG_STYLE_TABLIST_HEADERS, "HQ-uri", "Factiune\tTip\nLos Santos Police Departament\t{D2B48C}Departament\nSan Fierro Police Departament\t{D2B48C}Departament
\nLas Venturas Police Departament\t{D2B48C}Departament\nFederal Bureau of Investigation\t{FFA500}Departament\nNational Guard\t{FFA500}Departament\nMayor\t{FFA500}Mixt Faction\nParamedic\t{FFFFFF}Peaceful Faction
\nTow Truck Company\t{FFFFFF}Peaceful Faction\nNews Reporters\t{FFFFFF}Peaceful Faction\nHitman Agency\t{FFA500}Mixt Faction\nLos Santos School Instructors\t{D2B48C}Peaceful Faction\nLos Santos Taxi\t{FFFFFF}Peaceful Faction
\nSan Fierro School Instructors\t{FFFFFF}Peaceful Faction\nSan Fierro Taxi\t{FFFFFF}Peaceful Faction\nLas Venturas School Instructors\t{FFFFFF}Peaceful Faction\nLas Venturas Taxi\t{FFFFFF}Peaceful Faction\nGrove Street\t{FFFFFF}Gang
\nThe Ballas\t{FFFFFF}Gang\nLos Santos Vagos\t{FFFFFF}Gang\n69 Pier Mobs\t{FFFFFF}Gang\nSan Fierro Rifa\t{FFFFFF}Gang\nDa Nang Boys\t{FFFFFF}Gang\nThe Russian Bratva\t{FFFFFF}Gang\nYakuza\t{FFFFFF}Gang\nSindacco Family", "OK", "Cancel");
}
}
return 1;
}
How can i solve this
Re: error 037: invalid string (possibly non-terminated string) -
Flamehaze7 - 13.03.2017
Just do it in 1 line, don't create a new line for each \n you put, do it like this
Code:
"Hello\nthis text will be showed under Hello"
Re: error 037: invalid string (possibly non-terminated string) -
AnoTek - 13.03.2017
error 075: input line too long (after substitutions)
Re: error 037: invalid string (possibly non-terminated string) -
Toroi - 13.03.2017
Create a string and use strcat for matters like this one
https://sampwiki.blast.hk/wiki/Strcat
Re: error 037: invalid string (possibly non-terminated string) -
Flamehaze7 - 13.03.2017
Quote:
Originally Posted by AnoTek
error 075: input line too long (after substitutions)
|
Use strcat.
Example
Code:
stock HelpText
{
new HelpTextz[1024];
HelpTextz[0]='\0';
strcat(HelpTextz,"Hello this can be much longer");
strcat(HelpTextz,"You can write everything you want");
return HelpTextz;
}
In your dialog
Code:
ShowPlayerDialog(playerid, dGPS+3, DIALOG_STYLE_TABLIST_HEADERS, "HQ-uri",HelpText(),"Ok","");