Check if player is inside Marker and notify user.

Choppra

New Member
I have a script that kicks off about 35minutes in. It checks to see if a player is inside the marker. I am testing this for a script I am working on but it keeps telling me that I am NOT in the zone. In theory, shouldn't this work?

Code:
private["_FinalZoneCenter","_startingzone","_mar_name","_inzone","_pos","_mark","_loc"];

sleep 5;[nil,nil,rTitleText,"Safe Zone is Marked!","PLAIN",10] call RE;

_FinalZoneCenter=[9114.96,5402.52,0];
_startingzone =3000;

sleep 10;while{true}do{
_mar_name = createMarker ["ZoneMarker",_FinalZoneCenter];"ZoneMarker" setMarkerShape "ELLIPSE";"ZoneMarker" setMarkerBrush "GRID";"ZoneMarker" setMarkerColor "ColorBlue";"ZoneMarker" setMarkerSize [_startingzone,_startingzone];

_pos = getPOS Player;
_mark ="ZoneMarker"
_loc = createLocation (["Name", markerPos _mark]+(markerSize _mark));

if(_pos in _loc)then{

[nil,nil,rTitleText,"You are DEFINATELY IN the ZONE","PLAIN",10] call RE;Sleep5;
}else{
[nil,nil,rTitleText,"You are NOT IN the ZONE","PLAIN",10] call RE;
};
deleteLocation _loc;
};
 

FallingSheep

OpenDayZ Lord!
try this
Code:
private["_FinalZoneCenter","_startingzone","_mar_name","_inzone","_pos","_mark","_loc"];

sleep 5;[nil,nil,rTitleText,"Safe Zone is Marked!","PLAIN",10] call RE;

_FinalZoneCenter=[9114.96,5402.52,0];
_startingzone =3000;

sleep 10;
while{true}do{
    _mar_name = createMarker ["ZoneMarker",_FinalZoneCenter];
    "ZoneMarker" setMarkerShape "ELLIPSE";
    "ZoneMarker" setMarkerBrush "GRID";
    "ZoneMarker" setMarkerColor "ColorBlue";
    "ZoneMarker" setMarkerSize [_startingzone,_startingzone];

    _pos = player distance _mar_name;

    if(_pos <= 0)then{
        [nil,nil,rTitleText,"You are DEFINATELY IN the ZONE","PLAIN",10] call RE;Sleep5;
    }else{
        [nil,nil,rTitleText,"You are NOT IN the ZONE","PLAIN",10] call RE;
    };
};

it checks players distance to the marker,
NOT TESTED MAY NOT EVEN WORK :p

does the marker move?

if its always static you can set iup much easier, let me know if its static and ill send you the code for it
 

SchwEde

OpenDayZ Rockstar!
you guys forgot to remove the marker, otherwise it would spam a bit :)

also distance is never < 0 , so better would be to set it
Code:
if(_pos < 5)then{

this way you have a bit of safezone around the center
 
Top