Jump to content

Ajuda Painel revistar da net.


Recommended Posts

O 1 erro no debugscript [ ERROR: Server triggered clientside event L:iniciou_Comando, but event is not added clientside ]

 

2 erro no mesmo script [ ERROR: Loading script failed: PL_PainelRevistar\Client.Lua:86:')' expected near "Peso:"

 

serverside

function AbrirPainel(source,cmd,pname)
local accName = getAccountName ( getPlayerAccount ( source ) ) 
local cx,cy,cz = getElementPosition(cliente)
						local x,y,z = getElementPosition(source)
						local dist = getDistanceBetweenPoints3D(x,y,z,cx,cy,cz)

     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policial" ) ) then
	 cliente = getPlayerFromPartialName(pname) or getPlayerFromID(pname)
	 if isElement(cliente) then
	 if dist <= 7 then
	local PegarId = getPlayerFromID(cliente)

	local PegarNick = getPlayerName(cliente)
	local PegarNome = getElementData(cliente, "AirNew_RG_NomeCompleto") or "N/A"
	local PegarSobrenome = getElementData(cliente, "AirNew_RG_Sobrenome") or "N/A"
	local Idade = getElementData(cliente, "AirNew_RG_Idade") or "N/A"
	local Peso = getElementData(cliente, "Peso") or "70Kg"
	local Altura = getElementData(cliente, "Altura") or "1,70m"
    local Sexo = getElementData(cliente, "Sexo") or "Masculino"
    local Porte = getElementData(cliente, "PorteDeArmas") or "Não possui"
    local Wanted = getPlayerWantedLevel(cliente)
    local Dinheiro = getPlayerMoney(cliente)
    local Level = getElementData(cliente, "Level") or "0"

   	setElementData(source, "Suspeito:ID", PegarId)
    setElementData(source, "Suspeito:Nick", PegarNick)
    setElementData(source, "Suspeito:AirNew_RG_NomeCompleto",PegarNome)
	setElementData(source, "Suspeito:AirNew_RG_Sobrenome",PegarSobrenome)
	setElementData(source, "Suspeito:AirNew_RG_Idade",Idade)
	setElementData(source, "Suspeito:Peso",Peso)
	setElementData(source, "Suspeito:Altura",Altura)
    setElementData(source, "Suspeito:Sexo",Sexo)
    setElementData(source, "Suspeito:PorteDeArmas",Porte)
    setElementData(source, "Suspeito:Wanted",Wanted)
    setElementData(source, "Suspeito:Dinheiro",Dinheiro)
    setElementData(source, "Suspeito:Level",Level)

	setElementData(source, "L:IDRevistado", PegarId)
	triggerClientEvent(source, "L:Iniciou_Comando", source)
else
	outputChatBox("#0064c8» #ffffffEsse jogador está muito longe.",source,255,255,255,true)
end
else
	outputChatBox("#0064c8» #ffffffEsse jogador não existe ou está offiline.",source,255,255,255,true)
end
else
	outputChatBox("#0064c8» #ffffffVocê não tem permissão para esse comando.",source,255,255,255,true)
end
end
addCommandHandler("abordar",AbrirPainel)

	function VCNH()
	local CNH = getElementData(cliente, "Habilitação") or "Não"
	outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..CNH, source, 255,255,255,true)
end
addEvent ( "L:VCNH", true)
	addEventHandler ( "L:VCNH", root, VCNH )

function VMultar()
	local Valor = getElementData(source,"L:ValorMulta") or 0
	local Motivo = getElementData(source, "L:MotivoMulta") or "erro"
	outputChatBox("#0064c8»#ffffff Você multou o jogador #0064c8"..getPlayerName(cliente).."#ffffff por #0064c8$"..Valor.."#ffffff pelo motivo #0064c8".. Motivo, source, 255,255,255,true)
	outputChatBox("#0064c8»#ffffff O Polícial #0064c8"..getPlayerName(source).."#ffffff te multou por #0064c8$"..Valor.."#ffffff pelo motivo #0064c8"..Motivo, cliente, 255,255,255,true)
	takePlayerMoney(cliente,Valor)
	givePlayerMoney(source,Valor)
