All pastes #141425 Raw Edit

lelzcrap

public c v1 · immutable
#141425 ·published 2006-08-20 23:39 UTC
rendered paste body
//the function:public rcsAdd(name[5], val[NUM_VALUES], Float:pos[2][3], ratio[2], Float:angle, Float:cps[][3]){	rcsNumber++;	new i = rcsNumber;	format(rcsNames[i], 256, name);	for(new j; j < NUM_VALUES; j++)	{	    rcsValues[i][j] = val[j];	}		new Float:yy, Float:xx;	xx = (pos[1][0] - pos[0][0]) / (ratio[0] - 1);	yy = (pos[1][1] - pos[0][1]) / (ratio[1] - 1);	new posi;	for(new y; y < ratio[0]; y++)	{	    for(new x; x < ratio[1]; x++)	    {	    	rcsStartingPositions[i][posi][0] = pos[0][0]; //x		    rcsStartingPositions[i][posi][1] = pos[0][1]; //y		    printf("X: %d Y: %d", pos[0][0], pos[0][1]);		    rcsStartingPositions[i][posi][2] = pos[0][2]; //z		    rcsStartingPositions[i][posi][3] = angle;     //a		    pos[0][0] += xx;		    posi++;	    }	    pos[0][0] = rcsStartingPositions[i][0][0];		pos[0][1] += yy;	}	printf("Positions:%d  posi: %d",rcsValues[i][VPOS],posi);	rcsValues[i][VPOS] = posi;		for(new j; j < rcsValues[i][VCPS]; j++)	{	    rcsCheckpoints[i][j][0] = cps[j][0];	    rcsCheckpoints[i][j][1] = cps[j][1];	    rcsCheckpoints[i][j][2] = cps[j][2];	}	return 1;}//trying to call the function (I get "must be a constant expression; assumed zero" on the 3 first lines)	rcsAdd("wtf", {21, DEF_POSITIONS, 1200 , DEF_DEF_REC, DEF_MIN_REC},	{		{2032.3701,838.9333,6.46}, //  infernus race line 1		{2047.2158,856.7128,6.46}  // racepos 8	}, {8,3}, 90.0,    {// rich areas race, and back through the strip		{1977.554809, 841.672668, 6.711115}, // 1		{1328.645507, 863.969604, 6.773437},   // 2		{1217.657836, 1439.213378, 6.703125},   // 3		{1272.176757, 1744.201171, 9.201466},   // 4		{1336.707397, 1872.352783, 10.671875},   // 5		{1687.566406, 1872.801147, 10.671875},   // 6		{1706.926879, 2050.911376, 10.838390},   // 7		{1702.367431, 2167.361816, 10.749747},   // 8		{1568.678588, 2178.912109, 10.830413},   // 9		{1563.292602, 2385.261718, 10.671875},   // 10		{1481.375976, 2401.825439, 10.871691},   // 11		{1480.980834, 2582.852539, 10.831880},   // 12		{1777.307250, 2616.166992, 10.821163},   // 13		{1960.041503, 2593.615478, 10.812578},   // 14		{2026.151977, 2590.756591, 12.655401},   // 15		{2027.303100, 2467.884277, 10.671875},   // 16		{2070.885986, 2312.940429, 10.671875},   // 17		{2127.954589, 2119.210937, 10.671875},   // 18 strip		{2050.433837, 1704.415405, 10.671875},   // 19 strip 2		{2047.629882, 1277.709106, 10.671875},   // 20 strip 3		{2047.830322, 844.751403, 6.704136}   // 21 finish line	});