Jump to content

1 Screenshot

About This File

A Javascript remake of https://rage.mp/files/file/461-c-player-location-display/ (all credits go to him)

Hey!

This is my first resource that I am publicly releasing.
For you all, I have ported the C# Player Location Display (https://rage.mp/files/file/461-c-player-location-display/) into JS.

Install

Place `/street` into your server's client_packages directory, then add `require("./street/index.js");` to client_packages/index.js


I know the code isn't the best optimized, please feel free to open a pull request on GitHub.

 

GITHUB: https://github.com/realdiegopoptart/ragemp-pld

Edited by realdiegopoptart

  • Like 4

User Feedback

Recommended Comments

MirageGaming

Posted

If you want 8-directional compass you can replace the heading code with this:

if (heading < 22.5 || heading > 337.5) direction = "N";
else if (heading > 22.5 && heading < 67.5) direction = "NE";
else if (heading > 67.5 && heading < 112.5) direction = "E";
else if (heading > 112.5 && heading < 157.5) direction = "SE";
else if (heading > 157.5 && heading < 202.5) direction = "S";
else if (heading > 202.5 && heading < 247.5) direction = "SW";
else if (heading > 247.5 && heading < 292.5) direction = "W";
else if (heading > 292.5 && heading < 337.5) direction = "NW";

And if you really wanna go nuts....

if(heading >= 348.75 || heading < 11.25) direction = "N";
else if(heading >= 326.25 && heading < 348.75) direction = "NNE";
else if(heading >= 303.75 && heading < 326.25) direction = "NE";
else if(heading >= 281.25 && heading < 303.75) direction = "ENE";
else if(heading >= 258.75 && heading < 281.25) direction = "E";
else if(heading >= 236.25 && heading < 258.75) direction = "ESE";
else if(heading >= 213.75 && heading < 236.25) direction = "SE";
else if(heading >= 191.25 && heading < 213.75) direction = "SSE";
else if(heading >= 168.75 && heading < 191.25) direction = "S";
else if(heading >= 146.25 && heading < 168.75) direction = "SSW";
else if(heading >= 123.25 && heading < 146.25) direction = "SW";
else if(heading >= 101.25 && heading < 123.25) direction = "WSW";
else if(heading >= 78.75 && heading < 101.25) direction = "W";
else if(heading >= 56.25 && heading < 78.75) direction = "WNW";
else if(heading >= 33.75 && heading < 56.25) direction = "NW";
else if(heading >= 11.5 && heading < 33.75) direction = "NNW";

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...