Streamer - Check if area exists (by cords (minx, miny, maxx, maxy), not by areaID -
Riwerry - 08.12.2015
Hello, I have script that gets min and max XY to variables and then I create area with CreateDynamicRectangle streamer function. And I want to make condition if player create new area, coords will get stored to my variables minx, miny, maxx, maxy and I want to check if the NEW area isn't located in existing area. It's hard for me to explain, thanks.
Re: Streamer - Check if area exists (by cords (minx, miny, maxx, maxy), not by areaID -
AbyssMorgan - 08.12.2015
PHP код:
stock IsPointInArea(Float:x,Float:y,Float:z,Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz){
if((x >= minx && x <= maxx) && (y >= miny && y <= maxy) && (z >= minz && z <= maxz)) return true;
return false;
}
stock IsPointInAreaEx(Float:x,Float:y,Float:z,Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz,vw1 = -1,int1 = -1,vw2 = -1,int2 = -1){
if((x >= minx && x <= maxx) && (y >= miny && y <= maxy) && (z >= minz && z <= maxz) && (vw1 == vw2) && (int1 == int2)) return true;
return false;
}
Do you want to check area A is in area B?
Re: Streamer - Check if area exists (by cords (minx, miny, maxx, maxy), not by areaID -
Riwerry - 08.12.2015
Uh, for example I have created area A, and if player creates new area B in area A then he will get returned.
Re: Streamer - Check if area exists (by cords (minx, miny, maxx, maxy), not by areaID -
Vince - 08.12.2015
Can't you just use IsPlayerInAnyDynamicArea or IsPointInAnyDynamicArea?
Re: Streamer - Check if area exists (by cords (minx, miny, maxx, maxy), not by areaID -
Riwerry - 08.12.2015
Yeah but player still can create area outside of the existing area and make it bounds through this area.
Re: Streamer - Check if area exists (by cords (minx, miny, maxx, maxy), not by areaID -
Pottus - 09.12.2015
Pretty easy to figure out.
http://stackoverflow.com/questions/3...lap-each-other