end
addEvent ( "L:MultouJogador", true)
addEventHandler ( "L:MultouJogador", root, VMultar )
algemar = false


	function VAlgemar2()
		local algemado = getElementData(cliente,"algemado") or false

				if algemado == false then
				setPedAnimation( cliente, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false) -- Animação de algemar
				setElementFrozen( cliente, true ) -- Freezar jogador
				setPedAnimation( cliente, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false)
				toggleControl(cliente, "fire", false) -- retirar função de atirar
				setPedAnimation( cliente, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false)
				setElementData(cliente,"algemado",true) 
			else
				setPedAnimation( cliente) -- Animação de algemar
				setElementFrozen( cliente, false ) -- Freezar jogador
				toggleControl(cliente, "fire", true) -- retirar função de atirar
				setElementData(cliente,"algemado",false) 
		end
end
addEvent ( "L:VAlgemar", true)
	addEventHandler ( "L:VAlgemar", root, VAlgemar2 )

		function VRevistar()
			local Drogas = getElementData(cliente, "L:Maconhas") or 0 
			outputChatBox ( "#0064c8» #ffffffDrogas do jogador:#0064c8 "..Drogas, source, 255, 255, 255, true )
			outputChatBox ( "#0064c8» #ffffffArmas do jogador:", source, 255, 255, 255, true )
	for slot = 0, 12 do
                local Armas = getPedWeapon ( cliente, slot )
                local Municao = getPedTotalAmmo ( cliente, slot ) 

                if Armas > 0 then
                    if Municao > 0 then
                        weapon_nome = getWeaponNameFromID ( Armas )
                        outputChatBox ( "#0064c8» #ffffff"..weapon_nome.." #0064c8- #ffffff"..Municao.." Bala(s)!", source, 255, 255, 255, true )            
                    end
            end
        end
end
addEvent ( "L:VRevistar", true)
	addEventHandler ( "L:VRevistar", root, VRevistar )

	function VDrogas()
	local Drogas = getElementData(cliente, "L:Maconhas") or 0
	if Drogas > 0 then
	outputChatBox ( "#0064c8» #ffffffVocê prendeu #0064c8"..Drogas.."#ffffff do suspeito.", source, 255, 255, 255, true )
	setElementData(cliente,"L:Maconhas",0)
	outputChatBox("Você abriu Drogas", source, 255,255,255)
	else
	outputChatBox ( "#0064c8» #ffffffEsse jogador não possui drogas.", source, 255, 255, 255, true )
end
end
addEvent ( "L:VDrogas", true)
	addEventHandler ( "L:VDrogas", root, VDrogas )

	function VArmas()
	 takeAllWeapons (cliente)
	 outputChatBox ( "#0064c8» #ffffffVocê prendeu todas as armas do suspeito.", source, 255, 255, 255, true )
    end
    addEvent ( "L:VArmas", true)
    addEventHandler ( "L:VArmas", root, VArmas )

ultimovei = false
function verificarV(thePlayer)
 theVehicle = getPedOccupiedVehicle ( thePlayer )
	local id = getVehicleID ( theVehicle )
	if id == 490 then
		ultimovei = true
else
	ultimovei = false
end
end
addEventHandler("onVehicleEnter",root,verificarV)

function VPrender()
	local Preso = getElementData(cliente, "IndoPreso") or false
	if ultimovei == true then
	if Preso == false then
	attachElements (cliente,theVehicle, 0, -1.7, 0.7 )
	setPedAnimation( cliente, "CRACK", "crckidle3", -1, true, false, false, false) -- Animação de algemar
	setElementData(cliente, "IndoPreso",true)
else
	 detachElements(cliente,theVehicle,0,2,0)
	 setPedAnimation(cliente)
	 setElementData(cliente,"IndoPreso",false)
	end
else
	outputChatBox("#0064c8» #ffffffSeu ultimo veículo tem que ser um carro da polícia.",source,255,255,255,true)
end
end
addEvent ( "L:VPrender", true)
	addEventHandler ( "L:VPrender", root, VPrender )

function getPlayerFromPartialName(name)
    local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil
    if name then
        for _, player in ipairs(getElementsByType("player")) do
            local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower()
            if name_:find(name, 1, true) then
                return player
            end
        end
    end
end

function getPlayerFromID ( id )
	for k, player in ipairs ( getElementsByType ( "player" ) ) do
			local p_id = getElementData ( player, "ID" )
			if ( p_id == tonumber(id) ) then
					player_n = getPlayerName ( player )
					return player, player_n
			end
	end
			
end  

 

Clientside

