Skip to content

Commit

Permalink
Update v1.2
Browse files Browse the repository at this point in the history
* Changed AddBlipForEntity to AddBlipForCoords
  • Loading branch information
Musiker15 committed May 18, 2023
1 parent 8339cd3 commit 01e0bb9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1
1.2
17 changes: 9 additions & 8 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@ end)
addBlip = function(xPlayer)
local playerSource = 0
local playerName = 'Unknown Unknown'
local playerCoords = nil

if Config.Framework:match('ESX') then -- ESX Framework
playerSource = xPlayer.source
playerName = xPlayer.name
playerCoords = xPlayer.coords
elseif Config.Framework:match('QBCore') then -- QBCore Framework
playerSource = xPlayer.PlayerData.source
playerName = xPlayer.PlayerData.charinfo.firstname .. ' ' .. xPlayer.PlayerData.charinfo.lastname
playerCoords = xPlayer.PlayerData.position
end

local player = GetPlayerFromServerId(playerSource)
local ped = GetPlayerPed(player)
local blip = AddBlipForCoord(playerCoords.x, playerCoords.y, playerCoords.z)

if not ped then return logging('error', 'PlayerPed from ID ^2' .. playerSource .. '^0 not found!') end
local blip = AddBlipForEntity(ped)

SetBlipAsShortRange(blip, false)
SetBlipSprite(blip, Config.Blip.id)
SetBlipScale(blip, Config.Blip.scale)
SetBlipColour(blip, Config.Blip.color)
BeginTextCommandSetBlipName('STRING')
AddTextComponentString(('%s (%s)'):format(playerName, number))
AddTextComponentString(playerName)
EndTextCommandSetBlipName(blip)

table.insert(Blips, blip)
Expand All @@ -46,8 +47,8 @@ startTimer = function()

for k, v in pairs(Blips) do
RemoveBlip(v)
Blips = {}
end
Blips = {}
end)
end

Expand Down
4 changes: 3 additions & 1 deletion config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ Config.MySQL = {
identifier = 'identifier' -- identifier for table // Default ESX: 'identifier' // Default QB: 'citizenid'
}
----------------------------------------------------------------
Config.Time = 5 -- in minutes // After this time the blip gets removed
Config.Time = 5 -- in minutes // After this time the blip gets removed

Config.Blip = {id = 1, color = 0, scale = 0.6},
4 changes: 2 additions & 2 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ games { 'gta5' }
author 'Musiker15 - MSK Scripts'
name 'msk_trackphone'
description 'Track a Player by his Phonenumber'
version '1.1'
version '1.2'

shared_scripts {
'@msk_core/import.lua'
'@msk_core/import.lua',
'config.lua'
}

Expand Down

0 comments on commit 01e0bb9

Please sign in to comment.