[Release] Personal Saved Locations (with teleporting)

Personal Saved Locations

Personal Saved Locations is my first public resource. With it on your server, the players can create saved locations everywhere on the map to which they can teleport to (configurable) or create a waypoint to its coordinates.
I used javascript and MySQL-Async.

I’d be thankful if any moderador could move this post to the releases subforum. I couldn’t put it there myself.

Commands

All the commands in this resource start with /locations.

Command Description Example
/locations Shows a list of all the players’ saved locations.
/locations create [name] Saves a location with the player’s coordinates. /locations create House
/locations go [id] Teleports the player to the locations’ coordinates. /locations go 2
/locations route [id] Creates a waypoint with the locations’ coordinates. /locations route 3
/locations delete [id] Deletes a saved location. /locations delete 1

Configurations

In server.js there are two functions that can be configurable:

  • limitLocations , which sets the maximum amount of locations a player can have. By default, is set to 10.
  • teleportEnabled , which sets if the players can teleport to the locations. RP servers might want to turn this one off.

Show-off video

Credits

The credits of this resource go to me and to all the people that helped me learning how to code in the FiveM community.

Installation

  1. Add the β€˜locations’ folder inside your β€˜resources’ folder
  2. Add start locations to your β€˜server.cfg’
  3. In your database, create a table called users and another one called locations
    3.1. The users table must have the following columns: id (Primary Key, INT and auto-increment) and license (the license identifier of the player)
    3.2. The locations table must have the following columns: id (Primary Key and auto-increment), name (VARCHAR), spawnX, spawnY and spawnZ (each being floats) and creatorId (INT and it’s equal to the id from the users table)

users table

╔════╦═════════╗
β•‘ id β•‘ license β•‘
β•šβ•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•

locations table

╔════╦═════════╦════════╦════════╦════════╦═══════════╗
β•‘ id β•‘ license β•‘ spawnX β•‘ spawnY β•‘ spawnZ β•‘ creatorId β•‘
β•šβ•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•

In the future, I’ll try to make the tables create by themselves, but for now I am having some trouble doing it. If everyone could help me with it, I’d be thankful.

Download

locations.rar (2.5 KB)

1 Like

where is the download sir

I forgot about the most important part, lol
I added it noiw