mupp3t Posted January 9, 2022 Posted January 9, 2022 Hi , in this video I am going to show a simple way how to make a marker on your new server. I will assume that you followed all the steps on how to get your server to work and that you installed Node.js and so on. This is not the best way of doing this but I find it the most simple way. I am also a beginner and I would love to help myself and others who are trying to build their own and unique servers. If you need any other help, please leave a comment. Hope you enjoyed. { To all experts out there, I am sorry, I am just trying to help out the community. } 2
HankSteiner Posted January 11, 2022 Posted January 11, 2022 Good day mupp3t, Tryout this command serverside to save positions so you don't have to write them yourself. just keep the file "savedpos.txt" open on your side Screen or rewrite it to do what you are doing by hand in this Video! Keep it up. const fs = require("fs"); const path = require("path"); const saveFile = "savedpos.txt"; mp.events.addCommand("save", (player, name = "No name") => { let pos = (player.vehicle) ? player.vehicle.position : player.position; let rot = (player.vehicle) ? player.vehicle.rotation : player.heading; fs.appendFile(saveFile, `Position: ${pos.x}, ${pos.y}, ${pos.z} | ${(player.vehicle) ? `Rotation: ${rot.x}, ${rot.y}, ${rot.z}` : `Heading: ${rot}`} | ${(player.vehicle) ? "InCar" : "OnFoot"} - ${name}\r\n`, (err) => { if (err) { player.notify(`~r~SavePos Error: ~w~${err.message}`); } else { player.notify(`~g~Position saved. ~w~(${name})`); } }); }); have a good one! Net
mupp3t Posted March 12, 2022 Author Posted March 12, 2022 @HankSteiner Thanks for the reply. Thanks for the advice. I might use it in the future. Have a great day.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now