This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{ | |
cell::RefCell, | |
sync::{Arc, Mutex}, | |
}; | |
#[altv::main] | |
fn main() -> impl altv::IntoVoidResult { | |
let rt = Arc::new(RefCell::new(Some(tokio::runtime::Runtime::new().unwrap()))); | |
let data = Arc::new(Mutex::new(1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import alt from "alt-client" | |
const STRING_LIMIT = 2 ** 15 | |
const sendSnapshot = async (string) => { | |
const len = string.length | |
const parts = Math.ceil(len / STRING_LIMIT) | |
alt.log("sendSnapshot", "parts:", parts, "len:", len) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import alt from "alt-client" | |
import native from "natives" | |
const localPlayer = alt.Player.local | |
const SYNC_MS_DELAY = 500 | |
const SYNC_MS_DELAY_REMOTE = 100 | |
const MAX_HEADING_DIST = 70.0 | |
const BACKWARDS_HEADING_DIST = 145.0 | |
const TASK_LOOK_AT_COORD_DURATION = 300 | |
const LOOKING_AT_POS_OFFSET = 5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import https from "https" | |
const options = { | |
hostname: "ipinfo.io", | |
path: "/ip", | |
method: "GET", | |
} | |
export const getExternalIp = (): Promise<string> => | |
new Promise<string>((resolve, reject) => { |