PHP Code:
/*
* Generates all 8 points of a zone given just 2 of its points
*/
CreateZonePoints(Float:point[8][3])
{
for(new i=1; i<7; i++)
{
for(new j=0; j<3; j++)
{
point[i][j] = point[((i >> (2-j)) & 1) * 7][j];
}
}
}
If I have a global array like Float:g_fZone[8][3] where g_fZone[0] = {0.0, 0.0, 0.0} and g_fZone[7] = {1.0, 1.0, 1.0}, the g_fZone array can be passed in the CreateZonePoints parameter and every point from 1-6 in the g_fZone array will be given their correct coordinates just by doing the function CreateZonePoints(g_fZone);