Jump to content

Preciso troca meu id, meu id está 2 pq o id 1 vez merda e tive de banir


Recommended Posts

esse gera:

 

local drawDistance = 20
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)
 

esté salva: 
function Start_Id ( _, acc )
    if eventName == "onPlayerLogin" then
        setElementData ( source, "ID", getAccountID(acc) or "N/A" )
    elseif eventName == "onPlayerLogout" then
        removeElementData( source, "ID" )
    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)
 

Link to comment
  • Other Languages Moderators

Utilize a ferramenta de código do fórum para postar na formatação adequada, não cole direto no texto.

UqAT5Nh.png

Estou vendo que você é um usuário novo no fórum, você pode ver as regras aqui:

 

Link to comment
local drawDistance = 20
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)

 

--[[
/\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\/
										            Curta a Minha Página <3
 									     	https://www.facebook.com/danilinmtascr/

                        :::::::::      :::     ::::    ::: ::::::::::: :::        ::::::::::: ::::    :::
                        :+:    :+:   :+: :+:   :+:+:   :+:     :+:     :+:            :+:     :+:+:   :+:
                        +:+    +:+  +:+   +:+  :+:+:+  +:+     +:+     +:+            +:+     :+:+:+  +:+
                        +#+    +:+ +#++:++#++: +#+ +:+ +#+     +#+     +#+            +#+     +#+ +:+ +#+
                        +#+    +#+ +#+     +#+ +#+  +#+#+#     +#+     +#+            +#+     +#+  +#+#+#
                        #+#    #+# #+#     #+# #+#   #+#+#     #+#     #+#            #+#     #+#   #+#+#
                        #########  ###     ### ###    #### ########### ########## ########### ###    ####

/\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\/
--]]
function Start_Id ( _, acc )
	if eventName == "onPlayerLogin" then
		setElementData ( source, "ID", getAccountID(acc) or "N/A" )
	elseif eventName == "onPlayerLogout" then
		removeElementData( source, "ID" )
	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)

 

Link to comment
  • Other Languages Moderators

Está gerando a partir do ID da conta... vc vai precisar abrir o banco de dados internal.db e editar o ID manualmente.

Tenha certeza de já ter deletado a conta de ID 1 antes com /unregister

Edited by Lord Henry
Link to comment
  • Other Languages Moderators

Abre o internal.db com o DB Browser for SQLite. (o servidor deve estar desligado)

Vai na aba Navegar Dados, seleciona a tabela accounts. Ele vai mostrar a tabela como se fosse uma planilha excel.

Seleciona a célula da coluna ID na linha da sua conta, muda pra 1 na caixa de input do lado direito e depois clica em aplicar.

Depois clica lá em cima, em Escrever modificações para salvar o banco de dados (ou use Ctrl+S) e feche-o.

Então inicie o servidor.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...