Jump to content

[AJUDA] RG


Recommended Posts

Posted

OI NOVAMENTE

Estou com um erro nesse script mais não sei arrumar, vocês podem me ajudar? O erro em sí e que ele não abre ao ativa-lo, mesmo estando mostrando que esta ligado na lista de resource ele não funciona.


local screenW, screenH = guiGetScreenSize()
local resW, resH = 1360,768
local x, y = (screenW/resW), (screenH/resH) 

local dxfont0_Fonte = dxCreateFont("Files/fonte.ttf", 10)
local dxfont1_Fonte = dxCreateFont("Files/fonte.ttf", 12)

local nome = createElement("dxEditBox3") 
local dataNascimento = createElement("dxEditBox3") 
local sexo = createElement("dxEditBox3") 
local localOrigem = createElement("dxEditBox3") 

function dxRG ()

    exports["[FM]Blur"]:dxDrawBluredRectangle(screenW * 0.3843, screenH * 0.2344, screenW * 0.2277, screenH * 0.5534, tocolor(255, 255, 255, 255))
    dxDrawRectangle(screenW * 0.3843, screenH * 0.2344, screenW * 0.2277, screenH * 0.5534, tocolor(0, 0, 0, 160), false)
    dxDrawEditBox("Nome", screenW * 0.4165, screenH * 0.3633, screenW * 0.1633, screenH * 0.0313, false, 25, nome) 
    dxDrawEditBox("Data de Nascimento", screenW * 0.4173, screenH * 0.4349, screenW * 0.1633, screenH * 0.0313, false, 10, dataNascimento) 
    dxDrawEditBox("Sexo", screenW * 0.4165, screenH * 0.5065, screenW * 0.1633, screenH * 0.0313, false, 9, sexo) 
    dxDrawEditBox("Local de Origem", screenW * 0.4165, screenH * 0.5781, screenW * 0.1633, screenH * 0.0313, false, 20, localOrigem) 
    dxDrawImage(screenW * 0.4400, screenH * 0.6510, screenW * 0.1157, screenH * 0.0521, "Files/button.png", 0, 0, 0, corBotaoDefinir, false)
    corBotaoDefinir = tocolor(255, 0, 0, 160)   
    if cursorPosition(screenW * 0.4400, screenH * 0.6510, screenW * 0.1157, screenH * 0.0521) then
    corBotaoDefinir = tocolor(255, 0, 0, 200)
end
	dxDrawText("Definir", screenW * 0.4407, screenH * 0.6484, screenW * 0.5556, screenH * 0.7031, tocolor(255, 255, 255, 255), 1.00, dxfont1_Fonte, "center", "center", false, false, false, false, false)
    dxDrawText("Agradecimentos", screenW * 0.3843, screenH * 0.7487, screenW * 0.6120, screenH * 0.7786, tocolor(255, 255, 255, 255), 1.00, dxfont0_Fonte, "center", "center", false, false, false, false, false)
    dxDrawRectangle(525, 601, 311, 4, tocolor(255, 0, 0, 160), false)
    dxDrawText("Notamos que é sua primeira vez na cidade", screenW * 0.3953, screenH * 0.2708, screenW * 0.5996, screenH * 0.2956, tocolor(255, 255, 255, 255), 1.00, dxfont0_Fonte, "left", "top", false, false, false, false, false)
    dxDrawText("Por Favor preenche os dados abaixo.", screenW * 0.3953, screenH * 0.2950, screenW * 0.5732, screenH * 0.3268, tocolor(255, 255, 255, 255), 1.00, dxfont0_Fonte, "left", "top", false, false, false, false, false)
    dxDrawText("NAME SERVER", screenW * 0.3953, screenH * 0.2422, screenW * 0.4788, screenH * 0.2669, tocolor(255, 0, 0, 255), 1.00, dxfont0_Fonte, "left", "top", false, false, false, false, false)
	if getElementData(localPlayer, "D13:MsgErro") then
	exports["[FM]Blur"]:dxDrawBluredRectangle(screenW * 0.0073, screenH * 0.3008, screenW * 0.1816, screenH * 0.0404, tocolor(255, 255, 255, 255))
	dxDrawRectangle(screenW * 0.0073, screenH * 0.3008, screenW * 0.1816, screenH * 0.0404, tocolor(0, 0, 0, 160), false)
    dxDrawRectangle(screenW * 0.0073, screenH * 0.3372, screenW * 0.1816, screenH * 0.0039, tocolor(255, 0, 0, 160), false)
    dxDrawText(""..getElementData(localPlayer, "D13:MsgErro"), screenW * 0.0146, screenH * 0.3008, screenW * 0.1640, screenH * 0.3372, tocolor(255, 255, 255, 255), 1.00, dxfont0_Fonte, "left", "center", false, false, false, false, false)
	end
