24 lines
791 B
TypeScript
24 lines
791 B
TypeScript
export default function waypointUtil() {
|
|
|
|
let x_saved: number;
|
|
let y_saved: number;
|
|
let z_saved: number;
|
|
|
|
mp.events.add("SERVER:Util_setWaypoint", (x, y, z) => {
|
|
mp.game.ui.setNewWaypoint(x, y);
|
|
});
|
|
|
|
mp.events.add("playerCreateWaypoint", (position) => {
|
|
x_saved = position.x;
|
|
y_saved = position.y;
|
|
z_saved = position.z;
|
|
mp.events.callRemote("SERVER:waypointToDriver", position.x, position.y);
|
|
});
|
|
|
|
mp.events.add("gotoWaypoint", () => {
|
|
mp.gui.chat.push("xyz: " + x_saved + " " + y_saved + " " + z_saved);
|
|
mp.players.local.position = new mp.Vector3(x_saved, y_saved, z_saved);
|
|
|
|
//coord.z = mp.game.gameplay.getGroundZFor3dCoord(coord.x, coord.y, i * 50, 0, false); // try calcualte Z
|
|
});
|
|
} |