local screenW, screenH = guiGetScreenSize()
local resW, resH = 1366, 768
local x, y =  (screenW/resW), (screenH/resH)
Painel = false
Identidade = false
    function DxRevistar()
    	local IdRevistado = getElementData(localPlayer, "Suspeito:Nick") or "N/A"
        dxDrawRectangle(screenW * 0.6950, screenH * 0.4333, screenW * 0.1875, screenH * 0.0467, tocolor(0, 0, 0, 208), false)
        dxDrawLine(screenW * 0.6950, screenH * 0.4800, screenW * 0.8825, screenH * 0.4800, tocolor(79, 144, 241, 208), 2, false)
        dxDrawText("Sistema Policial", screenW * 0.6925, screenH * 0.4333, screenW * 0.8812, screenH * 0.4800, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.6937, screenH * 0.4800, screenW * 0.1875, screenH * 0.0467, Cor1, false)
        dxDrawText("Nome: " ..IdRevistado, screenW * 0.6925, screenH * 0.4800, screenW * 0.8812, screenH * 0.5267, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.6937, screenH * 0.5267, screenW * 0.1875, screenH * 0.0467,Cor2, false)
        dxDrawText("Identidade", screenW * 0.6937, screenH * 0.5267, screenW * 0.8825, screenH * 0.5733, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.6937, screenH * 0.5733, screenW * 0.1875, screenH * 0.0467, Cor3, false)
        dxDrawText("Checar CNH", screenW * 0.6937, screenH * 0.5733, screenW * 0.8825, screenH * 0.6200, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.6937, screenH * 0.6200, screenW * 0.1875, screenH * 0.0467, Cor4, false)
        dxDrawRectangle(screenW * 0.6937, screenH * 0.6667, screenW * 0.1875, screenH * 0.0467, Cor5, false)
        dxDrawRectangle(screenW * 0.6937, screenH * 0.7133, screenW * 0.1875, screenH * 0.0467, Cor6, false)
        dxDrawRectangle(screenW * 0.6937, screenH * 0.7600, screenW * 0.1875, screenH * 0.0467, Cor7, false)
        dxDrawText("Multar", screenW * 0.6925, screenH * 0.6200, screenW * 0.8812, screenH * 0.6667, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false)
        dxDrawText("Algemar", screenW * 0.6925, screenH * 0.6667, screenW * 0.8812, screenH * 0.7133, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false)
        dxDrawText("Revistar", screenW * 0.6925, screenH * 0.7133, screenW * 0.8812, screenH * 0.7600, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false)
        dxDrawText("Apreender drogas", screenW * 0.6925, screenH * 0.7600, screenW * 0.8812, screenH * 0.8067, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.6937, screenH * 0.8067, screenW * 0.1875, screenH * 0.0467, Cor8, false)
        dxDrawText("Apreender armas", screenW * 0.6937, screenH * 0.8067, screenW * 0.8825, screenH * 0.8533, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.6937, screenH * 0.8533, screenW * 0.1875, screenH * 0.0467, Cor9, false)
        dxDrawText("Prender", screenW * 0.6937, screenH * 0.8533, screenW * 0.8825, screenH * 0.9000, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false)

        Cor1 = tocolor(30, 30, 30, 255)
        Cor2 = tocolor(30, 30, 30, 255)
        Cor3 = tocolor(30, 30, 30, 255)
        Cor4 = tocolor(30, 30, 30, 255)
        Cor5 = tocolor(30, 30, 30, 255)
        Cor6 = tocolor(30, 30, 30, 255)
        Cor7 = tocolor(30, 30, 30, 255)
        Cor8 = tocolor(30, 30, 30, 255)
        Cor9 = tocolor(30, 30, 30, 255)

        if isCursorOnElement(screenW * 0.6937, screenH * 0.4800, screenW * 0.1875, screenH * 0.0467) then Cor1 = tocolor(0, 100, 200, 255) end
        if isCursorOnElement(screenW * 0.6937, screenH * 0.5267, screenW * 0.1875, screenH * 0.0467) then Cor2 = tocolor(0, 100, 200, 255) end
        if isCursorOnElement(screenW * 0.6937, screenH * 0.5733, screenW * 0.1875, screenH * 0.0467) then Cor3 = tocolor(0, 100, 200, 255) end
        if isCursorOnElement(screenW * 0.6937, screenH * 0.6200, screenW * 0.1875, screenH * 0.0467) then Cor4 = tocolor(0, 100, 200, 255) end
        if isCursorOnElement(screenW * 0.6937, screenH * 0.6667, screenW * 0.1875, screenH * 0.0467) then Cor5 = tocolor(0, 100, 200, 255) end
        if isCursorOnElement(screenW * 0.6937, screenH * 0.7133, screenW * 0.1875, screenH * 0.0467) then Cor6 = tocolor(0, 100, 200, 255) end
        if isCursorOnElement(screenW * 0.6937, screenH * 0.7600, screenW * 0.1875, screenH * 0.0467) then Cor7 = tocolor(0, 100, 200, 255) end
        if isCursorOnElement(screenW * 0.6937, screenH * 0.8067, screenW * 0.1875, screenH * 0.0467) then Cor7 = tocolor(0, 100, 200, 255) end
        if isCursorOnElement(screenW * 0.6937, screenH * 0.8533, screenW * 0.1875, screenH * 0.0467) then Cor8 = tocolor(0, 100, 200, 255) end
 end 
    function AbrirPainel()
    if Identidade == false then
    if VMultar == false then
    if (Painel) then
    removeEventHandler("onClientRender",root,DxRevistar)
    Painel = false
    showCursor(false)
    else
    addEventHandler("onClientRender",root,DxRevistar)
    Painel = true
    showCursor(true)
    end