end

function dxMsg ()

	if getElementData(localPlayer, "D13:Msg") then
    exports["[FM]Blur"]:dxDrawBluredRectangle(screenW * 0.0073, screenH * 0.3008, screenW * 0.2006, screenH * 0.0404, tocolor(255, 255, 255, 255))
    dxDrawRectangle(screenW * 0.0073, screenH * 0.3008, screenW * 0.2006, screenH * 0.0404, tocolor(0, 0, 0, 160), false)
    dxDrawRectangle(screenW * 0.0073, screenH * 0.3372, screenW * 0.2006, screenH * 0.0039, tocolor(255, 0, 0, 160), false)
    dxDrawText(""..getElementData(localPlayer, "D13:Msg"), screenW * 0.0146, screenH * 0.3008, screenW * 0.2042, screenH * 0.3372, tocolor(255, 255, 255, 255), 1.00, dxfont0_Fonte, "left", "center", false, false, false, false, false)
	end

end

camera = {
	[1] = {1785.5252685547,-1670.3322753906,197.42810058594,1824.4713134766,-1419.6008300781,206.25146484375,298.618, -1781.733, 46.114}, 
	[2] = {341.279, -2012.911, 28.072,2424.805, -1727.568, 44.648,-1579.8115234375,606.18676757813,61.850708007813}, 
	[3] = {657.015, -1202.206, 58.425,1472.077, -1413.87, 84.744,2210.75, -1038.502, 88.452}, 
	[4] = {1281.0335693359,-884.94543457031,86.771049499512,1415.4288330078,-907.2900390625,85.035575866699,1415.4951171875,-808.62286376953,87.2880859375}
}

local i = 1
local dx = 0.0
function cameramov ()
    if dx < 1 then
        dx = dx+0.001
		    local _x, _y, _z = interpolateBetween ( camera[i][1], camera[i][2], camera[i][3], camera[i][4], camera[i][5], camera[i][6], dx, "SineCurve")
		    setCameraMatrix ( _x, _y, _z, camera[i][7], camera[i][8], camera[i][9])
	elseif dx > 0 then
        _x, _y, _z = nil, nil, nil
	    dx = 0.0
		i = i + 1
		if ( i >= 7) then
		    i = 1
			dx = 0.0
		end	
	end
end

function abrirDx()
  if not isEventHandlerAdded("onClientRender", getRootElement(), dxRG) then
     showChat(false)
     addEventHandler ( "onClientRender",root,renderBlur)
     musica = playSound( "Files/sound.mp3", true )
     addEventHandler("onClientRender",root,cameramov)
     addEventHandler ("onClientRender", root, dxRG)
	 addEventHandler ("onClientRender", root, dxMsg)
     showCursor(true)
	 else
	 removeEventHandler ("onClientRender" , root, dxRG)
	 showCursor(false)
	 setTimer(function()
	 removeEventHandler ("onClientRender" , root, dxMsg)
	 end, 2500, 1)
    end
end
addEvent("D13:abrirDx",true)
addEventHandler( "D13:abrirDx", getRootElement( ), abrirDx)

function ConfigurarBrancos ()
	if isEventHandlerAdded("onClientRender", getRootElement(), dxRG) then
	    local nome1 = getElementData(nome, "text2")
        local dataNascimento1 = getElementData(dataNascimento, "text2")
        local sexo1 = getElementData(sexo, "text2") 
        local localOrigem1 = getElementData(localOrigem, "text2")
		FeniXMTA_01 = nome1
		FeniXMTA_02 = dataNascimento1
		FeniXMTA_03 = sexo1
		FeniXMTA_04 = localOrigem1
	end
end
setTimer ( ConfigurarBrancos, 50, 0 )

FeniXMTA_01 = 0
FeniXMTA_02 = 0
FeniXMTA_03 = 0
FeniXMTA_04 = 0
FeniXMTA_05 = 0

