SA-MP Forums Archive
Guys can you please help - 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: Guys can you please help (/showthread.php?tid=650159)



Guys can you please help - Akeem - 21.02.2018

gates.pwn(1062) : error 075: input line too long (after substitutions)
gates.pwn(1063) : error 037: invalid string (possibly non-terminated string)
gates.pwn(1063) : error 017: undefined symbol "UPDATE"
gates.pwn(1063) : error 029: invalid expression, assumed zero
gates.pwn(1063) : fatal error 107: too many error messages on one line

Код:
stock SaveGate(id) {

	mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "UPDATE `gates` SET \
		`HID`=%d, \
		`Speed`=%f, \
		`Range`=%f, \
		`Model`=%d, \
		`VW`=%d, \
		`Int`=%d, \
		`Pass`='%e', \
		`PosX`=%f, \
		`PosY`=%f, \
		`PosZ`=%f, \
		`RotX`=%f, \
		`RotY`=%f, \
		`RotZ`=%f, \
		`PosXM`=%f, \
		`PosYM`=%f, \
		`PosZM`=%f, \
		`RotXM`=%f, \
		`RotYM`=%f, \
		`RotZM`=%f, \
		`Allegiance`=%d, \
		`GroupType`=%d, \
		`GroupID`=%d, \
		`RenderHQ`=%d, \
		`Timer`=%d, \
		`Automate`=%d, \
		`Locked`=%d, \
		`TIndex`=%d, \
		`TModel`=%d, \
		`TTXD`='%e', \
		`TTexture`='%e', \
		`TColor`=%d, \       the first errors is in this line
		`Facility`=%d \        and the others in this one
		WHERE `ID` = %d",
		GateInfo[id][gHID],
		GateInfo[id][gSpeed],
		GateInfo[id][gRange],
		GateInfo[id][gModel],
		GateInfo[id][gVW],
		GateInfo[id][gInt],
		GateInfo[id][gPass],
		GateInfo[id][gPosX],
		GateInfo[id][gPosY],
		GateInfo[id][gPosZ],
		GateInfo[id][gRotX],
		GateInfo[id][gRotY],
		GateInfo[id][gRotZ],
		GateInfo[id][gPosXM],
		GateInfo[id][gPosYM],
		GateInfo[id][gPosZM],
		GateInfo[id][gRotXM],
		GateInfo[id][gRotYM],
		GateInfo[id][gRotZM],
		GateInfo[id][gAllegiance],
		GateInfo[id][gGroupType],
		GateInfo[id][gGroupID],
		GateInfo[id][gRenderHQ],
		GateInfo[id][gTimer],
		GateInfo[id][gAutomate],
		GateInfo[id][gLocked],
		GateInfo[id][gTIndex],
		GateInfo[id][gTModel],
		GateInfo[id][gTTXD],
		GateInfo[id][gTTexture],
		GateInfo[id][gTColor],
		GateInfo[id][gFacility],
		id+1
	);
	mysql_tquery(MainPipeline, szMiscArray, "OnQueryFinish", "i", SENDDATA_THREAD);
	return 0;
}



Re: Guys can you please help - NaS - 22.02.2018

There's a maximum line length of 511 characters. The \ will visually split it but the actual line is still as long as the whole string.

If you want to circumvent it, split the string into parts and join it later (strcat or format).

Or, get ZeeX' Compiler which allows a line length of 4096 characters:

https://github.com/pawn-lang/compiler/releases

Alongside some other fixes and new features.


Re: Guys can you please help - Akeem - 22.02.2018

that pawno isn't working, is there a way to edit that line into two lines?


Re: Guys can you please help - NaS - 22.02.2018

Quote:
Originally Posted by Akeem
Посмотреть сообщение
that pawno isn't working, is there a way to edit that line into two lines?
Why isn't it working? Any errors? If it crashes while compiling you probably have an unhandled error in your script.

You need a buffer array to temporarily assemble the string.

Eg.

Код:
new text[500];
strcat(text, "Text 1 ...");
strcat(text, "Text 2 ...");
This will become "Text 1 ...Text 2 ...".

If you need to format the texts (like in this case) you should do it like this:

Код:
new text[500];
format(text, sizeof(text), "Text 1 %d %f", var1, var2);
format(text, sizeof(text), "%sText2 %d %f", text, var3, var4);
In the second line it will format the previous text into the beginning of the string.


Re: Guys can you please help - Akeem - 22.02.2018

Quote:
Originally Posted by Akeem
Посмотреть сообщение
that pawno isn't working, is there a way to edit that line into two lines?
the pawnc isn't opening.


Re: Guys can you please help - NaS - 22.02.2018

Quote:
Originally Posted by Akeem
Посмотреть сообщение
the pawnc isn't opening.
You need to copy the files into your pawno folder.

This isn't PAWNO (the editor). It's the compiler which is ran by PAWNO.exe when you compile.


Re: Guys can you please help - Akeem - 22.02.2018

thanks man, i am working out some other bugs. May still need some help tho lol