end
end
end
    addEvent ( "L:Iniciou_Comando", true)
	addEventHandler ( "L:Iniciou_Comando", root, AbrirPainel )
VMultar = false
function DxIdentidade()
	local Nick =getElementData(localPlayer, "Suspeito:Nick" ) or "N/A"
    local Nome =getElementData(localPlayer, "Suspeito:AirNew_RG_NomeCompleto")or "N/A"
    local Sobrenome =getElementData(localPlayer, "Suspeito:AirNew_RG_Sobrenome")or "N/A"
    local Idade =getElementData(localPlayer, "Suspeito:AirNew_RG_Idade")or "N/A"
    local Peso =getElementData(localPlayer, "Suspeito:Peso")or "80 Kg"
    local Altura =getElementData(localPlayer, "Suspeito:Altura")or "1,72m"
    local Sexo =getElementData(localPlayer, "Suspeito:Sexo")or "Masculino"
    local Porte =getElementData(localPlayer, "Suspeito:PorteDeArmas")or "Não possui"
    local Wanted = getElementData(localPlayer, "Suspeito:Wanted")or "N/A"
    local Dinheiro =getElementData(localPlayer, "Suspeito:Dinheiro")or "N/A"
    local Level =getElementData(localPlayer, "Suspeito:Level")or "N/A"
    local ID =getElementData(localPlayer, "Suspeito:ID")or "0"
    local DinheiroSujo =getElementData(localPlayer, "Suspeito:DinheiroSujo")or "0"
        dxDrawRectangle(screenW * 0.3787, screenH * 0.2700, screenW * 0.2225, screenH * 0.0400, tocolor(0, 0, 0, 222), false)
        dxDrawLine(screenW * 0.3787, screenH * 0.3100, screenW * 0.6000, screenH * 0.3083, tocolor(79, 144, 241, 208), 2, false)
        dxDrawText("Dados Do Cidadão", screenW * 0.3775, screenH * 0.2650, screenW * 0.6000, screenH * 0.3117, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.3787, screenH * 0.3117, screenW * 0.2213, screenH * 0.2833, tocolor(0, 0, 0, 203), false)
        dxDrawText("Idade:"..Idade.."|" "Peso:"..Peso, screenW * 0.3787, screenH * 0.3100, screenW * 0.6012, screenH * 0.3567, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawLine(screenW * 0.3775, screenH * 0.3583, screenW * 0.5988, screenH * 0.3567, tocolor(79, 144, 241, 208), 2, false)
        dxDrawText("ID:"..ID.. "|" "Level:"..Level, screenW * 0.3775, screenH * 0.3567, screenW * 0.6000, screenH * 0.4033, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawLine(screenW * 0.3775, screenH * 0.4050, screenW * 0.5988, screenH * 0.4033, tocolor(79, 144, 241, 208), 2, false)
        dxDrawLine(screenW * 0.3775, screenH * 0.4517, screenW * 0.5988, screenH * 0.4500, tocolor(79, 144, 241, 208), 2, false)
        dxDrawText("Porte De Armas: "..Porte, screenW * 0.3775, screenH * 0.4033, screenW * 0.6000, screenH * 0.4500, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawText("Mandatos: "..Wanted, screenW * 0.3775, screenH * 0.4517, screenW * 0.6000, screenH * 0.4983, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawLine(screenW * 0.3775, screenH * 0.5000, screenW * 0.5988, screenH * 0.4983, tocolor(79, 144, 241, 208), 2, false)
        dxDrawLine(screenW * 0.3775, screenH * 0.5483, screenW * 0.5988, screenH * 0.5467, tocolor(79, 144, 241, 208), 2, false)
        dxDrawText("Dinheiro Sujo: "..DinheiroSujo, screenW * 0.3787, screenH * 0.5000, screenW * 0.6012, screenH * 0.5467, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawText("Dinheiro Limpo: "..Dinheiro, screenW * 0.3787, screenH * 0.5483, screenW * 0.6012, screenH * 0.5950, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
end

        MotivoMulta = guiCreateEdit(x*595, y*302, x*178, y*23, "", false)
guiSetAlpha ( MotivoMulta, 0.85 )
guiEditSetMaxLength ( MotivoMulta, 100)
guiSetVisible ( MotivoMulta, false )

        ValorMulta = guiCreateEdit(x*596, y*330, x*178, y*23, "", false)    
 guiSetAlpha ( ValorMulta, 0.85 )
guiEditSetMaxLength ( ValorMulta, 100)
guiSetVisible ( ValorMulta, false )

		local bmotivo = guiCreateButton(screenW * 0.4107, screenH * 0.4805, screenW * 0.1413, screenH * 0.0299,"",false)
		guiSetAlpha(bmotivo,0)

		local bfechar = guiCreateButton(screenW * 0.4107, screenH * 0.5130, screenW * 0.1413, screenH * 0.0299,"",false)
		guiSetAlpha(bfechar,0)

		addEventHandler("onClientGUIClick",bmotivo,
		function ()
		if VMultar == true then
		local motivo = guiGetText(MotivoMulta)
		local valor = guiGetText(ValorMulta)
		setElementData(localPlayer,"L:MotivoMulta",motivo)
		setElementData(localPlayer,"L:ValorMulta",valor)
		triggerServerEvent("L:MultouJogador",localPlayer)
    end
end)

addEventHandler("onClientGUIClick",bfechar,
		function ()
		if VMultar == true then
removeEventHandler("onClientRender", root, darmulta)

VMultar = false
showCursor(false)
guiSetVisible ( MotivoMulta, false )
guiSetVisible ( ValorMulta, false )
AbrirPainelS()
    end
end)

local screenW, screenH = guiGetScreenSize()

    function darmulta()
        dxDrawRectangle(screenW * 0.3895, screenH * 0.3620, screenW * 0.1867, screenH * 0.2031, tocolor(27, 27, 27, 255), false)
        dxDrawText("MULTAR", screenW * 0.3902, screenH * 0.3633, screenW * 0.5761, screenH * 0.3828, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("MOTIVO:", screenW * 0.3895, screenH * 0.3958, screenW * 0.4363, screenH * 0.4232, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("VALOR:", screenW * 0.3895, screenH * 0.4297, screenW * 0.4363, screenH * 0.4570, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.4107, screenH * 0.4805, screenW * 0.1413, screenH * 0.0299, mul1, false)
        dxDrawText("MULTAR", screenW * 0.4107, screenH * 0.4805, screenW * 0.5520, screenH * 0.5104, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawRectangle(screenW * 0.4107, screenH * 0.5130, screenW * 0.1413, screenH * 0.0299, mul2, false)
        dxDrawText("VOLTAR", screenW * 0.4107, screenH * 0.5130, screenW * 0.5520, screenH * 0.5430, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
    mul1 =tocolor(0, 0, 1, 255)
        mul2 = tocolor(0, 0, 1, 255)
        if isCursorOnElement(screenW * 0.4107, screenH * 0.4805, screenW * 0.1413, screenH * 0.0299) then mul1 = tocolor(0, 100, 200, 255) end
        if isCursorOnElement(screenW * 0.4107, screenH * 0.5130, screenW * 0.1413, screenH * 0.0299) then mul2 = tocolor(0, 100, 200, 255) end
    end

function FecharPainelS()
	removeEventHandler("onClientRender",root,DxRevistar)
    Painel = false
    showCursor(false)
end

function AbrirPainelS()
	addEventHandler("onClientRender",root,DxRevistar)
    Painel = true
    showCursor(true)
end

function ClicarIdentidade (_,state)
 if Identidade == true then
  if state == "down" then
   if isCursorOnElement (screenW * 0.4114, screenH * 0.3242, screenW * 0.4275, screenH * 0.3529) then
playSoundFrontEnd ( 44 )
removeEventHandler("onClientRender", root, DxIdentidade)
Identidade = false
AbrirPainelS()
   end
  end
 end
end
addEventHandler ("onClientClick", root, ClicarIdentidade )

function ClicarNosBotoes (_,state)
 if Painel == true then
  if state == "down" then
   if isCursorOnElement (screenW * 0.3624, screenH * 0.3516, screenW * 0.1603, screenH * 0.0391) then
    triggerServerEvent ("L:VIdentidade", getLocalPlayer(), localPlayer)
playSoundFrontEnd ( 44 )
FecharPainelS()
addEventHandler("onClientRender", root, DxIdentidade)
Identidade = true
showCursor(true)

elseif isCursorOnElement(screenW * 0.3624, screenH * 0.3958, screenW * 0.1603, screenH * 0.0391) then
    triggerServerEvent ("L:VCNH", getLocalPlayer(), localPlayer)
playSoundFrontEnd ( 44 )
    elseif isCursorOnElement(screenW * 0.3624, screenH * 0.4414, screenW * 0.1603, screenH * 0.0391) then
playSoundFrontEnd ( 44 )
FecharPainelS()
addEventHandler("onClientRender", root, darmulta)
VMultar = true
showCursor(true)
guiSetVisible ( MotivoMulta, true )
guiSetVisible ( ValorMulta, true )
guiSetText(MotivoMulta, "")
guiSetText(ValorMulta,"")
    elseif isCursorOnElement(screenW * 0.3624, screenH * 0.4870, screenW * 0.1603, screenH * 0.0391) then
    triggerServerEvent ("L:VAlgemar", getLocalPlayer(), localPlayer)
playSoundFrontEnd ( 44 )

    elseif isCursorOnElement(screenW * 0.3624, screenH * 0.5313, screenW * 0.1603, screenH * 0.0391) then
    triggerServerEvent ("L:VRevistar", getLocalPlayer(), localPlayer)
playSoundFrontEnd ( 44 )
    elseif isCursorOnElement(screenW * 0.3624, screenH * 0.5768, screenW * 0.1603, screenH * 0.0391) then
    triggerServerEvent ("L:VDrogas", getLocalPlayer(), localPlayer)
playSoundFrontEnd ( 44 )
    elseif isCursorOnElement(screenW * 0.3624, screenH * 0.6224, screenW * 0.1603, screenH * 0.0391) then
    triggerServerEvent ("L:VArmas", getLocalPlayer(), localPlayer)
playSoundFrontEnd ( 44 )
    elseif isCursorOnElement(screenW * 0.3624, screenH * 0.6693, screenW * 0.1603, screenH * 0.0391) then
    triggerServerEvent ("L:VPrender", getLocalPlayer(), localPlayer)
    playSoundFrontEnd ( 44 )
   end
  end
 end
end
addEventHandler ("onClientClick", root, ClicarNosBotoes )

function isCursorOnElement( x,y,w,h )
local mx,my = getCursorPosition ()
local fullx,fully = guiGetScreenSize()
cursorx,cursory = mx*fullx,my*fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end

 

Vi a linha 86 e não consegui encontrar o erro...

E sobre o "Iniciou_Evento" eu não manjo mt de script, pelo que parece precisa adicionar isso no clientside, porém não sei como...

Poderiam me ajudar? 

Link to comment
  • Other Languages Moderators

Na linha 86, não era pra ter colocado aquelas duas aspas ali. Ou então deveria ter concatenado as duas partes.

Troque a linha por isso:

dxDrawText("Idade: "..Idade.."|Peso: "..Peso, screenW * 0.3787, screenH * 0.3100, screenW * 0.6012, screenH * 0.3567, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center")

 

Link to comment
 dxDrawText("Idade:"..tostring(Idade).." | Peso:"..tostring(Peso), screenW * 0.3787, screenH * 0.3100, screenW * 0.6012, screenH * 0.3567, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false)

Linha 88, com o mesmo erro:
 

 dxDrawText("ID:"..tostring(ID).. " | Level:"..tostring(Level), screenW * 0.3775, screenH * 0.3567, screenW * 0.6000, screenH * 0.4033, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false)

E sempre use tostring quando concatenar valores.

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...