hello everyone I wanted to know if someone could help me with this code practically the tag is there but I would like to do that as soon as they do the command and the tag
ESX = nil
local activated = false
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(1000)
end
end)
function DrawStaffOverSkin(x, y, z, text, scale)
local onScreen, _x, _y = World3dToScreen2d(x, y, z)
local pX, pY, pZ = table.unpack(GetGameplayCamCoords())
SetTextScale(scale, scale)
SetTextFont(4)
SetTextProportional(1)
SetTextEntry("STRING")
SetTextCentre(true)
SetTextColour(82, 38, 121, 255)
AddTextComponentString(text)
DrawText(_x,_y)
local factor = (string.len(text)) / 700
end
RegisterCommand('streameron', function()
ESX.TriggerServerCallback("checkperms:fordisplay", function(permschecked)
if permschecked == "streamer" or permschecked == "admin" then
if activated == false then
TriggerServerEvent('on:logs')
end
activated = true
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local offset = 1
local Mycoords = GetEntityCoords(GetPlayerPed(-1), false)
local coords = GetEntityCoords(PlayerPedId(), false)
local dist = Vdist2(Mycoords, coords)
if dist < 5 then
if activated == true then
DrawStaffOverSkin(Mycoords.x, Mycoords.y, Mycoords.z + 1, "[STAFF Ciro]", 0.6)
end
end
end
end)
ESX.ShowNotification("Ciao Streamer
")
else
ESX.ShowNotification("Non sei Streamer")
end
end)
end)
RegisterCommand('streameroff', function()
ESX.TriggerServerCallback("checkperms:fordisplay", function(permschecked)
if permschecked == "streamer" or permschecked == "admin" then
activated = false
ESX.ShowNotification("Grazie del servizio")
else
ESX.ShowNotification("Non sei Streamer")
end
end)
if activated == true then
TriggerServerEvent('off:logs')
end
end)
is activated give the name of the player next to it, for example
[STAFF] CIRO
[STAFF] Vale
[STAFF] FABRI
ESX = nil
local activated = false
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(1000)
end
end)
function DrawStaffOverSkin(x, y, z, text, scale)
local onScreen, _x, _y = World3dToScreen2d(x, y, z)
local pX, pY, pZ = table.unpack(GetGameplayCamCoords())
SetTextScale(scale, scale)
SetTextFont(4)
SetTextProportional(1)
SetTextEntry("STRING")
SetTextCentre(true)
SetTextColour(82, 38, 121, 255)
AddTextComponentString(text)
DrawText(_x,_y)
local factor = (string.len(text)) / 700
end
RegisterCommand('streameron', function()
ESX.TriggerServerCallback("checkperms:fordisplay", function(permschecked)
if permschecked == "streamer" or permschecked == "admin" then
if activated == false then
TriggerServerEvent('on:logs')
end
activated = true
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local offset = 1
local Mycoords = GetEntityCoords(GetPlayerPed(-1), false)
local coords = GetEntityCoords(PlayerPedId(), false)
local dist = Vdist2(Mycoords, coords)
if dist < 5 then
if activated == true then
DrawStaffOverSkin(Mycoords.x, Mycoords.y, Mycoords.z + 1, "[STAFF Ciro]", 0.6)
end
end
end
end)
ESX.ShowNotification("Ciao Streamer
else
ESX.ShowNotification("Non sei Streamer")
end
end)
end)
RegisterCommand('streameroff', function()
ESX.TriggerServerCallback("checkperms:fordisplay", function(permschecked)
if permschecked == "streamer" or permschecked == "admin" then
activated = false
ESX.ShowNotification("Grazie del servizio")
else
ESX.ShowNotification("Non sei Streamer")
end
end)
if activated == true then
TriggerServerEvent('off:logs')
end
end)
is activated give the name of the player next to it, for example
[STAFF] CIRO
[STAFF] Vale
[STAFF] FABRI