WITH THIS SYSTEM YOU CAN TAKE A COORD IN 5 SECONDS!!!
This script allows you to take coordinates through an ESX input and be printed on the discord for easy copying.
All you need is a discord with a channel and the script implemented on the server.
You can create the necessary webhook by clicking on the channel settings. You do not need any bot.
How to use
Download tm1_getcoords and put the script into the server.
Create a webhook in a channel of our discord server.
Replace in the script the webook that comes with yours
You can use /gc for the next format : {x = n1, y = n2, z = n3} and /gc1 for n1,n2,n3 (this is useful for vectors)
You can introduce a name to find the coord in the discord.
An Image of discord with this system.
Gityab
6 Likes
TheIndra
Unlisted
January 20, 2020, 8:47pm
2
Please don’t use the chatMessage event to handle commands, instead use RegisterCommand native.
dabz
January 23, 2020, 1:54am
5
Great Release! Works Fantastic
1 Like
This seems very unnecessarily complicated and could likely be done more efficiently with less than 5 lines of code on the client and server and without requiring ESX. Something like
RegisterCommand('gc', function(source, args, rawCommand)
local coords = GetEntityCoords(GetPlayerPed(-1))
TriggerServerEvent('logthisthing', coords.x, coords.y, coords.z)
end, false)
And server side could look like
RegisterServerEvent('logthisthing')
AddEventHandler('logthisthing', function(x, y, z)
PerformHttpRequest(blablabla with da x y z)
end)
This is a much more simple way to get coords and log them to Discord without requiring other resources.
1 Like
Thanks a lot Dude, Work fine
1 Like
How can I get permissions? It says Access denied for command
3 Likes
You can change this
RegisterCommand("gc", function(source, args, rawCommand)
local source = source
TriggerClientEvent('tm1_getcoords', source)
end, true)
RegisterCommand("gc1", function(source, args, rawCommand)
local source = source
TriggerClientEvent('tm1_getcoords1', source)
end, true)
for
RegisterCommand("gc", function(source, args, rawCommand)
local source = source
TriggerClientEvent('tm1_getcoords', source)
end, false)
RegisterCommand("gc1", function(source, args, rawCommand)
local source = source
TriggerClientEvent('tm1_getcoords1', source)
end, false)
Anyway, you can grant yourself permissions through ACE.
Why you don’t register the command directly on server-side? With OneSync you can now use GetEntityCoords(source) on server-side