[Help] Spread Objects Evenly (Math...)
#1

Hi everyone.

So, problem is this. I want to create 10 000 (streamed) objects, but I want to spread them evenly on the whole world.

Size of world is 6000x6000 (36000000І meters) [Starts from -3000 to 3000], what's 1 object per 3600І area (60x60).

Only problem is that I can't find good formula to do that...

edit: i only need x and y, not z.

If anyone know's some simple/hard way, please explain (You don't have to write code).

Thanks in advance.
Reply
#2

Kinda solved it. (Just need to expand all over the map.)

Код:
stock SpawnObjects()
{
	SendRconCommand("password 854agd15");
	new Float:x,Float:y;
	for(new i=-60; i<60;i++)
	{
	    x=i*60;
	    for(new b=-60; b<60;b++)
	    {
	        y=b*60;
	        new Float:zpos;
	        printf("doing %d",b);
    		GetPointZPos(x,y,zpos);
	        CreateDynamicObject(3279,x,y,zpos,0,0,0);
	        
	    }
	}
	print("DONE");
	SendRconCommand("password 0");
	return 1;
}
Reply
#3

pawn Код:
for(new Float:x = -3000.0; x < 3000.0; x += 100.0) // x
{
    for(new Float:y = -3000.0; y < 3000.0; y += 100.0) //y
    {
        CreateDynamicObject(3279, x, y, zpos, 0, 0, 0);
    }
}
That's it, basically.
Reply
#4

Thank you Vince, works perfectly.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)