hrubesch Posted June 3, 2019 Share Posted June 3, 2019 (edited) [EN] My Concessionaire System Is 100% But It Is Not Showing The Name Of The Cars Edited, Is Showing The Original, Can Someone Adjust The Script For Me? [PT] Meu Sistema de Concessionária Está 100%, Mas Não Está Mostrando o Nome Dos Carros Editado, Está Mostrando o Original, Alguém Pode Ajustar o Script Para Mim? Quote function addMessage(player, text, type) triggerClientEvent(player, "addRoyalMessage", root, text, type) end Desativar_Expulsar = true -- (true = Desativa Expulsar todos do Veiculo) (false = Ativa ) Desativar_Desconectar_Veiculo = true -- (true = Desativa "Desconectar Veiculo") (false = Ativa ) local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) local font = dxCreateFont(":util_fonts/fonts/gtav.ttf", x*12, false, "proof") PainelVeiculos = false setElementData ( localPlayer, "Painel-Config", "0" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_01_Estado", "Desconectado" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_02_Estado", "Desconectado" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_03_Estado", "Desconectado" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_04_Estado", "Desconectado" ) function PainelVehAirNewSCR () dxDrawRectangle(x*540, y*214, x*275, y*22, tocolor(220, 220, 220), false) dxDrawText("Gerenciador de Veiculos", x*425, y*214, x*933, y*236, tocolor(0, 0, 0), x*1.00, font, "center", "center", false, false, false, false, false) dxDrawRectangle(x*540, y*236, x*275, y*274, tocolor(190, 190, 190), false) if getElementData ( localPlayer, "Painel-Config" ) == "0" then if Posicao_Mouse( x*550, y*271, x*250, y*27 ) then dxDrawRectangle(x*550, y*271, x*250, y*27, tocolor(16, 111, 231), false) -- Slot 01 else dxDrawRectangle(x*550, y*271, x*250, y*27, tocolor(220, 220, 220), false) -- Slot 01 end if Posicao_Mouse( x*550, y*301, x*250, y*27 ) then dxDrawRectangle(x*550, y*301, x*250, y*27, tocolor(16, 111, 231), false) -- Slot 02 else dxDrawRectangle(x*550, y*301, x*250, y*27, tocolor(220, 220, 220), false) -- Slot 02 end if Posicao_Mouse( x*550, y*331, x*250, y*27 ) then dxDrawRectangle(x*550, y*331, x*250, y*27, tocolor(16, 111, 231), false) -- Slot 03 else dxDrawRectangle(x*550, y*331, x*250, y*27, tocolor(220, 220, 220), false) -- Slot 03 end if Posicao_Mouse( x*550, y*361, x*250, y*27 ) then dxDrawRectangle(x*550, y*361, x*250, y*27, tocolor(16, 111, 231), false) -- Slot 04 else dxDrawRectangle(x*550, y*361, x*250, y*27, tocolor(220, 220, 220), false) -- Slot 04 end AirNewSCR_Veiculo_Slot_01 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_01" ) AirNewSCR_Veiculo_Slot_02 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_02" ) AirNewSCR_Veiculo_Slot_03 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_03" ) AirNewSCR_Veiculo_Slot_04 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_04" ) if AirNewSCR_Veiculo_Slot_01 == "NC" or AirNewSCR_Veiculo_Slot_01 == nil then dxDrawText("Slot Vazio", x*650, y*271, x*896, y*298, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) else Veiculo_Slot_01_Estado = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_01_Estado" ) or nil VeiculoCompradoNome01 = getVehicleNameFromModel ( tonumber ( AirNewSCR_Veiculo_Slot_01 )) or nil dxDrawText(""..VeiculoCompradoNome01.." / "..AirNewSCR_Veiculo_Slot_01.." - "..Veiculo_Slot_01_Estado, x*600, y*271, x*896, y*298, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) end if AirNewSCR_Veiculo_Slot_02 == "NC" or AirNewSCR_Veiculo_Slot_02 == nil then dxDrawText("Slot Vazio", x*650, y*301, x*896, y*328, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) else Veiculo_Slot_02_Estado = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_02_Estado" ) or nil VeiculoCompradoNome02 = getVehicleNameFromModel ( tonumber ( AirNewSCR_Veiculo_Slot_02 )) or nil dxDrawText(""..VeiculoCompradoNome02.." / "..AirNewSCR_Veiculo_Slot_02.." - "..Veiculo_Slot_02_Estado, x*600, y*301, x*896, y*328, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) end if AirNewSCR_Veiculo_Slot_03 == "NC" or AirNewSCR_Veiculo_Slot_03 == nil then dxDrawText("Slot Vazio", x*650, y*331, x*896, y*358, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) else Veiculo_Slot_03_Estado = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_03_Estado" ) or nil VeiculoCompradoNome03 = getVehicleNameFromModel ( tonumber ( AirNewSCR_Veiculo_Slot_03 )) or nil dxDrawText(""..VeiculoCompradoNome03.." / "..AirNewSCR_Veiculo_Slot_03.." - "..Veiculo_Slot_03_Estado, x*600, y*331, x*896, y*358, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) end if AirNewSCR_Veiculo_Slot_04 == "NC" or AirNewSCR_Veiculo_Slot_04 == nil then dxDrawText("Slot Vazio", x*650, y*361, x*896, y*388, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) else Veiculo_Slot_04_Estado = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_04_Estado" ) or nil VeiculoCompradoNome04 = getVehicleNameFromModel ( tonumber ( AirNewSCR_Veiculo_Slot_04 )) or nil dxDrawText(""..VeiculoCompradoNome04.." / "..AirNewSCR_Veiculo_Slot_04.." - "..Veiculo_Slot_04_Estado, x*600, y*361, x*896, y*388, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) end end -- Config 01 if getElementData ( localPlayer, "Painel-Config" ) == "1" then if Posicao_Mouse( x*548, y*213, x*29, y*15 ) then dxDrawText("<", x*548, y*213, x*474, y*232, tocolor(16, 111, 231), x*1.20, font, "left", "top", false, false, false, false, false) else dxDrawText("<", x*548, y*213, x*474, y*232, tocolor(0, 0, 0), x*1.20, font, "left", "top", false, false, false, false, false) end if Posicao_Mouse( x*550, y*301, x*250, y*27 ) then dxDrawRectangle(x*550, y*301, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*301, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Conectar o Veiculo", x*615, y*301, x*896, y*328, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) if Posicao_Mouse( x*550, y*331, x*250, y*27 ) then dxDrawRectangle(x*550, y*331, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*331, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Salvar Na Posição Atual", x*615, y*331, x*896, y*358, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) if Posicao_Mouse( x*550, y*361, x*250, y*27 ) then dxDrawRectangle(x*550, y*361, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*361, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Vender Veiculo (75%)", x*615, y*361, x*896, y*388, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) if Posicao_Mouse( x*550, y*391, x*250, y*27 ) then dxDrawRectangle(x*550, y*391, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*391, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Trancar/Destrancar", x*615, y*391, x*896, y*418, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) if Posicao_Mouse( x*550, y*421, x*250, y*27 ) then dxDrawRectangle(x*550, y*421, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*421, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Localizar/Deslocalizar", x*615, y*421, x*896, y*448, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) if Posicao_Mouse( x*550, y*451, x*250, y*27 ) then dxDrawRectangle(x*550, y*451, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*451, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Desativado", x*615, y*451, x*896, y*478, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) end end function AbrirPainel () if PainelVeiculos == false then showCursor ( true ) addEventHandler ( "onClientRender", root, PainelVehAirNewSCR ) PainelVeiculos = true else showCursor ( false ) removeEventHandler ( "onClientRender", root, PainelVehAirNewSCR ) PainelVeiculos = false setElementData ( localPlayer, "Painel-Config", "0" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", nil ) end end bindKey ("F2", "down", AbrirPainel ) function SelecionarOpcaoParte0 (_,state) if PainelVeiculos == true then if state == "down" then local AirNewSCR_Veiculo_Slot_01 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_01" ) or nil local AirNewSCR_Veiculo_Slot_02 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_02" ) or nil local AirNewSCR_Veiculo_Slot_03 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_03" ) or nil local AirNewSCR_Veiculo_Slot_04 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_04" ) or nil if getElementData ( localPlayer, "Painel-Config" ) == "0" then if Posicao_Mouse ( x*910, y*214, x*23, y*22 ) then -- Fechar AbrirPainel () -- Fechar elseif Posicao_Mouse ( x*550, y*271, x*250, y*27 ) then -- Slot 01 if AirNewSCR_Veiculo_Slot_01 == "NC" then else setTimer ( function() setElementData ( localPlayer, "Painel-Config", "1" ) end, 50, 1 ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", "1" ) end elseif Posicao_Mouse ( x*550, y*301, x*250, y*27 ) then -- Slot 02 if AirNewSCR_Veiculo_Slot_02 == "NC" then else setTimer ( function() setElementData ( localPlayer, "Painel-Config", "1" ) end, 50, 1 ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", "2" ) end elseif Posicao_Mouse ( x*550, y*331, x*250, y*27 ) then -- Slot 03 if AirNewSCR_Veiculo_Slot_03 == "NC" then else setTimer ( function() setElementData ( localPlayer, "Painel-Config", "1" ) end, 50, 1 ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", "3" ) end elseif Posicao_Mouse ( x*550, y*361, x*250, y*27 ) then -- Slot 04 if AirNewSCR_Veiculo_Slot_04 == "NC" then else setTimer ( function() setElementData ( localPlayer, "Painel-Config", "1" ) end, 50, 1 ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", "4" ) end end end end end end addEventHandler ( "onClientClick", root, SelecionarOpcaoParte0 ) function SelecionarOpcaoParte1 (_,state) if PainelVeiculos == true then if state == "down" then if getElementData ( localPlayer, "Painel-Config" ) == "1" then local AirNewSCR_Veiculo_Slot_01 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_01" ) or nil local AirNewSCR_Veiculo_Slot_02 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_02" ) or nil local AirNewSCR_Veiculo_Slot_03 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_03" ) or nil local AirNewSCR_Veiculo_Slot_04 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_04" ) or nil if Posicao_Mouse ( x*910, y*214, x*23, y*22 ) then -- Fechar AbrirPainel () -- Fechar elseif Posicao_Mouse ( x*548, y*213, x*29, y*15 ) then -- Voltar setElementData ( localPlayer, "Painel-Config", "0" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", nil ) elseif Posicao_Mouse ( x*471, y*301, x*425, y*27 ) then -- Conectar Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then triggerServerEvent ( "AirNewSCR_Conectar_Veiculo", localPlayer, AirNewSCR_Veiculo_Slot_01, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "2" then triggerServerEvent ( "AirNewSCR_Conectar_Veiculo", localPlayer, AirNewSCR_Veiculo_Slot_02, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "3" then triggerServerEvent ( "AirNewSCR_Conectar_Veiculo", localPlayer, AirNewSCR_Veiculo_Slot_03, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "4" then triggerServerEvent ( "AirNewSCR_Conectar_Veiculo", localPlayer, AirNewSCR_Veiculo_Slot_04, Veiculo_Selecionado_Client ) end elseif Posicao_Mouse ( x*471, y*331, x*425, y*27 ) then -- Salvar Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then triggerServerEvent ( "AirNewSCR_SalvarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "2" then triggerServerEvent ( "AirNewSCR_SalvarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "3" then triggerServerEvent ( "AirNewSCR_SalvarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "4" then triggerServerEvent ( "AirNewSCR_SalvarVeiculo", localPlayer, Veiculo_Selecionado_Client ) end elseif Posicao_Mouse ( x*471, y*361, x*425, y*27 ) then -- Vender Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then triggerServerEvent ( "AirNewSCR_VenderVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "2" then triggerServerEvent ( "AirNewSCR_VenderVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "3" then triggerServerEvent ( "AirNewSCR_VenderVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "4" then triggerServerEvent ( "AirNewSCR_VenderVeiculo", localPlayer, Veiculo_Selecionado_Client ) end setElementData ( localPlayer, "Painel-Config", "0" ) elseif Posicao_Mouse ( x*471, y*391, x*425, y*27 ) then -- Trancar / Destrancar Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then triggerServerEvent ( "AirNewSCR_TrancarDestrancarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "2" then triggerServerEvent ( "AirNewSCR_TrancarDestrancarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "3" then triggerServerEvent ( "AirNewSCR_TrancarDestrancarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "4" then triggerServerEvent ( "AirNewSCR_TrancarDestrancarVeiculo", localPlayer, Veiculo_Selecionado_Client ) end elseif Posicao_Mouse ( x*471, y*421, x*425, y*27 ) then -- Localizar / Deslocalizar Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then if getElementData ( localPlayer, "AirNew_Localizador_Data_01" ) == true then triggerServerEvent ( "AirNewSCR_DeslocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_01", false ) else triggerServerEvent ( "AirNewSCR_LocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_01", true ) end elseif Veiculo_Selecionado_Client == "2" then if getElementData ( localPlayer, "AirNew_Localizador_Data_02" ) == true then triggerServerEvent ( "AirNewSCR_DeslocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_02", false ) else triggerServerEvent ( "AirNewSCR_LocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_02", true ) end elseif Veiculo_Selecionado_Client == "3" then if getElementData ( localPlayer, "AirNew_Localizador_Data_03" ) == true then triggerServerEvent ( "AirNewSCR_DeslocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_03", false ) else triggerServerEvent ( "AirNewSCR_LocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_03", true ) end elseif Veiculo_Selecionado_Client == "4" then if getElementData ( localPlayer, "AirNew_Localizador_Data_04" ) == true then triggerServerEvent ( "AirNewSCR_DeslocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_04", false ) else triggerServerEvent ( "AirNewSCR_LocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_04", true ) end end elseif Posicao_Mouse ( x*47100000000000, y*451, x*425, y*27 ) then -- Expulsar Todos do Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then triggerServerEvent ( "AirNewSCR_ExpulsarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "2" then triggerServerEvent ( "AirNewSCR_ExpulsarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "3" then triggerServerEvent ( "AirNewSCR_ExpulsarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "4" then triggerServerEvent ( "AirNewSCR_ExpulsarVeiculo", localPlayer, Veiculo_Selecionado_Client ) end elseif Posicao_Mouse ( x*471, y*481, x*425, y*27 ) then -- N/A --outputChatBox ( "-- Nada" ) end end end end end addEventHandler ( "onClientClick", root, SelecionarOpcaoParte1 ) function Posicao_Mouse ( x, y, Largura, Altura ) 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 + Largura) and (cy >= y and cy <= y + Altura) then return true else return false end end -- // Parte Concessionaria // -- local COR_R, COR_G, COR_B, COR_A = 255, 255, 255 local Nomes_Veiculos_Editados = { [545] = 'Fusca'; [559] = 'Voyage'; [429] = 'Gol G4'; [518] = 'Punto'; [546] = 'Corolla'; [600] = 'Saveiro G7'; [587] = 'Honda Civic 2017'; [562] = 'Nissan 350Z'; [475] = 'Camaro SS (Quantidade Limitada)'; [400] = 'Nissan Frontier'; [602] = 'Mustang GT'; [480] = 'Porshe'; [579] = 'Hummer'; [415] = 'Ferrari GTB'; [451] = 'Lamborghini'; [541] = 'Pagani Huayra'; [462] = 'Today'; [586] = 'Titan 160 Dixavada'; [468] = 'XT660'; [521] = 'XJ6 2015'; [522] = 'Z1000'; [463] = 'Harley'; [581] = 'H2R'; } Concessionarias_AirNewSCR = {} local Lista_Veiculos_Concessionarias = { [1] = {ID = { {545, 7000} ,{559, 10500} ,{429, 21000} ,{518, 22000} ,{546, 30000} ,{600, 33000} ,{587, 50000} ,{562, 100000} ,{475, 110000} ,{400, 130000} ,{602, 200000} ,{480, 270000} ,{579, 350000} ,{415, 1800000} ,{451, 3000000} ,{541, 5500000} }, vPosX = -2060.70898, vPosY = 451.06177, -- Posição do Veiculo vPosZ = 141.07220+0.5, PosX = 542.28491, PosY = -1292.54138, PosZ = 16.22188 -0.7, CamX = -2069.44897, CamY = 443.42935, -- Ver de Onde CamZ = 147.51927, lookAtX = -2060.70898, lookAtY = 451.06177, lookAtZ = 141.07220}, [2] = {ID = { {462, 5000} ,{586, 10000} ,{468, 35000} ,{521, 45000} ,{522, 90000} ,{463, 850000} ,{581, 1700000} }, vPosX = 2129.931, vPosY = -1142.089, -- Posição do Veiculo vPosZ = 25.032, PosX = 2131.755, PosY = -1149.22, PosZ = 24.29 -1.5, CamX = 2129.428, CamY = -1134.534, -- Ver de Onde CamZ = 25.62+3, lookAtX = 2129.931, lookAtY = -1142.089, lookAtZ = 25.032} } AirNewSCR_Concessionaria = false function LojaVeiculosDX () dxDrawRectangle(x*18, y*184, x*382, y*400, tocolor(170, 170, 170), false) dxDrawRectangle(x*18, y*184, x*382, y*22, tocolor(100, 100, 100), false) dxDrawText("Loja de Veiculos", x*18, y*184, x*400, y*206, tocolor(255, 255, 255, 255), x*1.00, font, "center", "center", false, false, false, false, false) if Posicao_Mouse ( x*35, y*530, x*126, y*39 ) then dxDrawRectangle(x*35, y*530, x*126, y*39, tocolor(16, 111, 231, 220), false) else dxDrawRectangle(x*35, y*530, x*126, y*39, tocolor(16, 111, 231, 160), false) end dxDrawText("Comprar", x*32, y*385, x*164, y*715, tocolor(255, 255, 255, 255), x*1.00, font, "center", "center", false, false, false, false, false) if Posicao_Mouse ( x*250, y*530, x*126, y*39 ) then dxDrawRectangle(x*250, y*530, x*126, y*39, tocolor(16, 111, 231, 220), false) else dxDrawRectangle(x*250, y*530, x*126, y*39, tocolor(16, 111, 231, 160), false) end dxDrawText("Fechar", x*248, y*385, x*376, y*715, tocolor(255, 255, 255, 255), x*1.00, font, "center", "center", false, false, false, false, false) end GridListLoja = guiCreateGridList( x*28, y*216, x*358, y*300, false) guiGridListSetSelectionMode(GridListLoja, 0) carColumn = guiGridListAddColumn(GridListLoja, "Veículo", 0.4) costColumn = guiGridListAddColumn(GridListLoja, "Preço ($)", 0.4) guiSetVisible ( GridListLoja, false ) FecharLoja = guiCreateButton( x*250, y*530, x*126, y*39, "Fechar", false) guiSetVisible ( FecharLoja, false ) guiSetAlpha ( FecharLoja, 0.00 ) ComprarLoja = guiCreateButton ( x*35, y*530, x*126, y*39, "Comprar", false) guiSetVisible ( ComprarLoja, false ) guiSetAlpha ( ComprarLoja, 0.00 ) for i, M in ipairs(Lista_Veiculos_Concessionarias) do Marker_Concessionarias = createMarker(M["PosX"], M["PosY"], M["PosZ"], "cylinder", 1.2, 16, 111, 231, 160 ) Concessionarias_AirNewSCR[Marker_Concessionarias] = true setElementData ( Marker_Concessionarias, "LojaNumeroID", i ) setElementID(Marker_Concessionarias, tostring(i)) createBlipAttachedTo(Marker_Concessionarias, 55, 2, 255, 255, 255, 255, 0, 150) end function getVehicleModelFromNewName (name) for i,v in pairs ( Nomes_Veiculos_Editados ) do if v == name then return i end end return false end addEventHandler("onClientGUIClick", resourceRoot, function() if source == GridListLoja then local Nome_do_Veiculo = guiGridListGetItemText(GridListLoja, guiGridListGetSelectedItem(GridListLoja), 1) local Preco_do_Veiculo = guiGridListGetItemText(GridListLoja, guiGridListGetSelectedItem(GridListLoja), 2) if guiGridListGetSelectedItem(GridListLoja) ~= -1 then local ID_do_Veiculo = getVehicleModelFromNewName(Nome_do_Veiculo) or getVehicleModelFromName(Nome_do_Veiculo) if isElement(VeiculoAmostra) then setElementModel(VeiculoAmostra, ID_do_Veiculo) return end VeiculoAmostra = createVehicle(ID_do_Veiculo, Lista_Veiculos_Concessionarias["vPosX"], Lista_Veiculos_Concessionarias["vPosY"], Lista_Veiculos_Concessionarias["vPosZ"]) setVehicleDamageProof(VeiculoAmostra, true) setElementFrozen(VeiculoAmostra, true) setElementDimension ( VeiculoAmostra, 1 ) setVehicleColor(VeiculoAmostra, COR_R, COR_G, COR_B, COR_A ) timer = setTimer(function() local x, y, z = getElementRotation(VeiculoAmostra) setElementRotation(VeiculoAmostra, x, y, z-1) end, 50, 0) else if isElement(VeiculoAmostra) then destroyElement(VeiculoAmostra) end if isTimer(timer) then killTimer(timer) end end elseif source == ComprarLoja then if guiGridListGetSelectedItem(GridListLoja) then local Nome_do_Veiculo = guiGridListGetItemText(GridListLoja, guiGridListGetSelectedItem(GridListLoja), 1) local ID_do_Veiculo = getVehicleModelFromNewName(Nome_do_Veiculo) or getVehicleModelFromName(Nome_do_Veiculo) or "boolean" local Preco_do_Veiculo = guiGridListGetItemText (GridListLoja, guiGridListGetSelectedItem(GridListLoja), 2) local Dinheiro = getPlayerMoney ( localPlayer ) if ID_do_Veiculo == "boolean" then triggerServerEvent ( "AirNewSCR_MSGDX", localPlayer, "Selecione um Veiculo antes de Clicar em Comprar!", "error" ) else triggerServerEvent ( "AirNewSCR_ComprarVeiculo", localPlayer, ID_do_Veiculo, Preco_do_Veiculo, COR_R, COR_G, COR_B, COR_A ) AbrirFecharGUIDX () -- Fechar fadeCamera(false, 1.0) setTimer(function() fadeCamera(true, 0.5) setCameraTarget(localPlayer) end, 1000, 1) if isElement(VeiculoAmostra) then destroyElement(VeiculoAmostra) end if isTimer(timer) then killTimer(timer) end end end elseif source == FecharLoja then if AirNewSCR_Concessionaria == true then AbrirFecharGUIDX () -- Fechar fadeCamera(false, 1.0) setTimer(function() fadeCamera(true, 0.5) setCameraTarget(localPlayer) end, 1000, 1) if isElement(VeiculoAmostra) then destroyElement(VeiculoAmostra) end if isTimer(timer) then killTimer(timer) end end endend) local components = { "radar" } function AbrirFecharGUIDX () if AirNewSCR_Concessionaria == false then addEventHandler ( "onClientRender", root, LojaVeiculosDX ) showCursor ( true ) guiSetVisible ( FecharLoja, true ) guiSetVisible ( GridListLoja, true ) guiSetVisible ( ComprarLoja, true ) AirNewSCR_Concessionaria = true setElementFrozen ( localPlayer, true ) setElementDimension ( localPlayer, 1 ) for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end else removeEventHandler ( "onClientRender", root, LojaVeiculosDX ) showCursor ( false ) guiSetVisible ( FecharLoja, false ) guiSetVisible ( GridListLoja, false ) guiSetVisible ( ComprarLoja, false ) AirNewSCR_Concessionaria = false setElementData ( localPlayer, "Concessionaria", false ) setElementDimension ( localPlayer, 0 ) setTimer(function() setElementFrozen ( localPlayer, false ) end, 1001, 1) for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end endend addEventHandler("onClientMarkerHit", resourceRoot,function(player) if not isPedOnGround ( localPlayer ) then return end if getElementType(player) ~= "player" or player ~= localPlayer or isPedInVehicle(player) then return end if Concessionarias_AirNewSCR[source] then i = tonumber(getElementID(source)) guiGridListClear(GridListLoja) for i, v in ipairs(Lista_Veiculos_Concessionarias["ID"]) do local Nome_do_Veiculo = Nomes_Veiculos_Editados[ v[1] ] or getVehicleNameFromModel(v[1]) local row = guiGridListAddRow(GridListLoja) guiGridListSetItemText(GridListLoja, row, 1, Nome_do_Veiculo, false, true) guiGridListSetItemText(GridListLoja, row, 2, tostring(v[2]), false, true) end LocalID = getElementData ( source, "LojaNumeroID" ) setElementData ( localPlayer, "Concessionaria", LocalID ) setTimer(function() setCameraMatrix(Lista_Veiculos_Concessionarias["CamX"], Lista_Veiculos_Concessionarias["CamY"], Lista_Veiculos_Concessionarias["CamZ"], Lista_Veiculos_Concessionarias["lookAtX"], Lista_Veiculos_Concessionarias["lookAtY"], Lista_Veiculos_Concessionarias["lookAtZ"]) AbrirFecharGUIDX () -- Abrir guiGridListSetSelectedItem(GridListLoja, 0, 1) local Nome_do_Veiculo = guiGridListGetItemText(GridListLoja, 0, 1) local ID_do_Veiculo = getVehicleModelFromNewName(Nome_do_Veiculo) or getVehicleModelFromName(Nome_do_Veiculo) local x, y, z = Lista_Veiculos_Concessionarias["vPosX"], Lista_Veiculos_Concessionarias["vPosY"], Lista_Veiculos_Concessionarias["vPosZ"] if isElement(VeiculoAmostra) then destroyElement(VeiculoAmostra) end if isTimer(timer) then killTimer(timer) end VeiculoAmostra = createVehicle ( ID_do_Veiculo, x, y, z ) -- Criar Veiculo setVehicleDamageProof ( VeiculoAmostra, true ) -- Blindar setElementFrozen ( VeiculoAmostra, true ) -- Congelar setVehicleColor ( VeiculoAmostra, COR_R, COR_G, COR_B, COR_A ) -- Pintar setElementDimension ( VeiculoAmostra, 1 ) timer = setTimer ( function() local x, y, z = getElementRotation ( VeiculoAmostra ) setElementRotation ( VeiculoAmostra, x, y, z-1 ) end, 50, 0 ) -- Rotacionar Veiculo end, 400, 1 ) endend) Edited June 3, 2019 by hrubesch Link to comment
Luxy.c Posted June 3, 2019 Share Posted June 3, 2019 (edited) Hey, 2 hours ago, hrubesch said: Can Someone Adjust The Script For Me? no, we wont. Second of all: Have you debugged your code such as printing variables being set ? (AirNewSCR_Veiculo_Slot_0*) ? - Luxy.c Edited June 3, 2019 by Luxy.c Link to comment
hrubesch Posted June 3, 2019 Author Share Posted June 3, 2019 Hand Understand Script Works In All Questions, But The Names Of The Cars That Should Show When F2 Is Pressed, Should Be The Names Edited, But Behind It Is Showing The Original Names Of GTA San Andreas, What's Wrong In This Script? Link to comment
DNL291 Posted June 4, 2019 Share Posted June 4, 2019 Try: function addMessage(player, text, type) triggerClientEvent(player, "addRoyalMessage", root, text, type) end Desativar_Expulsar = true -- (true = Desativa Expulsar todos do Veiculo) (false = Ativa ) Desativar_Desconectar_Veiculo = true -- (true = Desativa "Desconectar Veiculo") (false = Ativa ) local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) local font = dxCreateFont(":util_fonts/fonts/gtav.ttf", x*12, false, "proof") PainelVeiculos = false setElementData ( localPlayer, "Painel-Config", "0" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_01_Estado", "Desconectado" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_02_Estado", "Desconectado" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_03_Estado", "Desconectado" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_04_Estado", "Desconectado" ) function PainelVehAirNewSCR () dxDrawRectangle(x*540, y*214, x*275, y*22, tocolor(220, 220, 220), false) dxDrawText("Gerenciador de Veiculos", x*425, y*214, x*933, y*236, tocolor(0, 0, 0), x*1.00, font, "center", "center", false, false, false, false, false) dxDrawRectangle(x*540, y*236, x*275, y*274, tocolor(190, 190, 190), false) if getElementData ( localPlayer, "Painel-Config" ) == "0" then if Posicao_Mouse( x*550, y*271, x*250, y*27 ) then dxDrawRectangle(x*550, y*271, x*250, y*27, tocolor(16, 111, 231), false) -- Slot 01 else dxDrawRectangle(x*550, y*271, x*250, y*27, tocolor(220, 220, 220), false) -- Slot 01 end if Posicao_Mouse( x*550, y*301, x*250, y*27 ) then dxDrawRectangle(x*550, y*301, x*250, y*27, tocolor(16, 111, 231), false) -- Slot 02 else dxDrawRectangle(x*550, y*301, x*250, y*27, tocolor(220, 220, 220), false) -- Slot 02 end if Posicao_Mouse( x*550, y*331, x*250, y*27 ) then dxDrawRectangle(x*550, y*331, x*250, y*27, tocolor(16, 111, 231), false) -- Slot 03 else dxDrawRectangle(x*550, y*331, x*250, y*27, tocolor(220, 220, 220), false) -- Slot 03 end if Posicao_Mouse( x*550, y*361, x*250, y*27 ) then dxDrawRectangle(x*550, y*361, x*250, y*27, tocolor(16, 111, 231), false) -- Slot 04 else dxDrawRectangle(x*550, y*361, x*250, y*27, tocolor(220, 220, 220), false) -- Slot 04 end AirNewSCR_Veiculo_Slot_01 = tonumber( getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_01" ) ) AirNewSCR_Veiculo_Slot_02 = tonumber( getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_02" ) ) AirNewSCR_Veiculo_Slot_03 = tonumber( getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_03" ) ) AirNewSCR_Veiculo_Slot_04 = tonumber( getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_04" ) ) local slot1VehName = Nomes_Veiculos_Editados[AirNewSCR_Veiculo_Slot_01] or getVehicleNameFromModel(AirNewSCR_Veiculo_Slot_01) local slot2VehName = Nomes_Veiculos_Editados[AirNewSCR_Veiculo_Slot_02] or getVehicleNameFromModel(AirNewSCR_Veiculo_Slot_02) local slot3VehName = Nomes_Veiculos_Editados[AirNewSCR_Veiculo_Slot_03] or getVehicleNameFromModel(AirNewSCR_Veiculo_Slot_03) local slot4VehName = Nomes_Veiculos_Editados[AirNewSCR_Veiculo_Slot_04] or getVehicleNameFromModel(AirNewSCR_Veiculo_Slot_04) if AirNewSCR_Veiculo_Slot_01 == "NC" or AirNewSCR_Veiculo_Slot_01 == nil then dxDrawText("Slot Vazio", x*650, y*271, x*896, y*298, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) else Veiculo_Slot_01_Estado = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_01_Estado" ) or nil dxDrawText(""..(slot1VehName or "N/A").." / "..AirNewSCR_Veiculo_Slot_01.." - "..Veiculo_Slot_01_Estado, x*600, y*271, x*896, y*298, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) end if AirNewSCR_Veiculo_Slot_02 == "NC" or AirNewSCR_Veiculo_Slot_02 == nil then dxDrawText("Slot Vazio", x*650, y*301, x*896, y*328, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) else Veiculo_Slot_02_Estado = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_02_Estado" ) or nil dxDrawText(""..(slot2VehName or "N/A").." / "..AirNewSCR_Veiculo_Slot_02.." - "..Veiculo_Slot_02_Estado, x*600, y*301, x*896, y*328, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) end if AirNewSCR_Veiculo_Slot_03 == "NC" or AirNewSCR_Veiculo_Slot_03 == nil then dxDrawText("Slot Vazio", x*650, y*331, x*896, y*358, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) else Veiculo_Slot_03_Estado = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_03_Estado" ) or nil dxDrawText(""..(slot3VehName or "N/A").." / "..AirNewSCR_Veiculo_Slot_03.." - "..Veiculo_Slot_03_Estado, x*600, y*331, x*896, y*358, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) end if AirNewSCR_Veiculo_Slot_04 == "NC" or AirNewSCR_Veiculo_Slot_04 == nil then dxDrawText("Slot Vazio", x*650, y*361, x*896, y*388, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) else Veiculo_Slot_04_Estado = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_04_Estado" ) or nil dxDrawText(""..(slot4VehName or "N/A").." / "..AirNewSCR_Veiculo_Slot_04.." - "..Veiculo_Slot_04_Estado, x*600, y*361, x*896, y*388, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) end end -- Config 01 if getElementData ( localPlayer, "Painel-Config" ) == "1" then if Posicao_Mouse( x*548, y*213, x*29, y*15 ) then dxDrawText("<", x*548, y*213, x*474, y*232, tocolor(16, 111, 231), x*1.20, font, "left", "top", false, false, false, false, false) else dxDrawText("<", x*548, y*213, x*474, y*232, tocolor(0, 0, 0), x*1.20, font, "left", "top", false, false, false, false, false) end if Posicao_Mouse( x*550, y*301, x*250, y*27 ) then dxDrawRectangle(x*550, y*301, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*301, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Conectar o Veiculo", x*615, y*301, x*896, y*328, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) if Posicao_Mouse( x*550, y*331, x*250, y*27 ) then dxDrawRectangle(x*550, y*331, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*331, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Salvar Na Posição Atual", x*615, y*331, x*896, y*358, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) if Posicao_Mouse( x*550, y*361, x*250, y*27 ) then dxDrawRectangle(x*550, y*361, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*361, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Vender Veiculo (75%)", x*615, y*361, x*896, y*388, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) if Posicao_Mouse( x*550, y*391, x*250, y*27 ) then dxDrawRectangle(x*550, y*391, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*391, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Trancar/Destrancar", x*615, y*391, x*896, y*418, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) if Posicao_Mouse( x*550, y*421, x*250, y*27 ) then dxDrawRectangle(x*550, y*421, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*421, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Localizar/Deslocalizar", x*615, y*421, x*896, y*448, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) if Posicao_Mouse( x*550, y*451, x*250, y*27 ) then dxDrawRectangle(x*550, y*451, x*250, y*27, tocolor(16, 111, 231), false) else dxDrawRectangle(x*550, y*451, x*250, y*27, tocolor(220, 220, 220), false) end dxDrawText("Desativado", x*615, y*451, x*896, y*478, tocolor(0, 0, 0), x*1.00, font, "left", "center", false, false, false, false, false) end end function AbrirPainel () if PainelVeiculos == false then showCursor ( true ) addEventHandler ( "onClientRender", root, PainelVehAirNewSCR ) PainelVeiculos = true else showCursor ( false ) removeEventHandler ( "onClientRender", root, PainelVehAirNewSCR ) PainelVeiculos = false setElementData ( localPlayer, "Painel-Config", "0" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", nil ) end end bindKey ("F2", "down", AbrirPainel ) function SelecionarOpcaoParte0 (_,state) if PainelVeiculos == true then if state == "down" then local AirNewSCR_Veiculo_Slot_01 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_01" ) or nil local AirNewSCR_Veiculo_Slot_02 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_02" ) or nil local AirNewSCR_Veiculo_Slot_03 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_03" ) or nil local AirNewSCR_Veiculo_Slot_04 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_04" ) or nil if getElementData ( localPlayer, "Painel-Config" ) == "0" then if Posicao_Mouse ( x*910, y*214, x*23, y*22 ) then -- Fechar AbrirPainel () -- Fechar elseif Posicao_Mouse ( x*550, y*271, x*250, y*27 ) then -- Slot 01 if AirNewSCR_Veiculo_Slot_01 == "NC" then else setTimer ( function() setElementData ( localPlayer, "Painel-Config", "1" ) end, 50, 1 ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", "1" ) end elseif Posicao_Mouse ( x*550, y*301, x*250, y*27 ) then -- Slot 02 if AirNewSCR_Veiculo_Slot_02 == "NC" then else setTimer ( function() setElementData ( localPlayer, "Painel-Config", "1" ) end, 50, 1 ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", "2" ) end elseif Posicao_Mouse ( x*550, y*331, x*250, y*27 ) then -- Slot 03 if AirNewSCR_Veiculo_Slot_03 == "NC" then else setTimer ( function() setElementData ( localPlayer, "Painel-Config", "1" ) end, 50, 1 ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", "3" ) end elseif Posicao_Mouse ( x*550, y*361, x*250, y*27 ) then -- Slot 04 if AirNewSCR_Veiculo_Slot_04 == "NC" then else setTimer ( function() setElementData ( localPlayer, "Painel-Config", "1" ) end, 50, 1 ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", "4" ) end end end end end end addEventHandler ( "onClientClick", root, SelecionarOpcaoParte0 ) function SelecionarOpcaoParte1 (_,state) if PainelVeiculos == true then if state == "down" then if getElementData ( localPlayer, "Painel-Config" ) == "1" then local AirNewSCR_Veiculo_Slot_01 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_01" ) or nil local AirNewSCR_Veiculo_Slot_02 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_02" ) or nil local AirNewSCR_Veiculo_Slot_03 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_03" ) or nil local AirNewSCR_Veiculo_Slot_04 = getElementData ( localPlayer, "AirNewSCR_Veiculo_Slot_04" ) or nil if Posicao_Mouse ( x*910, y*214, x*23, y*22 ) then -- Fechar AbrirPainel () -- Fechar elseif Posicao_Mouse ( x*548, y*213, x*29, y*15 ) then -- Voltar setElementData ( localPlayer, "Painel-Config", "0" ) setElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado", nil ) elseif Posicao_Mouse ( x*471, y*301, x*425, y*27 ) then -- Conectar Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then triggerServerEvent ( "AirNewSCR_Conectar_Veiculo", localPlayer, AirNewSCR_Veiculo_Slot_01, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "2" then triggerServerEvent ( "AirNewSCR_Conectar_Veiculo", localPlayer, AirNewSCR_Veiculo_Slot_02, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "3" then triggerServerEvent ( "AirNewSCR_Conectar_Veiculo", localPlayer, AirNewSCR_Veiculo_Slot_03, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "4" then triggerServerEvent ( "AirNewSCR_Conectar_Veiculo", localPlayer, AirNewSCR_Veiculo_Slot_04, Veiculo_Selecionado_Client ) end elseif Posicao_Mouse ( x*471, y*331, x*425, y*27 ) then -- Salvar Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then triggerServerEvent ( "AirNewSCR_SalvarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "2" then triggerServerEvent ( "AirNewSCR_SalvarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "3" then triggerServerEvent ( "AirNewSCR_SalvarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "4" then triggerServerEvent ( "AirNewSCR_SalvarVeiculo", localPlayer, Veiculo_Selecionado_Client ) end elseif Posicao_Mouse ( x*471, y*361, x*425, y*27 ) then -- Vender Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then triggerServerEvent ( "AirNewSCR_VenderVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "2" then triggerServerEvent ( "AirNewSCR_VenderVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "3" then triggerServerEvent ( "AirNewSCR_VenderVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "4" then triggerServerEvent ( "AirNewSCR_VenderVeiculo", localPlayer, Veiculo_Selecionado_Client ) end setElementData ( localPlayer, "Painel-Config", "0" ) elseif Posicao_Mouse ( x*471, y*391, x*425, y*27 ) then -- Trancar / Destrancar Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then triggerServerEvent ( "AirNewSCR_TrancarDestrancarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "2" then triggerServerEvent ( "AirNewSCR_TrancarDestrancarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "3" then triggerServerEvent ( "AirNewSCR_TrancarDestrancarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "4" then triggerServerEvent ( "AirNewSCR_TrancarDestrancarVeiculo", localPlayer, Veiculo_Selecionado_Client ) end elseif Posicao_Mouse ( x*471, y*421, x*425, y*27 ) then -- Localizar / Deslocalizar Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then if getElementData ( localPlayer, "AirNew_Localizador_Data_01" ) == true then triggerServerEvent ( "AirNewSCR_DeslocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_01", false ) else triggerServerEvent ( "AirNewSCR_LocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_01", true ) end elseif Veiculo_Selecionado_Client == "2" then if getElementData ( localPlayer, "AirNew_Localizador_Data_02" ) == true then triggerServerEvent ( "AirNewSCR_DeslocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_02", false ) else triggerServerEvent ( "AirNewSCR_LocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_02", true ) end elseif Veiculo_Selecionado_Client == "3" then if getElementData ( localPlayer, "AirNew_Localizador_Data_03" ) == true then triggerServerEvent ( "AirNewSCR_DeslocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_03", false ) else triggerServerEvent ( "AirNewSCR_LocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_03", true ) end elseif Veiculo_Selecionado_Client == "4" then if getElementData ( localPlayer, "AirNew_Localizador_Data_04" ) == true then triggerServerEvent ( "AirNewSCR_DeslocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_04", false ) else triggerServerEvent ( "AirNewSCR_LocalizarVeiculo", localPlayer, Veiculo_Selecionado_Client ) setElementData ( localPlayer, "AirNew_Localizador_Data_04", true ) end end elseif Posicao_Mouse ( x*47100000000000, y*451, x*425, y*27 ) then -- Expulsar Todos do Veiculo local Veiculo_Selecionado_Client = getElementData ( localPlayer, "AirNewSCR_Veiculo_Selecionado" ) if Veiculo_Selecionado_Client == "1" then triggerServerEvent ( "AirNewSCR_ExpulsarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "2" then triggerServerEvent ( "AirNewSCR_ExpulsarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "3" then triggerServerEvent ( "AirNewSCR_ExpulsarVeiculo", localPlayer, Veiculo_Selecionado_Client ) elseif Veiculo_Selecionado_Client == "4" then triggerServerEvent ( "AirNewSCR_ExpulsarVeiculo", localPlayer, Veiculo_Selecionado_Client ) end elseif Posicao_Mouse ( x*471, y*481, x*425, y*27 ) then -- N/A --outputChatBox ( "-- Nada" ) end end end end end addEventHandler ( "onClientClick", root, SelecionarOpcaoParte1 ) function Posicao_Mouse ( x, y, Largura, Altura ) 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 + Largura) and (cy >= y and cy <= y + Altura) then return true else return false end end -- // Parte Concessionaria // -- local COR_R, COR_G, COR_B, COR_A = 255, 255, 255 local Nomes_Veiculos_Editados = { [545] = 'Fusca'; [559] = 'Voyage'; [429] = 'Gol G4'; [518] = 'Punto'; [546] = 'Corolla'; [600] = 'Saveiro G7'; [587] = 'Honda Civic 2017'; [562] = 'Nissan 350Z'; [475] = 'Camaro SS (Quantidade Limitada)'; [400] = 'Nissan Frontier'; [602] = 'Mustang GT'; [480] = 'Porshe'; [579] = 'Hummer'; [415] = 'Ferrari GTB'; [451] = 'Lamborghini'; [541] = 'Pagani Huayra'; [462] = 'Today'; [586] = 'Titan 160 Dixavada'; [468] = 'XT660'; [521] = 'XJ6 2015'; [522] = 'Z1000'; [463] = 'Harley'; [581] = 'H2R'; } Concessionarias_AirNewSCR = {} local Lista_Veiculos_Concessionarias = { [1] = {ID = { {545, 7000} ,{559, 10500} ,{429, 21000} ,{518, 22000} ,{546, 30000} ,{600, 33000} ,{587, 50000} ,{562, 100000} ,{475, 110000} ,{400, 130000} ,{602, 200000} ,{480, 270000} ,{579, 350000} ,{415, 1800000} ,{451, 3000000} ,{541, 5500000} }, vPosX = -2060.70898, vPosY = 451.06177, -- Posição do Veiculo vPosZ = 141.07220+0.5, PosX = 542.28491, PosY = -1292.54138, PosZ = 16.22188 -0.7, CamX = -2069.44897, CamY = 443.42935, -- Ver de Onde CamZ = 147.51927, lookAtX = -2060.70898, lookAtY = 451.06177, lookAtZ = 141.07220}, [2] = {ID = { {462, 5000} ,{586, 10000} ,{468, 35000} ,{521, 45000} ,{522, 90000} ,{463, 850000} ,{581, 1700000} }, vPosX = 2129.931, vPosY = -1142.089, -- Posição do Veiculo vPosZ = 25.032, PosX = 2131.755, PosY = -1149.22, PosZ = 24.29 -1.5, CamX = 2129.428, CamY = -1134.534, -- Ver de Onde CamZ = 25.62+3, lookAtX = 2129.931, lookAtY = -1142.089, lookAtZ = 25.032} } AirNewSCR_Concessionaria = false function LojaVeiculosDX () dxDrawRectangle(x*18, y*184, x*382, y*400, tocolor(170, 170, 170), false) dxDrawRectangle(x*18, y*184, x*382, y*22, tocolor(100, 100, 100), false) dxDrawText("Loja de Veiculos", x*18, y*184, x*400, y*206, tocolor(255, 255, 255, 255), x*1.00, font, "center", "center", false, false, false, false, false) if Posicao_Mouse ( x*35, y*530, x*126, y*39 ) then dxDrawRectangle(x*35, y*530, x*126, y*39, tocolor(16, 111, 231, 220), false) else dxDrawRectangle(x*35, y*530, x*126, y*39, tocolor(16, 111, 231, 160), false) end dxDrawText("Comprar", x*32, y*385, x*164, y*715, tocolor(255, 255, 255, 255), x*1.00, font, "center", "center", false, false, false, false, false) if Posicao_Mouse ( x*250, y*530, x*126, y*39 ) then dxDrawRectangle(x*250, y*530, x*126, y*39, tocolor(16, 111, 231, 220), false) else dxDrawRectangle(x*250, y*530, x*126, y*39, tocolor(16, 111, 231, 160), false) end dxDrawText("Fechar", x*248, y*385, x*376, y*715, tocolor(255, 255, 255, 255), x*1.00, font, "center", "center", false, false, false, false, false) end GridListLoja = guiCreateGridList( x*28, y*216, x*358, y*300, false) guiGridListSetSelectionMode(GridListLoja, 0) carColumn = guiGridListAddColumn(GridListLoja, "Veículo", 0.4) costColumn = guiGridListAddColumn(GridListLoja, "Preço ($)", 0.4) guiSetVisible ( GridListLoja, false ) FecharLoja = guiCreateButton( x*250, y*530, x*126, y*39, "Fechar", false) guiSetVisible ( FecharLoja, false ) guiSetAlpha ( FecharLoja, 0.00 ) ComprarLoja = guiCreateButton ( x*35, y*530, x*126, y*39, "Comprar", false) guiSetVisible ( ComprarLoja, false ) guiSetAlpha ( ComprarLoja, 0.00 ) for i, M in ipairs(Lista_Veiculos_Concessionarias) do Marker_Concessionarias = createMarker(M["PosX"], M["PosY"], M["PosZ"], "cylinder", 1.2, 16, 111, 231, 160 ) Concessionarias_AirNewSCR[Marker_Concessionarias] = true setElementData ( Marker_Concessionarias, "LojaNumeroID", i ) setElementID(Marker_Concessionarias, tostring(i)) createBlipAttachedTo(Marker_Concessionarias, 55, 2, 255, 255, 255, 255, 0, 150) end function getVehicleModelFromNewName (name) for i,v in pairs ( Nomes_Veiculos_Editados ) do if v == name then return i end end return false end addEventHandler("onClientGUIClick", resourceRoot, function() if source == GridListLoja then local Nome_do_Veiculo = guiGridListGetItemText(GridListLoja, guiGridListGetSelectedItem(GridListLoja), 1) local Preco_do_Veiculo = guiGridListGetItemText(GridListLoja, guiGridListGetSelectedItem(GridListLoja), 2) if guiGridListGetSelectedItem(GridListLoja) ~= -1 then local ID_do_Veiculo = getVehicleModelFromNewName(Nome_do_Veiculo) or getVehicleModelFromName(Nome_do_Veiculo) if isElement(VeiculoAmostra) then setElementModel(VeiculoAmostra, ID_do_Veiculo) return end VeiculoAmostra = createVehicle(ID_do_Veiculo, Lista_Veiculos_Concessionarias["vPosX"], Lista_Veiculos_Concessionarias["vPosY"], Lista_Veiculos_Concessionarias["vPosZ"]) setVehicleDamageProof(VeiculoAmostra, true) setElementFrozen(VeiculoAmostra, true) setElementDimension ( VeiculoAmostra, 1 ) setVehicleColor(VeiculoAmostra, COR_R, COR_G, COR_B, COR_A ) timer = setTimer(function() local x, y, z = getElementRotation(VeiculoAmostra) setElementRotation(VeiculoAmostra, x, y, z-1) end, 50, 0) else if isElement(VeiculoAmostra) then destroyElement(VeiculoAmostra) end if isTimer(timer) then killTimer(timer) end end elseif source == ComprarLoja then if guiGridListGetSelectedItem(GridListLoja) then local Nome_do_Veiculo = guiGridListGetItemText(GridListLoja, guiGridListGetSelectedItem(GridListLoja), 1) local ID_do_Veiculo = getVehicleModelFromNewName(Nome_do_Veiculo) or getVehicleModelFromName(Nome_do_Veiculo) or "boolean" local Preco_do_Veiculo = guiGridListGetItemText (GridListLoja, guiGridListGetSelectedItem(GridListLoja), 2) local Dinheiro = getPlayerMoney ( localPlayer ) if ID_do_Veiculo == "boolean" then triggerServerEvent ( "AirNewSCR_MSGDX", localPlayer, "Selecione um Veiculo antes de Clicar em Comprar!", "error" ) else triggerServerEvent ( "AirNewSCR_ComprarVeiculo", localPlayer, ID_do_Veiculo, Preco_do_Veiculo, COR_R, COR_G, COR_B, COR_A ) AbrirFecharGUIDX () -- Fechar fadeCamera(false, 1.0) setTimer(function() fadeCamera(true, 0.5) setCameraTarget(localPlayer) end, 1000, 1) if isElement(VeiculoAmostra) then destroyElement(VeiculoAmostra) end if isTimer(timer) then killTimer(timer) end end end elseif source == FecharLoja then if AirNewSCR_Concessionaria == true then AbrirFecharGUIDX () -- Fechar fadeCamera(false, 1.0) setTimer(function() fadeCamera(true, 0.5) setCameraTarget(localPlayer) end, 1000, 1) if isElement(VeiculoAmostra) then destroyElement(VeiculoAmostra) end if isTimer(timer) then killTimer(timer) end end end end) local components = { "radar" } function AbrirFecharGUIDX () if AirNewSCR_Concessionaria == false then addEventHandler ( "onClientRender", root, LojaVeiculosDX ) showCursor ( true ) guiSetVisible ( FecharLoja, true ) guiSetVisible ( GridListLoja, true ) guiSetVisible ( ComprarLoja, true ) AirNewSCR_Concessionaria = true setElementFrozen ( localPlayer, true ) setElementDimension ( localPlayer, 1 ) for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end else removeEventHandler ( "onClientRender", root, LojaVeiculosDX ) showCursor ( false ) guiSetVisible ( FecharLoja, false ) guiSetVisible ( GridListLoja, false ) guiSetVisible ( ComprarLoja, false ) AirNewSCR_Concessionaria = false setElementData ( localPlayer, "Concessionaria", false ) setElementDimension ( localPlayer, 0 ) setTimer(function() setElementFrozen ( localPlayer, false ) end, 1001, 1) for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end end end addEventHandler("onClientMarkerHit", resourceRoot, function(player) if not isPedOnGround ( localPlayer ) then return end if getElementType(player) ~= "player" or player ~= localPlayer or isPedInVehicle(player) then return end if Concessionarias_AirNewSCR[source] then i = tonumber(getElementID(source)) guiGridListClear(GridListLoja) for i, v in ipairs(Lista_Veiculos_Concessionarias["ID"]) do local Nome_do_Veiculo = Nomes_Veiculos_Editados[ v[1] ] or getVehicleNameFromModel(v[1]) local row = guiGridListAddRow(GridListLoja) guiGridListSetItemText(GridListLoja, row, 1, Nome_do_Veiculo, false, true) guiGridListSetItemText(GridListLoja, row, 2, tostring(v[2]), false, true) end LocalID = getElementData ( source, "LojaNumeroID" ) setElementData ( localPlayer, "Concessionaria", LocalID ) setTimer(function() setCameraMatrix(Lista_Veiculos_Concessionarias["CamX"], Lista_Veiculos_Concessionarias["CamY"], Lista_Veiculos_Concessionarias["CamZ"], Lista_Veiculos_Concessionarias["lookAtX"], Lista_Veiculos_Concessionarias["lookAtY"], Lista_Veiculos_Concessionarias["lookAtZ"]) AbrirFecharGUIDX () -- Abrir guiGridListSetSelectedItem(GridListLoja, 0, 1) local Nome_do_Veiculo = guiGridListGetItemText(GridListLoja, 0, 1) local ID_do_Veiculo = getVehicleModelFromNewName(Nome_do_Veiculo) or getVehicleModelFromName(Nome_do_Veiculo) local x, y, z = Lista_Veiculos_Concessionarias["vPosX"], Lista_Veiculos_Concessionarias["vPosY"], Lista_Veiculos_Concessionarias["vPosZ"] if isElement(VeiculoAmostra) then destroyElement(VeiculoAmostra) end if isTimer(timer) then killTimer(timer) end VeiculoAmostra = createVehicle ( ID_do_Veiculo, x, y, z ) -- Criar Veiculo setVehicleDamageProof ( VeiculoAmostra, true ) -- Blindar setElementFrozen ( VeiculoAmostra, true ) -- Congelar setVehicleColor ( VeiculoAmostra, COR_R, COR_G, COR_B, COR_A ) -- Pintar setElementDimension ( VeiculoAmostra, 1 ) timer = setTimer ( function() local x, y, z = getElementRotation ( VeiculoAmostra ) setElementRotation ( VeiculoAmostra, x, y, z-1 ) end, 50, 0 ) -- Rotacionar Veiculo end, 400, 1 ) end end) Link to comment
DNL291 Posted June 4, 2019 Share Posted June 4, 2019 Type the command /debugscript 3 and check if it shows any error/warning. If it has no erros, I have no idea... this script is badly written and optimized. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now