gangzone - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: gangzone (
/showthread.php?tid=558860)
gangzone -
yellow - 19.01.2015
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^^ )
Re: gangzone -
Schneider - 19.01.2015
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;
}