02.02.2013, 21:54
Basically, I'm trying to make it so that when a gang-zone is created, it also goes through this array to determine if any of the points are in the gang-zone. If they are, it's supposed to make a dynamic check-point at the location (that's specified in the array).
I can't figure out how to do this, though. Can anyone with some experience in arrays shed a bit of light?
This is basically what I have so far, the array is actually much larger, but for the sake of not posting a ton of crap, I shortened it...
I can't figure out how to do this, though. Can anyone with some experience in arrays shed a bit of light?
This is basically what I have so far, the array is actually much larger, but for the sake of not posting a ton of crap, I shortened it...
pawn Код:
static const trashArray[]
{
{2657.1614,716.5063,10.8203},
{2616.2979,716.4762,10.8203},
{2578.0164,723.9280,10.8203},
{2537.3118,716.3985,10.8203},
{2879.6377,944.9102,10.7500},
{2863.4600,945.1839,10.7500},
{2765.0286,1436.8666,10.5908},
{2761.7808,1443.0544,10.7605}
};
for(new z = 0; z < sizeof(trashArray); z++)
{
if(IsPointInGangZone(trashArray[z][0], trashArray[z][1], gSAZones[i][SAZONE_AREA][0], gSAZones[i][SAZONE_AREA][1], gSAZones[i][SAZONE_AREA][3], gSAZones[i][SAZONE_AREA][4]))
{
CreateDynamicCP(trashArray[z][0], trashArray[z][1], trashArray[z][2], 1.0);
}
else printf("%f, %f, %f -- NOT FOUND IN ZONE", trashArray[z][0], trashArray[z][1], trashArray[z][2]);
}
stock IsPointInGangZone(Float:fPosX, Float:fPosY, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
if( fPosX >= minx && fPosX <= maxx && fPosY >= miny && fPosY <= maxy ) return 1;
return 0;
}