Esse sistema e de id permanente ( link censurado ) mais ele nao ta permanente. ta ficando por ordem de entrada quem entrou primeiro fca com os primeiros ids (1,2,3,4,5) alguem pode me ajudar a fazer ele fica permanente (fixo)
Danilin_S.Lua:
function Start_Id ( _, acc )
if eventName == "onPlayerLogin" then
setElementData ( source, "ID", getAccountID(acc) or "N/A" )
outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffID: #00ff00( "..(getAccountID(acc) or "N/A") .." )", root, 255,255,255,true)
elseif eventName == "onPlayerLogout" then
removeElementData( source, "ID" )
outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffDeslogou.", root, 255,255,255,true)
elseif eventName == "onResourceStart" then
for _, player in pairs(getElementsByType("player")) do
local acc = getPlayerAccount(player)
if not isGuestAccount(acc) then
setElementData( source, "ID", getAccountID(acc) or "N/A" )
end
end
end
end
addEventHandler("onResourceStart", resourceRoot, Start_Id)
addEventHandler("onPlayerLogout", root, Start_Id)
addEventHandler("onPlayerLogin", root, Start_Id)
function getPlayerID(id)
v = false
for i, player in ipairs (getElementsByType("player")) do
if getElementData(player, "ID") == id then
v = player
break
end
end
return v
end
--============================================================================================================================--
--=============================--
----------- ID PLAYER ------------
--=============================--
function getnick(player, command, id, ...)
if(id) then
local playerID = tonumber(id)
if(playerID) then
local Player2 = getPlayerID(playerID)
if(Player2) then
outputChatBox ( "#00ff00✘ #ffffffINFO #00ff00✘➺ #ffffff Nome do Jogador #00ff00" .. getPlayerName(Player2) .."", player, 255,255,255,true)
else
outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff O Jogador(a) de ID: #00ff00( " .. id .. " ) #ffffffNão Foi Encontrado!", player, 255,255,255,true)
end
else
outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff ID: #00ff00( " .. id .. " ) #ffffffInválido!", player, 255,255,255,true)
end
else
outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffffUse /id #00ff00[#ffffffID#00ff00]", player, 255,255,255,true)
end
end
addCommandHandler("id", getnick)
IDTag:
local drawDistance = 7
g_StreamedInPlayers = {}
function onClientRender()
local cx, cy, cz, lx, ly, lz = getCameraMatrix()
for k, player in pairs(g_StreamedInPlayers) do
if isElement(player) and isElementStreamedIn(player) then
do
local vx, vy, vz = getPedBonePosition(player, 4)
local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz)
if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then
local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3)
if x and y then
local ID = getElementData(player, "ID") or "N/A"
local w = dxGetTextWidth(ID, 0.1, "default-bold")
local h = dxGetFontHeight(1, "default-bold")
dxDrawText(""..ID.."", x - 1 - w / 1, y - 1 - h - 12, w, h, CorTag, 1.20, "default-bold", "left", "top", false, false, false, false, false)
CorTag = tocolor(255, 255, 255)
if getElementData(player, "Cor", true) then
CorTag = tocolor(0, 255, 0)
end
end
end
end
else
table.remove(g_StreamedInPlayers, k)
end
end
end
addEventHandler("onClientRender", root, onClientRender)
function CorTagid ()
if getElementData(localPlayer, "Cor", true) then
setElementData(localPlayer, "Cor", false)
else
setElementData(localPlayer, "Cor", true)
end
end
bindKey ( "z", "both", CorTagid )
function onClientElementStreamIn()
if getElementType(source) == "player" and source ~= getLocalPlayer() then
setPlayerNametagShowing(source, false)
table.insert(g_StreamedInPlayers, source)
end
end
addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn)
function onClientResourceStart(startedResource)
visibleTick = getTickCount()
counter = 0
local players = getElementsByType("player")
for k, v in pairs(players) do
if isElementStreamedIn(v) and v ~= getLocalPlayer() then
setPlayerNametagShowing(v, false)
table.insert(g_StreamedInPlayers, v)
end
end
end
addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart)