Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 21/02/20 in all areas

  1. It is because you cannot attach your handler to commands like: check ; list ; test Check wiki for more info - https://wiki.multitheftauto.com/wiki/AddCommandHandler Good luck on your adventure with Lua in MTA:SA :)
    2 points
  2. Eu expliquei de formas, um faça um check diretamente no comando, ou utilizando o trigger (você fez os dois, e não adicionou o que eu falei, enfim)... Sabemos que é da net, da pra identifica só pela bagunça, mas, não quer dizer que não pode ajeitar-lo. Teste isso : -- LG7 Scripter - Não remova os créditos por favor! -- Acesse meu canal e tenha mais conteúdos como esse: -- https://www.youtube.com/c/LG7MTA -- Tenha um(a) bom(a) Dia/Tarde/Noite 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" dxDrawLine((screenW * 0.3602) - 1, (screenH * 0.3008) - 1, (screenW * 0.3602) - 1, screenH * 0.7292, tocolor(0, 100, 200, 255), 1, false) dxDrawLine(screenW * 0.5256, (screenH * 0.3008) - 1, (screenW * 0.3602) - 1, (screenH * 0.3008) - 1, tocolor(0, 100, 200, 255), 1, false) dxDrawLine((screenW * 0.3602) - 1, screenH * 0.7292, screenW * 0.5256, screenH * 0.7292, tocolor(0, 100, 200, 255), 1, false) dxDrawLine(screenW * 0.5256, screenH * 0.7292, screenW * 0.5256, (screenH * 0.3008) - 1, tocolor(0, 100, 200, 255), 1, false) dxDrawRectangle(screenW * 0.3602, screenH * 0.3008, screenW * 0.1654, screenH * 0.4284, tocolor(47, 47, 47, 255), false) dxDrawText("Nome: #0064c8"..IdRevistado, screenW * 0.3624, screenH * 0.3086, screenW * 0.5227, screenH * 0.3385, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, true, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.3516, screenW * 0.1603, screenH * 0.0391, Cor1, false) dxDrawText("Identidade", screenW * 0.4056, screenH * 0.3516, screenW * 0.4802, screenH * 0.3906, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.3958, screenW * 0.1603, screenH * 0.0391, Cor2, false) dxDrawText("Checar CNH", screenW * 0.4056, screenH * 0.3958, screenW * 0.4802, screenH * 0.4349, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.4414, screenW * 0.1603, screenH * 0.0391, Cor3, false) dxDrawText("Multar", screenW * 0.4056, screenH * 0.4414, screenW * 0.4802, screenH * 0.4805, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.4870, screenW * 0.1603, screenH * 0.0391, Cor4, false) dxDrawText("Algemar", screenW * 0.4056, screenH * 0.4870, screenW * 0.4802, screenH * 0.5260, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.5313, screenW * 0.1603, screenH * 0.0391, Cor5, false) dxDrawText("Revistar", screenW * 0.4056, screenH * 0.5313, screenW * 0.4802, screenH * 0.5703, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.5768, screenW * 0.1603, screenH * 0.0391, Cor6, false) dxDrawText("Apreender drogas", screenW * 0.4056, screenH * 0.5768, screenW * 0.4802, screenH * 0.6159, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.6224, screenW * 0.1603, screenH * 0.0391, Cor7, false) dxDrawText("Apreender armas", screenW * 0.4056, screenH * 0.6224, screenW * 0.4802, screenH * 0.6615, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.6693, screenW * 0.1603, screenH * 0.0391, Cor8, false) dxDrawText("Prender", screenW * 0.4056, screenH * 0.6693, screenW * 0.4802, screenH * 0.7083, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.5183, screenH * 0.3516, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.3958, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.4414, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.4870, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.5313, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.5768, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.6224, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.6693, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), 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) if isCursorOnElement(screenW * 0.3624, screenH * 0.3516, screenW * 0.1603, screenH * 0.0391) then Cor1 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.3958, screenW * 0.1603, screenH * 0.0391) then Cor2 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.4414, screenW * 0.1603, screenH * 0.0391) then Cor3 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.4870, screenW * 0.1603, screenH * 0.0391) then Cor4 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.5313, screenW * 0.1603, screenH * 0.0391) then Cor5 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.5768, screenW * 0.1603, screenH * 0.0391) then Cor6 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.6224, screenW * 0.1603, screenH * 0.0391) then Cor7 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.6693, screenW * 0.1603, screenH * 0.0391) 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:AirNewSCR_Porte_de_Armas")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, "ID") or "N/A" local DinheiroSujo =getElementData(localPlayer, "Suspeito:moneysujo") or "0" dxDrawRectangle(screenW * 0.4114, screenH * 0.3216, screenW * 0.2584, screenH * 0.3099, tocolor(47, 47, 47, 255), false) dxDrawText("<", screenW * 0.4114, screenH * 0.3242, screenW * 0.4275, screenH * 0.3529, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Nome:", screenW * 0.4290, screenH * 0.3659, screenW * 0.4810, screenH * 0.3815, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Idade:", screenW * 0.4290, screenH * 0.3945, screenW * 0.4810, screenH * 0.4102, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Peso:", screenW * 0.4290, screenH * 0.4232, screenW * 0.4810, screenH * 0.4388, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Altura:", screenW * 0.4290, screenH * 0.4518, screenW * 0.4810, screenH * 0.4674, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Sexo:", screenW * 0.4290, screenH * 0.4805, screenW * 0.4810, screenH * 0.4961, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("ID: ", screenW * 0.4290, screenH * 0.5091, screenW * 0.4810, screenH * 0.5247, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Level:", screenW * 0.4290, screenH * 0.5378, screenW * 0.4810, screenH * 0.5534, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Porte de Armas:", screenW * 0.4290, screenH * 0.5664, screenW * 0.4810, screenH * 0.5820, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, true, false, false) dxDrawText("Nível de procurado:", screenW * 0.4290, screenH * 0.5951, screenW * 0.4810, screenH * 0.6107, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, true, false, false) dxDrawText("Dinheiro Limpo:", screenW * 0.5198, screenH * 0.3945, screenW * 0.5717, screenH * 0.4102, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Dinheiro Sujo:", screenW * 0.5198, screenH * 0.4258, screenW * 0.5717, screenH * 0.4414, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Nome.." "..Sobrenome, screenW * 0.4634, screenH * 0.3659, screenW * 0.6603, screenH * 0.3815, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Idade, screenW * 0.4605, screenH * 0.3945, screenW * 0.5124, screenH * 0.4102, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Peso, screenW * 0.4605, screenH * 0.4232, screenW * 0.5124, screenH * 0.4388, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Altura, screenW * 0.4634, screenH * 0.4518, screenW * 0.5124, screenH * 0.4674, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Sexo, screenW * 0.4597, screenH * 0.4805, screenW * 0.5124, screenH * 0.4961, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(ID, screenW * 0.4451, screenH * 0.5091, screenW * 0.4978, screenH * 0.5247, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Level, screenW * 0.4627, screenH * 0.5378, screenW * 0.5154, screenH * 0.5534, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Porte, screenW * 0.5081, screenH * 0.5664, screenW * 0.5608, screenH * 0.5820, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Wanted, screenW * 0.5227, screenH * 0.5951, screenW * 0.5754, screenH * 0.6107, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("R$ "..Dinheiro, screenW * 0.5966, screenH * 0.3945, screenW * 0.6493, screenH * 0.4102, tocolor(97, 255, 101, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("R$ "..DinheiroSujo, screenW * 0.5893, screenH * 0.4258, screenW * 0.6420, screenH * 0.4414, tocolor(255, 79, 79, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Identidade", screenW * 0.4693, screenH * 0.3281, screenW * 0.6237, screenH * 0.3529, tocolor(255, 255, 255, 255), 1.00, "sans", "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 Server-side -- LG7 Scripter - Não remova os créditos por favor! -- Acesse meu canal e tenha mais conteúdos como esse: -- https://www.youtube.com/c/LG7MTA -- Tenha um(a) bom(a) Dia/Tarde/Noite 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, "AirNewSCR_Porte_de_Armas") or "Não possui" local Wanted = getPlayerWantedLevel(cliente) local Dinheiro = getPlayerMoney(cliente) local Level = getElementData(cliente, "Level") or "0" local ID = getElementData(cliente, "ID") or "N/A" local DinheiroSujo =getElementData(cliente, "moneysujo") 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:AirNewSCR_Porte_de_Armas",Porte) setElementData(source, "Suspeito:Wanted",Wanted) setElementData(source, "Suspeito:Dinheiro",Dinheiro) setElementData(source, "Suspeito:Level",Level) setElementData(source, "Suspeito:ID",ID) setElementData(source, "Suspeito:moneysujo", DinheiroSujo) 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("v",AbrirPainel) function VCNH () if getElementData(cliente, "DNL:TestePratico", true ) then return end if getElementData(cliente, "DNL:Categoria(A)", true) then local moto = "Moto" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..moto, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(A)", false) then local moto = "Moto Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..moto, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(B)", true) then local carros = "Carro" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carros, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(B)", true) then local carros = "Carro Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carros, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(C)", true) then local caminhao = "Caminhão" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..caminhao, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(C)", true) then local caminhao = "Caminhão Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..caminhao, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(D)", true) then local carreta = "Carreta" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carreta, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(D)", true) then local carreta = "Carreta Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carreta, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(E)", true) then local helicoptero = "Helicoptero" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..helicoptero, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(E)", true) then local helicoptero = "Helicoptero Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..helicoptero, source, 255,255,255,true) end --else CNH = " false" then --local CNHN = ("Não Possui") --outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..CNHN, 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) 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 = getElementModel ( theVehicle ) if id == 596 or 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
    1 point
  3. local tempoMensagem = 5 -- Tempo em minutos para aparecer a mensagem local enviarMensagem = { "#FFFFFFO banco cobrou #FFFF00{1} #FFFFFFda sua conta.", "#FFFFFFVocê perdeu #FFFF00{1} #FFFFFFquando estava a caminho do trabalho." } setTimer(function() for _, player in ipairs(getElementsByType("player")) do local value = math.random(100, 1000) takePlayerMoney(player, value) local randomMessage = enviarMensagem[math.random(1, #enviarMensagem)] outputChatBox(format(randomMessage, value), root, 255, 255, 255, true) end end, 60000 * tempoMensagem, 0) function format(s, ...) local result = s for k, v in ipairs({...}) do result = string.gsub(result, string.format("{%d}",k), v) end return result end
    1 point
  4. Pentru a adauga un mod pe skin foloseste txd = engineLoadTXD ("skin.txd") engineImportTXD (txd, id) dff = engineLoadDFF ("skin.dff") engineReplaceModel (dff, id) Pentru a edita skin-ul foloseste TXDWorkshop sau ZModeler
    1 point
  5. Bom eu faria desta forma, ao meu ver é mais fácil: enterMarker = { -- index valor [1] = {createMarker(1170.88306, -1489.64990, 22.75516 - 1, "cylinder", 2, 0, 20, 255, 160)}, -- marker 1 [2] = {createMarker(1147.24207, -1487.55115, 22.76903 - 1, "cylinder", 2, 0, 20, 255, 160)}, -- marker 2 [3] = {createMarker(1159.714, -1511.431, 22.748 - 1, "cylinder", 2, 0, 20, 255, 160)}, -- marker 3 }; for i=1, #enterMarker do createBlipAttachedTo(enterMarker[i][1], 45) -- mesma coisa do seu createMarker porém com blip e com um for diferente. end -- abaixo a funcaoExemplo, vc pode criar funções proprias e automatizar seu script. -- em vez de eu colocar setElementModel em cada if/elseif, eu chamo a função que já faz isso por mim. function funcaoExemplo(playerSource, number) -- abaixo o setElementModel. -- se vc for na wiki essa função requer um player ou um ped (playerSource), e tambem o modelo no caso o (number) setElementModel(playerSource, number) end function hitarMarker(marker, dim) if dim then -- abaixo ele verifica se o marker hitado é equivalente ao index [1] valor [1] da tabela enterMarker, ou seja a marker criada 1. if marker == enterMarker[1][1] then outputChatBox("loja 1", source, 0, 255, 0) funcaoExemplo(source, 1) -- chamando a função criada por mim, setando ao source (player) a skin (1) elseif marker == enterMarker[2][1] then -- verificação no index [2] valor [1] outputChatBox("loja 2", source, 0, 255, 0) funcaoExemplo(source, 2) -- chamando a função criada por mim, setando ao source (player) a skin (2) elseif marker == enterMarker[3][1] then -- verificação no index [3] valor [1] outputChatBox("loja 3", source, 0, 255, 0) funcaoExemplo(source, 7) -- chamando a função criada por mim, setando ao source (player) a skin (7) end end end addEventHandler("onPlayerMarkerHit", getRootElement(), hitarMarker)
    1 point
  6. Oh my god. I feel so embarrassed. Thank you very much!, @ReZurrecti0n and @majqq
    1 point
  7. Ah yes, majqq is right, thank you So try changing the command from "test" to "showexample" or anything more unique that wouldn't mix with already existing hard coded commands
    1 point
  8. Joaca-te cu functiile de pe wiki pe un server local sa vezi fiecare ce face.
    1 point
  9. Thank you, you're right, thank you for pointing that out
    1 point
  10. @ReZurrecti0n line 16 : you forgot to add = if number == 3 then
    1 point
  11. Você tirou o evento do client "onClientResourceStart" do painel, por isso não abre pois, o painel não foi criado para o jogador. Ex: addEventHandler("onClientResourceStart", resourceRoot, function () Painel = guiCreateWindow(258, 158, 484, 470, "Painel VIP", false) guiWindowSetSizable(Painel, false) PegarArmas = guiCreateButton(0.04, 0.16, 0.27, 0.11, "armas", true, Painel) guiSetFont(PegarArmas, "default-bold-small") guiSetProperty(PegarArmas, "NormalTextColour", "E947F9AB") pegarCarro = guiCreateButton(0.04, 0.39, 0.27, 0.12, "carro", true, Painel) guiSetFont(pegarCarro, "default-bold-small") guiSetProperty(pegarCarro, "NormalTextColour", "E947F9AB") PegarJetpack = guiCreateButton(0.05, 0.67, 0.27, 0.13, "jetpack", true, Painel) guiSetFont(PegarJetpack, "default-bold-small") guiSetProperty(PegarJetpack, "NormalTextColour", "E947F9AB") botaodestruir = guiCreateButton(0.38, 0.80, 0.30, 0.10, "destruir", true,Painel) guiSetFont(botaodestruir, "default-bold-small") guiSetProperty(botaodestruir, "NormalTextColour", "FF0AF468") addEventHandler("onClientGUIClick",PegarArmas,ClicarNoBotao) addEventHandler("onClientGUIClick",PegarJetpack,CliaBotao) addEventHandler("onClientGUIClick",pegarCarro,ClicaBotao) addEventHandler("onClientGUIClick",botaodestruir,CliaBot) guiSetVisible (Painel, false) --/> Adicionar ! end)
    1 point
  12. Ta na mão chefe! Adicione isso: Server addCommandHandler ("vip", function (thePlayer , cmd) if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup ("VIP")) then triggerClientEvent (thePlayer, "mostratVIP", thePlayer) else outputChatBox ("You are not VIP!", thePlayer) end end) Client function abrirPainel () if guiGetVisible (Painel) then guiSetVisible (Painel, false) showCursor (false) else guiSetVisible (Painel, true) showCursor (true) end end addEvent ("mostratVIP", true) addEventHandler ("mostratVIP", getRootElement(), abrirPainel)
    1 point
  13. https://wiki.multitheftauto.com/wiki/Scripting_Introduction
    1 point
  14. elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then cancelEvent(true) outputChatBox("#000000║#ffffff✘ #ff0000Jᴏ#ffff00ɢᴀᴅ#00ff00ᴏʀ#ffffff ✘#000000║ - #FFFFFF"..name.."#FFFFFf:#FFFFFF "..text, root, 255, 255, 255, true) outputServerLog("CHAT: [ Jogador ] " .. name .. ": " .. text) Essa parte toda do Everyone deve ser a última. Isso é erro de lógica. Uma vez que Everyone são TODOS os jogadores, assim que o jogador entra ali, nada mais é executado a partir do Alpha.
    1 point
  15. Sem sentido não abrir, você conseguiu estragar oque estava funcionando, eu testei aqui e abriu.
    1 point
  16. Muito bom cara, meu celebro tá começando a abrir postar para o MTA logo mais eu criarei o MELHOR SERVIDOR DE MTA. Que ainda está em desenvolvimento em meu celebro kkkkkkk Vlw pelo tutorial ajudou pacas
    1 point
  17. I have a problem with the camera using setVehicleGravity and it has strange behaviors when the vehicle is rotated 90 or -90 degrees on the y axis and points to certain directions as in the video https://streamable.com/pfrbt The only solution I could think of is putting gravity with setElementVelocity so I avoid the camera, but the problem is that I have to make my own camera if I want to achieve an effect similar to setVehicleGravity and I don't know the mechanics that the default camera uses I found some interesting topics like these but still I can't imitate the effect of the default camera The most difficult thing is to imitate the effect of the camera when the vehicle turns, which is like a smooth interpolation, but I can't decipher the mechanics. I made several attempts using interpolation and depending on the velocity vector, but nothing seems to mimic it I also found someone who made a similar camera in gta vice city but I don't know how to see his code https://gtaforums.com/topic/896122-classic-axis-visual-camera-improvements/
    0 points
  18. Convenhamos que a intenção é boa, mas infelizmente a tradução do Google Tradutor deixa a desejar. Sem querer fazer spam, mas segue abaixo um tutorial (baseado neste original) com minha tradução. Acho eu que esta esteja melhor explicada: http://mtasabrasil.com.br/index.php?showtopic=20 Um abraço, Stanley Sathler.
    0 points
×
×
  • Create New...