Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ElPumpo committed Aug 14, 2018
1 parent 772340d commit ea4dd8a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
15 changes: 13 additions & 2 deletions client/gpstools-client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,19 @@ end)

RegisterNetEvent('gpstools:getpos')
AddEventHandler('gpstools:getpos', function()
local pos = GetEntityCoords(GetPlayerPed(-1))
local formattedText = "x: " .. pos.x .. ", y: " .. pos.y .. ", z: " .. pos.z
local playerPed = PlayerPedId()

local pos = GetEntityCoords(playerPed)
local heading = GetEntityHeading(playerPed)
local finalPos = {}

-- round to 2 decimals
finalPos.x = string.format("%.2f", pos.x)
finalPos.y = string.format("%.2f", pos.y)
finalPos.z = string.format("%.2f", pos.z)
finalPos.h = string.format("%.2f", heading)

local formattedText = "x = " .. finalPos.x .. ", y = " .. finalPos.y .. ", z = " .. finalPos.z .. ', h = ' .. finalPos.h
TriggerEvent('chatMessage', 'SYSTEM', { 0, 0, 0 }, formattedText)
end)

Expand Down
2 changes: 1 addition & 1 deletion config.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Config = {}
Config.Locale = 'sv'
Config.Locale = 'en'
2 changes: 1 addition & 1 deletion locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Locales['en'] = {
-- afk script
['afk'] = '^2Anti-AFK',
['afk_kicked_message'] = 'you have been kicked for being AFK',
['afk_warning'] = 'you\'ll be kicked in ~r~%s seconds~s~ for being inactive!',
['afk_warning'] = 'you\'ll be kicked in ^3%s seconds^0 for being inactive!',

-- gps tools
['gpstools_setgps_ok'] = 'the coords have been added to your GPS!',
Expand Down
2 changes: 1 addition & 1 deletion locales/sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Locales['sv'] = {
-- afk script
['afk'] = '^2Anti-AFK',
['afk_kicked_message'] = 'du har blivit kickad på grund av inaktivitet!',
['afk_warning'] = 'du kommer bli kickad om ~r~%s sekunder~s~ på grund av inaktivitet!',
['afk_warning'] = 'du kommer bli kickad om ^3%s sekunder^0 på grund av inaktivitet!',

-- gps tools
['gpstools_setgps_ok'] = 'koordinaterna har blivit placerad i din GPS!',
Expand Down

0 comments on commit ea4dd8a

Please sign in to comment.