getting middle of Min/Max X, Min/Max Y
#1

My variables are good, but I can not seem to see the checkpoint/text label on the specified area.
Код:
LoadZones()
{
	for(new i=0; i < sizeof(Zones[]); i++)
	{
		Zones[i][ID] = GangZoneCreate(Zones[i][MinX], Zones[i][MinY], Zones[i][MaxX], Zones[i][MaxY]);
	        Create3DTextLabel(Zones[i][Name], 0xFFFFFFFF, (Zones[i][MinX] + Zones[i][MaxX]) / 2, (Zones[i][MinY] + Zones[i][MaxY]) / 2, Zones[i][Z], 100.0, 0, 0);
		CreateDynamicCP((Zones[i][MinX] + Zones[i][MaxX]) / 2, (Zones[i][MinY] + Zones[i][MaxY]) / 2, Zones[i][Z], 20, 0, 0, -1, 100.0, -1);
	}
	print("Zones loaded.");
	return 1;
}
Reply
#2

For the checkpoints, only one checkpoint can be seen at a time. So if there are more than one, the players will only see one of them.

For the text labels, are you in virtual world 0 when you are looking for them?

On a side note, stop using integer division on floats. Everywhere you are doing "/ 2" there you are dividing a float by an integer. The compiler outputs that as "/ float(2)" instead of "/ 2.0". This makes the assembly code longer than it needs to be, which results in less optimized code. So for now on just add the '.0' to the float divisions. This isn't a fix for your issue, this is just to optimize your scripts.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)