Quote:
Originally Posted by Ex3cuTioN
That's soo nice, but i really don't understand nothing from the .sma
PHP Code:
InsideZone( origin[] )
{
new i, j, nInsideIdx = (-1)
new bool:bInsidePoint[3] = false
for( i = 0; i < g_nNumLoadedZones*2; i+=2 )
{
for( j = 0; j < 3; j++ )
{
if( g_nZonePoints[i][j] < g_nZonePoints[i+1][j] )
{
if( (g_nZonePoints[i][j]-1) <= origin[j] <= (g_nZonePoints[i+1][j]+1) )
bInsidePoint[j] = true
}else
{
if( (g_nZonePoints[i+1][j]-1) <= origin[j] <= (g_nZonePoints[i][j]+1) )
bInsidePoint[j] = true
}
}
if( bInsidePoint[0] && bInsidePoint[1] && bInsidePoint[2] )
{
nInsideIdx = (i / 2)
break
}else bInsidePoint[0] = bInsidePoint[1] = bInsidePoint[2] = false
}
return nInsideIdx
}
|
If you retrieve the origins of the beginning of the tunnel, you can use that:
PHP Code:
if( InsideOrigin( Origin ) )
{
//whatever
}
__________________