Skip to content

Commit

Permalink
Fix name overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
Korioz committed Oct 1, 2019
1 parent 259e4d6 commit daa4c15
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ function admin_vehicle_spawn()
vehicleName = tostring(vehicleName)

if type(vehicleName) == 'string' then
ESX.Game.SpawnVehicle(vehicleName, GetEntityCoords(plyPed, true), GetEntityHeading(plyPed), function(vehicle)
ESX.Game.SpawnVehicle(vehicleName, GetEntityCoords(plyPed), GetEntityHeading(plyPed), function(vehicle)
TaskWarpPedIntoVehicle(plyPed, vehicle, -1)
end)
end
Expand Down Expand Up @@ -2168,7 +2168,7 @@ Citizen.CreateThread(function()
end

if noclip then
local coords = GetEntityCoords(plyPed, true)
local coords = GetEntityCoords(plyPed)
local camCoords = getCamDirection()

SetEntityVelocity(plyPed, 0.01, 0.01, 0.01)
Expand All @@ -2188,16 +2188,12 @@ Citizen.CreateThread(function()
for k, v in ipairs(GetActivePlayers()) do
local otherPed = GetPlayerPed(v)
if otherPed ~= plyPed then
local closeEnough = Vdist2(GetEntityCoords(plyPed, true), GetEntityCoords(otherPed, true)) < 100.0
if gamerTags[v] ~= nil then
if closeEnough then
gamerTags[v] = CreateFakeMpGamerTag(otherPed, ('%s [%s]'):format(GetPlayerName(v), GetPlayerServerId(v)), false, false, '', 0)
else
RemoveMpGamerTag(gamerTags[p])
gamerTags[v] = nil
end
elseif closeEnough then
local closeEnough = Vdist2(GetEntityCoords(plyPed), GetEntityCoords(otherPed)) < 10000.0
if closeEnough and gamerTags[v] == nil then
gamerTags[v] = CreateFakeMpGamerTag(otherPed, ('%s [%s]'):format(GetPlayerName(v), GetPlayerServerId(v)), false, false, '', 0)
elseif not closeEnough then
RemoveMpGamerTag(gamerTags[v])
gamerTags[v] = nil
end
end
end
Expand Down

0 comments on commit daa4c15

Please sign in to comment.