function definirRG (_,state)
 if isEventHandlerAdded("onClientRender", root, dxRG) then  
  if state == "down" then
  if cursorPosition (screenW * 0.4400, screenH * 0.6510, screenW * 0.1157, screenH * 0.0521) then 
  local nome1 = getElementData(nome, "text2")
  local dataNascimento1 = getElementData(dataNascimento, "text2")
  local sexo1 = getElementData(sexo, "text2") 
  local localOrigem1 = getElementData(localOrigem, "text2")
  if nome1 == "" or dataNascimento1 == "" or sexo1 == "" or localOrigem1 == "" then
  setElementData(localPlayer, "D13:MsgErro", "Preenche os dados Primeiro!")
  setTimer(function()
  setElementData(localPlayer, "D13:MsgErro", false)
  end, 2500, 1)
  return
  end
  removeEventHandler ( "onClientRender",root, renderBlur)
  removeEventHandler("onClientRender",root,cameramov)
  setCameraTarget(getLocalPlayer())
  abrirDx()
  showChat(true)
  stopSound( musica )
  setElementData(localPlayer, "D13:Msg", "Registro feito com Sucesso , Parabéns!")
  setTimer(function()
  setElementData(localPlayer, "D13:Msg", false)
  setElementData ( localPlayer, "D13_RG_Nome", ""..FeniXMTA_01.."" )
  setElementData ( localPlayer, "D13_RG_DataNascimento", ""..FeniXMTA_02.."" )
  setElementData ( localPlayer, "D13_RG_Sexo", ""..FeniXMTA_03.."" )
  setElementData ( localPlayer, "D13_RG_LocalOrigem", ""..FeniXMTA_04.."" )
  end, 2500, 1)
	  end
    end
  end
end
addEventHandler ( "onClientClick", root, definirRG )

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

function cursorPosition(x, y, w, h)
	if (not isCursorShowing()) then
		return false
	end
	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	

local screenWidth, screenHeight = guiGetScreenSize()
local blurStrength = 1
local ScreenSource = dxCreateScreenSource(screenWidth, screenHeight)
local blurShader = dxCreateShader("Files/blur.fx")

function renderBlur()
    if (blurShader) then
        dxUpdateScreenSource(ScreenSource)
        dxSetShaderValue(blurShader, "ScreenSource", ScreenSource);
        dxSetShaderValue(blurShader, "BlurStrength", blurStrength);
        dxSetShaderValue(blurShader, "UVSize", screenWidth, screenHeight);
        dxDrawImage(0, 0, screenWidth, screenHeight, blurShader)
    end
end	

 

SE O TAL ERRO NÃO ESTIVER NESSE TALVEZ ESTEJA NESSE OUTRO


addEventHandler("onPlayerLogin", root, 
function (_, account) 
   if not getAccountData(account, "salvarDx") then 
    triggerClientEvent( source,"D13:abrirDx", getRootElement())
    setAccountData(account, "salvarDx", true) 
	end 
end)

addEventHandler("onPlayerLogin", root,
function( _, acc )
 CarregarLoginPlay ( acc )
 end
)

function CarregarLoginPlay ( conta )
	if not isGuestAccount ( conta ) then
		if conta then	
			local source = getAccountPlayer ( conta )
			local emp = getAccountData ( conta, "D13_RG_Nome" ) or "N/C"
			setElementData ( source, "D13_RG_Nome", emp )
			local emp = getAccountData ( conta, "D13_RG_DataNascimento" ) or "N/C"
			setElementData ( source, "D13_RG_DataNascimento", emp )
			local emp = getAccountData ( conta, "D13_RG_Sexo" ) or "N/C"
			setElementData ( source, "D13_RG_Sexo", emp )
			local emp = getAccountData ( conta, "D13_RG_LocalOrigem" ) or "N/C"
			setElementData ( source, "D13_RG_LocalOrigem", emp )
		end
	end	
end

function ReiniciarScript ( res )
	if res == getThisResource ( ) then
		for i, player in ipairs ( getElementsByType ( "player" ) ) do
			local acc = getPlayerAccount ( player )
			if not isGuestAccount ( acc ) then
				CarregarLoginPlay ( acc )
			end
		end
	end
end
addEventHandler ( "onResourceStart", getRootElement ( ), ReiniciarScript )

function SalvarLoginPlay ( conta )
	if conta then
	local source = getAccountPlayer ( conta )
	local rg_Nome = getElementData ( source, "D13_RG_Nome" ) or "N/C"
	setAccountData ( conta, "D13_RG_Nome", rg_Nome )
	local rg_DataNascimento = getElementData ( source, "D13_RG_DataNascimento" ) or "N/C"
	setAccountData ( conta, "D13_RG_DataNascimento", rg_DataNascimento )
	local rg_Sexo = getElementData ( source, "D13_RG_Sexo" ) or "N/C"
	setAccountData ( conta, "FeniX_RG_Sexo", rg_Sexo )
	local rg_LocalOrigem = getElementData ( source, "D13_RG_LocalOrigem" ) or "N/C"
	setAccountData ( conta, "D13_RG_LocalOrigem", rg_LocalOrigem )
	end	
