Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Manatee, you could always make a new sqm in the 3d editor, place 1 building or vehicle, copy it's coords from in the sqm file, add it to the database with that php script, and then see if they are the same or not.
I know the feeling, just dont stress hard enough to get bald... LOL.Not that good, I'm afraid.
I don't have enough time on my hands lately.
// available and supported maps for the converted.
// $map_name = array("..."Full Map Name"...");
// $map_id = array("..."simple_name"...");
$map_names = array("Celle","Chernarus","Lingor Island");
$map_id = array("celle","chernarus","lingor_island");
// map actual dimensions in meters
// $mapid_dimension = array(xMax, yMax)
$celle_dimension = array(12290.0, 12290.0);
$chernarus_dimension = array(15360.0, 15360.0);
$lingor_island_dimension = array(10240.0, 10240.0);
// in game gps coordinates
// $mapid_gps = array(xMin, yMin, xMax, yMax, scale, digits on GPS, direction)
$celle_gps = array(5957, 1130, 7186, 2359, 10, 4, "up");
$chernarus_gps = array(000, 153, 153, 000, 100, 3, "down");
$lingor_island_gps = array(000, 000, 102, 102, 100, 3, "up");
case "GPS2DB" : // convert GPS to DB formula
$gpsvalue = $_POST['gps'];
$x = ((int) substr($gpsvalue, 0, $digits))*$scale - ($gxMin*$scale);
$y = $yMax - abs($gyMax - (int) substr($gpsvalue, $digits, $digits))*$scale;
$dbvalue = "[0[$x.0,$y.0,0.001]]";
break;
case "DB2GPS" : // convert DB to GPS
$dbvalue = $_POST['db'];
// conversion format:
// [###[#######,########,#####]]
// remove first [ and last 2 ]] => ###[######,#######,######
// get index of first [, return substr from index to end
// expand ######,######,###### into an array where x[0], y[1], z[2]
$str = substr($dbvalue, 1, strlen($dbvalue)-3);
$index = strpos($str, "[")+1;
$str = substr($str, $index, strlen($str));
$vals = explode(",", $str);
$x = $vals[0]; // x db coordinate
$y = $vals[1]; // y db coordinate
// gps x coordinate
$gx = str_pad((int)($x/$scale)+$gxMin, $digits, "0", STR_PAD_LEFT);
// some maps y increases Northwards, and some maps
// y increases Southwards, so add the lowest value
// y to the calculated y coordinate
// gps y coordinate
$pos = (int)(($yMax - $y)/$scale);
if($dir == "up") {
$pos = $pos + $gyMin;
} else {
$pos = $pos + $gyMax;
}
$gy = str_pad($pos, $digits, "0", STR_PAD_LEFT);
$gpsvalue = $gx . $gy;
break;