Streamer - Check if area exists (by cords (minx, miny, maxx, maxy), not by areaID
#1

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.
Reply
#2

PHP код:
stock IsPointInArea(Float:x,Float:y,Float:z,Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz){
    if((
>= minx && <= maxx) && (>= miny && <= maxy) && (>= minz && <= 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((
>= minx && <= maxx) && (>= miny && <= maxy) && (>= minz && <= maxz) && (vw1 == vw2) && (int1 == int2)) return true;
    return 
false;

Do you want to check area A is in area B?
Reply
#3

Uh, for example I have created area A, and if player creates new area B in area A then he will get returned.
Reply
#4

Can't you just use IsPlayerInAnyDynamicArea or IsPointInAnyDynamicArea?
Reply
#5

Yeah but player still can create area outside of the existing area and make it bounds through this area.

Reply
#6

Pretty easy to figure out.
http://stackoverflow.com/questions/3...lap-each-other
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)