end

function DesligarScript ( res )
    if res == getThisResource ( ) then
		for i, player in ipairs ( getElementsByType ( "player" ) ) do
			local acc = getPlayerAccount ( player )
			if not isGuestAccount ( acc ) then
				SalvarLoginPlay ( acc )
			end
		end
	end
end 
addEventHandler ( "onResourceStop", getRootElement ( ), DesligarScript )

function JogadorQuit ( quitType )
	local acc = getPlayerAccount ( source )
	if not isGuestAccount ( acc ) then
		if acc then
			SalvarLoginPlay ( acc )
		end
	end
end
addEventHandler ( "onPlayerQuit", getRootElement ( ), JogadorQuit ) 

 

  • Moderators
Posted

Relogue depois de iniciar o resource.

  • Thanks 1

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

Tenho esse resource e funciona perfeitamente! porém o menu só aparece para que não tem os data D13_RG_Nome, nascimento e etc..

Reloga e cria uma nova conta que vai aparecer.

  • Thanks 1
Posted
49 minutes ago, Lord Henry said:

Relogue depois de iniciar o resource.

Não funcionou

39 minutes ago, Madruga said:

Tenho esse resource e funciona perfeitamente! porém o menu só aparece para que não tem os data D13_RG_Nome, nascimento e etc..

Reloga e cria uma nova conta que vai aparecer.

Obrigado pela dica, mas mesmo assim não funcionou.

Posted (edited)

Troque o seguinte trecho para testar se abre:

addEventHandler("onPlayerLogin", root, 
function (_, account) 
    -- if not getAccountData(account, "salvarDx") then 
      triggerClientEvent( source,"D13:abrirDx", getRootElement())
      -- setAccountData(account, "salvarDx", true) 
    -- end 
end)

 

Edited by MaligNos
  • Thanks 1
Posted
On 06/03/2019 at 16:29, MaligNos said:

Troque o seguinte trecho para testar se abre:


addEventHandler("onPlayerLogin", root, function (_, account)     -- if not getAccountData(account, "salvarDx") then       triggerClientEvent( source,"D13:abrirDx", getRootElement())      -- setAccountData(account, "salvarDx", true)     -- end end)

 

muito obrigado!!!!

 

Posted
20 hours ago, brunob22 said:

ajuda com script q nem e tua? nem to fora ;D acho que todos deveria fazer isso. Esse forum ta virando bagunça ja

Acho  um pouco exagero da sua parte, se este script esta liberado em algum lugar e esta descompilado não vejo problema algum em edita-lo, ao menos que seja vazado.

  • Thanks 1
Posted
4 hours ago, Jonas^ said:

Acho  um pouco exagero da sua parte, se este script esta liberado em algum lugar e esta descompilado não vejo problema algum em edita-lo, ao menos que seja vazado.

ele pode ter descompilado a resource? por isso ta bugada? porque vão soltar resource na net bugada? sem sentindo ou ele pego de quem nao deveria, para nao pedir para o scripter arruma o bug , ou ele descompilo

  • Moderators
Posted

Se o cara compilou pelo luac.multitheftauto.com então não dá pra descompilar. Somente a equipe do MTA tem o descompilador que eles usam para verificar se os resources upados na comunidade são plágio ou sem tem ameaças de vírus. Se o cara tem a versão descompilada, pode crer que não foi ele quem descompilou. Mas ainda sim existe a probabilidade dele ter pego o resource de alguém que não teve o cuidado de compilar.

Edit: Não tinha visto as mensagens do bruno pois elas são bloqueadas pra mim por padrão.

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
11 hours ago, brunob22 said:

ele pode ter descompilado a resource? por isso ta bugada? porque vão soltar resource na net bugada? sem sentindo ou ele pego de quem nao deveria, para nao pedir para o scripter arruma o bug , ou ele descompilo

Olha, acho que você não acompanha muito os blogs ou até mesmo a comunidade. 95% (de resources vindo de blogs) é bugado, mal otimizado e descompilado.

Obs.: Citei blogs pois tenho certeza que o código do rapaz que pediu ajuda é de algum. Basta pesquisar no Google que você acha diversos blogs, a maioria com resources bugados ou postado por quem se acha scripter.

Hello, world.


Tutorial sobre interação de BOTs do Discord com o seu servidor - Visitar (Brazilian Portuguese)
Tutorial sobre tabelas - Visitar (Brazilian Portuguese)
Tutorial sobre banco de dados - Visitar (Brazilian Portuguese)

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