gangzone
#1

Hey,

i just created a system where user are able to create a gang.
Depending on the amount of the members the zone will change it size.

( 1 Member -> small zone -> 5 Members -> big Zone )

Now the problem:
How can i detect if a zone is in another zone?


As you can see, Zone 1 goes into Zone 2 -> That shouldn't be allowed.

Any idea, how that could work?

( Sry 4 english^^ )
Reply
#2

Just created this function for you:
You only have to enter the coordinates of the 2 gangzones. The parameters are in the same order as in GangZoneCreate so you can just copy/paste them.

It returns '1' if the zones do overlap and '0' if the zones do not overlap.

pawn Код:
stock DoZonesOverlap(Float:aminx, Float:aminy, Float:amaxx, Float:amaxy, Float:bminx, Float:bminy, Float:bmaxx, Float:bmaxy)
{
    if(!(aminx > bmaxx) && !(amaxx < bminx) && !(amaxy < bminy) && !(aminy > bmaxy)) return 1;
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)