SA-MP Forums Archive
Streamer, array, polygons. - 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: Streamer, array, polygons. (/showthread.php?tid=553691)



Streamer, array, polygons. - SWET - 31.12.2014

Hi. I have a problem with a zone, I would like to save postions on the server and save them to a dynamic array to use them as a function of CreateDynamicPolygon.
Код:
cmd(sel4, playerid, params[])
{

	new str2[256], iss;
	format(str2, sizeof(str2), "%f, %f %f, %f %f, %f %f, %f", PlayerInfo[playerid][pSelPos][0], PlayerInfo[playerid][pSelPos][1], PlayerInfo[playerid][pSelPos][2], PlayerInfo[playerid][pSelPos][3], PlayerInfo[playerid][pSelPos][4], PlayerInfo[playerid][pSelPos][5], PlayerInfo[playerid][pSelPos][6], PlayerInfo[playerid][pSelPos][7]);
	PlayerInfo[playerid][pSelSrng] = str2;
	printf("%s", PlayerInfo[playerid][pSelSrng]);
	iss = CreateDynamicPolygon(PlayerInfo[playerid][pSelSrng], -100.0, 100.0);
	new ipls = Streamer_CountItems(STREAMER_TYPE_AREA), ipl = GetDynamicPolygonPoints(iss, str2, sizeof(str2));
	//mysql_free_result();
	
		printf("areas - %d, %d points", ipls, ipl);
	
	return 1;
}
This code creates a zone but that's zone does not work. I think that the positions of the array are read by the wrong features. How can I do to make it work? Help me ...


Re: Streamer, array, polygons. - Cameltoe - 31.12.2014

Код:
cmd(sel4, playerid, params[])
{

	new str2[256], iss;
	format(str2, sizeof(str2), "%f, %f %f, %f %f, %f %f, %f", PlayerInfo[playerid][pSelPos][0], PlayerInfo[playerid][pSelPos][1], PlayerInfo[playerid][pSelPos][2], PlayerInfo[playerid][pSelPos][3], PlayerInfo[playerid][pSelPos][4], PlayerInfo[playerid][pSelPos][5], PlayerInfo[playerid][pSelPos][6], PlayerInfo[playerid][pSelPos][7]); // Change str2 to PlayerInfo[playerid][pSelSrng], if i did understand correctly
	PlayerInfo[playerid][pSelSrng] = str2;
	printf("%s", PlayerInfo[playerid][pSelSrng]);
	iss = CreateDynamicPolygon(PlayerInfo[playerid][pSelSrng], -100.0, 100.0);
	new ipls = Streamer_CountItems(STREAMER_TYPE_AREA), ipl = GetDynamicPolygonPoints(iss, str2, sizeof(str2));
	//mysql_free_result();
	
		printf("areas - %d, %d points", ipls, ipl);
	
	return 1;
}
Look at the comment to the right of format.


Re: Streamer, array, polygons. - SWET - 31.12.2014

I want to save pos player and use them in CreateDynamicPolygon (points [] ....
We all do it using an array for example
Код:
new Float:Points[12] =
    {2305.5264, 1783.7133, 2305.5264, 1882.6989, 2167.5994, 1882.6989, 2167.5994, 1859.0988, 2128.2075, 1783.7133, 2305.5264, 1783.7133};
    AdminHQArea = CreateDynamicPolygon(Points, 5.0, 15.0, sizeof(Points));
. I want to set Polygons on the server, not in the way.