Help here please
#3

PHP код:
stock GetXYGridPos(Float:xsFloat:ys, &Float:x, &Float:yFloat:AngleIndex Columns,  Float:xOffsetFloat:yOffset)
{
//the values saved in x and y are the values saved into the variable you use in the function call param 3 and 4.
//the "Index" is defining which of the positions in the grid you want to calculate and get returned. 
//if we had two columns this would mean: 0 = front left, 1 = front right, 2 = row two left, 3 = row two right.. and so on.
 
    
new Index%Columns//modulus
    
new floatround(Indexfloatround_floor) / Columns//normal division, rounding to nearest even number below the value.
    
Calc_Point(xsysResultxResultyxOffsetyOffsetAngle ij);
    
Resultx//x Position
    
Resulty;//Y position
    

You insert all the params. XY and R are centered. Index stands for the vehicle number you want to spawn. Columns stand for the amount of side-by-side lines. Offsets are individual distances between vehicles.

Let's say you want to make a boat race.
PHP код:
new pos[2];
for(new 
i;i<10;i++) //spawns 9 boats
{
GetXYGridPos(2000.0,2000.0pos[0], pos[1], i0,  5.010.0);
CreateVehicle(490,pos[0], pos[1],1.0,0.0,0,0,1000);

Reply


Messages In This Thread
Help here please - by OliverK - 13.05.2015, 20:48
Re: Help here please - by OliverK - 27.05.2015, 06:44
Re: Help here please - by shadowdog - 27.05.2015, 09:09
Re: Help here please - by OliverK - 28.05.2015, 15:52
Re: Help here please - by OliverK - 28.05.2015, 18:29
Re: Help here please - by OliverK - 28.05.2015, 22:09

Forum Jump:


Users browsing this thread: 2 Guest(s)