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
- Add the βlocationsβ folder inside your βresourcesβ folder
- Add
start locations
to your βserver.cfgβ - In your database, create a table called
users
and another one calledlocations
3.1. Theusers
table must have the following columns:id
(Primary Key, INT and auto-increment) andlicense
(the license identifier of the player)
3.2. Thelocations
table must have the following columns:id
(Primary Key and auto-increment),name
(VARCHAR),spawnX
,spawnY
andspawnZ
(each being floats) andcreatorId
(INT and itβs equal to the id from theusers
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)