I found the OnHelicopterKilled hook and I was wondering if its possible to say where the helicopter crashed in the map?
Saying where helicopter crashed
Get its Transform maybe?
(pos = vector3)
var worldSize = ConVar.Server.worldsize;
const float scale = 150f;
var x = pos.x + worldSize/2f;
var z = pos.z + worldSize/2f;
var lat = (int)(x / scale);
var latChar = (char)('A' + lat);
var lon = (int)(worldSize/scale - z/scale);
return $"{latChar}{lon}";
In response to 2CHEVSKII ():For the bloody mother, what the hell is that? I thought he asked about getting a world position, not...
> Saying where helicopter crashed
It's for saying the world position in a format that is useful for the players. The players have grids displayed on their map.
It's for saying the world position in a format that is useful for the players. The players have grids displayed on their map.
In response to Cryo ():Error while compiling: Info.cs(79,16): error CS1525: Unexpected symbol `var'
You should see syntax errors like that before you try to compile it, you're probably not using a proper IDE setup.
Here's a simple guide on how you can setup your workspace:
https://oxidemod.org/threads/setting-up-a-c-workspace-in-visual-studio-2015.10010/
If you're a member of a university, you might be eligible for a student license. JetBrains Rider is a good alternative to Visual Studio.