Jump to content

[AJUDA]Me Ajuda a Resolver esse Erro


Recommended Posts

Posted (edited)

Estava Tentando Resolver Outro Bug ai Quando fui testar deu esse erro alguem sabe resolver-lo ?

local screenW, screenH = guiGetScreenSize()
local x, y = (screenW/1366), (screenH/768)

function onClientRender()
        dxDrawRectangle((screenW - 323) / 2, (screenH - 465) / 2, 323, 465, tocolor(0, 0, 0, 185), false)
        dxDrawText("Ak 47", 657, 302, 710, 331, tocolor(255, 255, 255, 255), 2.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawRectangle(519, 299, 323, 3, tocolor(67, 219, 0, 255), false)
        dxDrawImage(471, 321, 320, 110, "Img/30.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawRectangle(519, 403, 323, 3, tocolor(67, 219, 0, 255), false)
        dxDrawRectangle(519, 181, 323, 3, tocolor(67, 219, 0, 255), false)
        dxDrawRectangle(519, 507, 323, 3, tocolor(67, 219, 0, 255), false)
        dxDrawText("Deagle", 644, 406, 697, 435, tocolor(255, 255, 255, 255), 2.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawText("Uzi", 667, 184, 720, 213, tocolor(255, 255, 255, 255), 2.00, "sans", "left", "center", false, false, false, false, false)
        dxDrawImage(513, 221, 240, 110, "Img/28.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(509, 425, 256, 128, "Img/24.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawText("Trafico", 548, 151, 824, 181, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Fechar", 650, 564, 86, 31, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "top", false, false, false, false, false)
		dxDrawText("✖", x*903, y*219, x*918, y*234, tocolor(255, 255, 255, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false)
end

function onClientClick(button, state)
	if isEventHandlerAdded("onClientRender", root, onClientRender) and isEventHandlerAdded("onClientClick", root, onClientClick) then
		if button == "left" and state == "up" then
			elseif isMouseInPosition(650, 564, 86, 31) then
				showCursor(false)
				removeEventHandler("onClientRender", root, onClientRender)
				removeEventHandler("onClientClick", root, onClientClick)
	end
end

function lojaAbrir ()
	if not isEventHandlerAdded("onClientRender", root, onClientRender) and not isEventHandlerAdded("onClientClick", root, onClientClick) then
		showCursor(true)
		addEventHandler("onClientRender", root, onClientRender)
		addEventHandler("onClientClick", root, onClientClick)
	end
end
addEvent("lojaArma", true)
addEventHandler("lojaArma", resourceRoot, lojaAbrir)

function isMouseInPosition ( x, y, width, height )
	if ( not isCursorShowing( ) ) then
		return false
	end
    local sx, sy = guiGetScreenSize ( )
    local cx, cy = getCursorPosition ( )
    local cx, cy = ( cx * sx ), ( cy * sy )
    if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
        return true
    else
        return false
    end
end

function isEventHandlerAdded( sEventName, pElementAttachedTo, func )
	if 
		type( sEventName ) == 'string' and 
		isElement( pElementAttachedTo ) and 
		type( func ) == 'function' 
	then
		local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )
		if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
			for i, v in ipairs( aAttachedFunctions ) do
				if v == func then
					return true
				end
			end
		end
	end

	return false
	end
end

 


cdCJY_ATRS2rc8wFT2Issw.png


Edited by Hize
  • Moderators
Posted

Ele fez uma bagunça no post e colocou a print em outra página.

O erro é este: ERROR: Server triggered clientside event lojaArma, but event is not added clientside.

Está faltando o código server-side para verificarmos.

Ele já criou outro post que também estava faltando a parte server-side.

@Hize assista este vídeo antes de continuar:

 

Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanksspacer.png

Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile
Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment
Discord Oficial do MTA: https://mtasa.com/discord
Blacklist e Whitelist de Scripters: Planilha

Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.

Posted

Ai tu complica hize, Por isso estão ignorando seus tópicos :\ está duplicando tópicos, criando mais de 1 sem resolver nenhum deles antes, e ainda esquece de postar o código corretamente.

Meu comentário foi útil? Deixe um Thanks :D

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