SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/03/2017, 01:54 PM   #1
AnoTek
Big Clucker
 
Join Date: Mar 2014
Posts: 67
Reputation: 0
Default error 037: invalid string (possibly non-terminated string)

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
AnoTek is offline   Reply With Quote
Old 13/03/2017, 01:58 PM   #2
Flamehaze7
Big Clucker
 
Flamehaze7's Avatar
 
Join Date: Feb 2016
Posts: 133
Reputation: 10
Default Re: error 037: invalid string (possibly non-terminated string)

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"
Flamehaze7 is offline   Reply With Quote
Old 13/03/2017, 02:04 PM   #3
AnoTek
Big Clucker
 
Join Date: Mar 2014
Posts: 67
Reputation: 0
Default Re: error 037: invalid string (possibly non-terminated string)

error 075: input line too long (after substitutions)
AnoTek is offline   Reply With Quote
Old 13/03/2017, 02:07 PM   #4
Toroi
Gangsta
 
Toroi's Avatar
 
Join Date: Feb 2017
Location: Venezuela
Posts: 698
Reputation: 146
Default Re: error 037: invalid string (possibly non-terminated string)

Create a string and use strcat for matters like this one

http://wiki.sa-mp.com/wiki/Strcat
Toroi is offline   Reply With Quote
Old 13/03/2017, 02:08 PM   #5
Flamehaze7
Big Clucker
 
Flamehaze7's Avatar
 
Join Date: Feb 2016
Posts: 133
Reputation: 10
Default Re: error 037: invalid string (possibly non-terminated string)

Quote:
Originally Posted by AnoTek View Post
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","");
Flamehaze7 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error 037: invalid string (possibly non-terminated string) Ghost112397 Scripting Help 2 27/11/2015 05:05 PM
[Ajuda] error 037: invalid string (possibly non-terminated string) Tootamorine Português/Portuguese 5 01/03/2015 08:00 PM
error 037: invalid string (possibly non-terminated string) ridhoswasta Scripting Help 2 19/06/2014 04:34 PM
error 037: invalid string (possibly non-terminated string) SnG.Scot_MisCuDI Scripting Help 2 19/06/2012 02:14 AM


All times are GMT. The time now is 11:58 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.