SA-MP Forums Archive
Help! [warning 213: tag mismatch] - 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: Help! [warning 213: tag mismatch] (/showthread.php?tid=540776)



Help! [warning 213: tag mismatch] - VivianKris - 07.10.2014

Код:
new 	Float:Pos[4] = {-7.3049, -9.9316, -12.6804, -15.4929};
	for(new i=0;i<sizeof(Pos);i++) {
		3DText[i] = Create3DTextEx("sth", 2316.6213, Pos[i], 26.7422);//tag mismatch
	}
Код:
stock Create3DTextEx(_string[], Float:_X, Float:_Y, Float:_Z) {
	new _ex_string[128];	
	format(_ex_string, sizeof(_ex_string), "%s\nHum...", _string);
	Create3DTextLabel(_ex_string, COLOR_YELLOW, _X, _Y, (_Z+0.5), 25.0, 0, 1);
}
Anyone know how? thank you.


Re: Help! [warning 213: tag mismatch] - Pottus - 07.10.2014

Well you can't have variable names starting with a number.
You also didn't return a reference of the 3DText that was created.


Re: Help! [warning 213: tag mismatch] - VivianKris - 07.10.2014

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Well you can't have variable names starting with a number.
You also didn't return a reference of the 3DText that was created.
Thank you, fix it.
But how can I destory it without a reference?


Re: Help! [warning 213: tag mismatch] - Pottus - 07.10.2014

To be honest with you there is absolutely no reason why you should need a function like Create3DTextEx() to do this in the first place I would do it like this.

You can test this code here: http://slice-vps.nl:7070/
pawn Код:
#include <a_samp>

#define         MY_TEXT_SIZE            4
#define         COLOR_YELLOW            0xFFFF00FF

new Text3D:MyText[MY_TEXT_SIZE];
stock const Float:Pos[MY_TEXT_SIZE] = {-7.3049, -9.9316, -12.6804, -15.4929};

main()
{
    for(new i=0;i<MY_TEXT_SIZE;i++) {
        MyText[i] = Create3DTextLabel("sth\nHum...", COLOR_YELLOW, 2316.6213, Pos[i], 26.7422+0.5, 25.0, 0, 1);
        printf("%i", _:MyText[i]);
    }
}