-
Posts
60 -
Joined
-
Last visited
Everything posted by dener189
-
Oque fiz de errado? KKKKKKKK Server: function AceitarEmprego02 (source) exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", AceitarEmprego02 ) if getElementData ( source, "AirNew>Encaminhamento" ) == "Entregador de Jornal" then setElementData ( source, "AirNew>Encaminhamento", false ) setElementData ( source, "Emprego", "Entregador de Jornal" ) exports.Scripts_Dxmessages:outputDx(source, "Você Agora Trabalha de Entregador de Jornal, Para Mais Informações Digite ( /Profissao )", "success") triggerServerEvent ("onRequestPegarEmprego", localPlayer, "pegarEmprego") else exports.Scripts_Dxmessages:outputDx(source, "Você Precisa Estar Encaminhado da Agencia de Empregos para Trabalhar neste Local!", "error") end end function confirmTrampo (type, join, leave) if (type == "pegarEmprego") then -- Se a string enviada pelo client for "pegarEmprego", então: if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (client)), aclGetGroup("Entregador"))) then -- Se o jogador já estiver na acl "Mecanico", então: else -- Senão: aclGroupAddObject (aclGetGroup("Entregador"), "user."..getAccountName (getPlayerAccount (client))) -- Coloca o jogador na acl "Mecanico". end end end addEvent ("onRequestPegarEmprego", true) addEventHandler ("onRequestPegarEmprego", root, confirmTrampo) function RecusarEmprego02 (source) exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", RecusarEmprego02 ) if isElementVisibleTo ( HQEntregadorDeJornalBlip, source ) then setElementVisibleTo ( HQEntregadorDeJornalBlip, source, false ) end removeElementData ( source, "Emprego", "Entregador de Jornal" ) triggerServerEvent ("onRequestSairEmprego", localPlayer, "sairEmprego") exports.Scripts_Dxmessages:outputDx(source, "Você se Demitiu do Emprego de Entregador de Jornal com Sucesso!", "warning") end function sairTrampo (type, join, leave) if (type == "sairEmprego") then -- Se a string enviada pelo client for "sairEmprego", então: if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (client)), aclGetGroup("Entregador"))) then -- Se o jogador estiver na acl "Mecanico", então: aclGroupRemoveObject (aclGetGroup("Entregador"), "user."..getAccountName (getPlayerAccount (client))) -- Remove o jogador da acl "Mecanico". else end end end addEvent ("onRequestSairEmprego", true) addEventHandler ("onRequestSairEmprego", root, sairTrampo)
-
By AirNews SCR kkkk
-
Olá pessoal da comunidade PT/BR do MTA, estou com uma duvida. Tenho um script de entregador de jornais, queria saber se consigo fazer que o player entre em um grupo da ACL "Entregador de Jornal" quando ele acabar de ingressar na profissão e ele for removido ao pedir demissão? Client --[[ ################################################ # # # Script Criado Por # # FACEBOOK.COM/AIRNEWSCR # # # # # ################################################ --]] -------------------------------------------------------------------- local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) -------------------------------------------------------------------- function Window(rnames) if isElement(myWindow) then return end local screenW, screenH = guiGetScreenSize() myWindow = guiCreateWindow((screenW - x*485) / 2, (screenH - y*404) / 2, x*485, y*404, "Rotas", false) rotas = guiCreateGridList(x*40, y*40, x*405, y*275, false, myWindow) guiWindowSetSizable(myWindow, false) guiSetAlpha(rotas, x*0.70) guiGridListAddColumn( rotas, "Rotas", x*0.85 ) for k,v in pairs(rnames) do row = guiGridListAddRow ( rotas ) guiGridListSetItemText ( rotas, row, 1, tostring(k), false, false ) end showCursor(true) fechar = guiCreateButton(x*275, y*334, x*168, y*35, "Fechar", false, myWindow) escolher = guiCreateButton(x*42, y*334, x*168, y*35, "Carregar", false, myWindow) end addEvent("AirNew>JOBEntregadorDeJornal>AbrirPainel<Client", true) addEventHandler("AirNew>JOBEntregadorDeJornal>AbrirPainel<Client", localPlayer, Window) function botoes(bt,state) if state == "up" and bt == "left" then if source == fechar then if isElement(myWindow) then destroyElement(myWindow) showCursor(false) end end if source == escolher then local selectedItemx = guiGridListGetSelectedItem(rotas) local nome = guiGridListGetItemText(rotas, selectedItemx, 1) if nome == nil then outputChatBox("#00FF73[HR] #ffffffSelecione Uma Rota",255,255,255,true) return end triggerServerEvent("AirNew>request>Startrota>Server>EntregadorDeJornal",localPlayer,localPlayer,nome) if isElement(myWindow) then destroyElement(myWindow) showCursor(false) end end end end addEventHandler("onClientGUIClick", root,botoes) function blips(state,x,y,z) if state == true then if not isElement(blips) then blips = createBlip ( x, y, z, 0) end else if isElement(blips) then destroyElement(blips) end end end addEvent("AirNew>JOBEntregadorDeJornal>blips<Client", true) addEventHandler("AirNew>JOBEntregadorDeJornal>blips<Client", localPlayer, blips) function DesligarAntiQuedaBike () setPedCanBeKnockedOffBike ( localPlayer, true ) end addEvent( "Desligar:AntiQueda", true ) addEventHandler( "Desligar:AntiQueda", localPlayer, DesligarAntiQuedaBike ) function LigarAntiQuedaBike () setPedCanBeKnockedOffBike ( localPlayer, false ) end addEvent( "Ligar:AntiQueda", true ) addEventHandler( "Ligar:AntiQueda", localPlayer, LigarAntiQuedaBike ) Server MarkerSafeEntregadorDeJornal = createMarker( 765.68848, -1355.44495, 13.52570, "cylinder", 35, 0, 255, 0, 0) EntregadorDeJornalPickup = createPickup ( 783.27710, -1327.66260, 13.54688, 3, 1210) MarkerEntregadorDeJornal = createMarker ( 783.27710, -1327.66260, 13.54688, "cylinder", 1.2, 255, 255, 255, 0 ) attachElements ( MarkerEntregadorDeJornal, EntregadorDeJornalPickup, 0, 0, -1 ) function CancelarSumirPickup ( player ) cancelEvent() end addEventHandler ( "onPickupHit", EntregadorDeJornalPickup, CancelarSumirPickup ) LetraParaMarkers = "k" cmd1 = "hq" cmd2 = "profissao" local HQEntregadorDeJornalBlip = createBlip ( 783.27710, -1327.66260, 13.54688 ) setElementVisibleTo ( HQEntregadorDeJornalBlip, root, false ) -------------------------------------------------------------------- function VerificarBlipEmprego(player) if player then acc = getPlayerAccount ( player ) if isGuestAccount ( acc ) then return end setElementVisibleTo ( HQEntregadorDeJornalBlip, player, false ) end end setTimer( function() for i, pl in pairs(getElementsByType("player")) do if pl ~= (false or nil) then if getElementData ( pl, "Emprego" ) == "Entregador de Jornal" then return end VerificarBlipEmprego(pl) end end end, 3000,0) -------------------------------------------------------------------- function ComandoHQ ( source ) if getElementData ( source, "Emprego" ) == "Entregador de Jornal" then if isElementVisibleTo ( HQEntregadorDeJornalBlip, source ) then setElementVisibleTo ( HQEntregadorDeJornalBlip, source, false ) exports.Scripts_Dxmessages:outputDx(source, "Seu Local de Trabalho foi Desmarcado do Mapa!", "info") else setElementVisibleTo ( HQEntregadorDeJornalBlip, source, true ) exports.Scripts_Dxmessages:outputDx(source, "Seu Local de Trabalho foi Marcado no Mapa!", "info") end end end addCommandHandler ( cmd1, ComandoHQ ) -------------------------------------------------------------------- function AceitarEmprego02 (source) exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", AceitarEmprego02 ) if getElementData ( source, "AirNew>Encaminhamento" ) == "Entregador de Jornal" then setElementData ( source, "AirNew>Encaminhamento", false ) setElementData ( source, "Emprego", "Entregador de Jornal" ) exports.Scripts_Dxmessages:outputDx(source, "Você Agora Trabalha de Entregador de Jornal, Para Mais Informações Digite ( /Profissao )", "success") else exports.Scripts_Dxmessages:outputDx(source, "Você Precisa Estar Encaminhado da Agencia de Empregos para Trabalhar neste Local!", "error") end end function RecusarEmprego02 (source) exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", RecusarEmprego02 ) if isElementVisibleTo ( HQEntregadorDeJornalBlip, source ) then setElementVisibleTo ( HQEntregadorDeJornalBlip, source, false ) end removeElementData ( source, "Emprego", "Entregador de Jornal" ) exports.Scripts_Dxmessages:outputDx(source, "Você se Demitiu do Emprego de Entregador de Jornal com Sucesso!", "warning") end -------------------------------------------------------------------- function ComandosProf ( ThePlayer ) if getElementData ( ThePlayer, "Emprego" ) == "Entregador de Jornal" then playSoundFrontEnd ( ThePlayer, 43 ) outputChatBox ( "#F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #F96031Profissão #F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #BEE09AComandos da Profissão de Entregador de Jornal", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #55D444/HQ #ffffff- #9ABDE0Para Marcar / Desmarcar o seu Local de Trabalho", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #55D444/Rotas #ffffff- #9ABDE0Abre a Lista de Rotas Disponiveis Para Trabalhar", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #FFD700Entre na Lambreta e Digite /Rotas Selecione uma Rota e Siga os Checkpoints!", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #F96031Profissão #F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~", ThePlayer, 255, 255, 255, true ) end end addCommandHandler(cmd2, ComandosProf ) -------------------------------------------------------------------- function emarker(marker,md) if (md) then if isPedInVehicle ( source ) then return end if marker == MarkerEntregadorDeJornal then if getElementData ( source, "Emprego" ) == "Entregador de Jornal" then exports.Scripts_OnMarkerMsgs_:create(source,"Aperte 'K' Para se Demitir do Emprego de Entregador de Jornal") bindKey ( source, LetraParaMarkers, "down", RecusarEmprego02 ) else exports.Scripts_OnMarkerMsgs_:create(source,"Aperte 'K' Para Aceitar o Emprego de Entregador de Jornal") bindKey ( source, LetraParaMarkers, "down", AceitarEmprego02 ) end end end end addEventHandler("onPlayerMarkerHit",getRootElement(),emarker) function lmarker(marker,md) if (md) then if marker == MarkerEntregadorDeJornal then exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", AceitarEmprego02 ) unbindKey ( source, LetraParaMarkers, "down", RecusarEmprego02 ) end end end addEventHandler("onPlayerMarkerLeave",getRootElement(),lmarker) function CriarVeiculosComData () VeiculosComDataEntregadorDeJornal = { createVehicle(462, 785.55151, -1332.39575 -0, 13.54213, 0, 0, 90 ), createVehicle(462, 785.55151, -1332.39575 -2, 13.54213, 0, 0, 90 ), createVehicle(462, 785.55151, -1332.39575 -4, 13.54213, 0, 0, 90 ), createVehicle(462, 785.55151, -1332.39575 -6, 13.54213, 0, 0, 90 ), createVehicle(462, 785.55151, -1332.39575 -8, 13.54213, 0, 0, 90 ), createVehicle(462, 785.55151, -1332.39575 -10, 13.54213, 0, 0, 90 ), createVehicle(462, 785.55151, -1332.39575 -12, 13.54213, 0, 0, 90 ), createVehicle(462, 785.55151, -1332.39575 -14, 13.54213, 0, 0, 90 ), createVehicle(462, 785.55151, -1332.39575 -16, 13.54213, 0, 0, 90 ), createVehicle(462, 785.55151, -1332.39575 -18, 13.54213, 0, 0, 90 ), } for i, veh in ipairs(VeiculosComDataEntregadorDeJornal) do setElementData ( veh, "Emprego", "Entregador de Jornal" ) setVehicleDamageProof(veh,true) setVehicleColor( veh, 0, 0, 0 ) setVehiclePlateText ( veh, "RPGAMING" ) addEventHandler("onVehicleStartEnter", veh, VerificarEmprego ) --addEventHandler("onVehicleExit", veh, SairDoVeiculosComData ) local tx, ty, tz = getElementPosition(veh) local rx, ry, rz = getElementRotation(veh) setVehicleRespawnPosition(veh, tx, ty, tz, rx, ry, rz) end end addEventHandler("onResourceStart", resourceRoot, CriarVeiculosComData ) function VerificarEmprego (thePlayer, seat) local Jogador = getElementData(thePlayer, "Emprego" ) if seat == 0 then if Jogador == "Entregador de Jornal" then else cancelEvent() exports.Scripts_Dxmessages:outputDx(thePlayer, "Esse Veiculo é Exclusivo dos Entregadores de Jornal!", "error") end end end --[[function SairDoVeiculosComData () local veh = source setTimer(function() if getVehicleOccupant(veh) == false then respawnVehicle(veh) end end, 30000, 1) end addEventHandler ( "onPlayerQuit", getRootElement(), SairDoVeiculosComData ) --]] -------------------------------------------------------------------- local rElement = getRootElement() function respawnVehicles(player, seconds) for i, veh in ipairs(VeiculosComDataEntregadorDeJornal) do if isEmpty( veh ) then respawnVehicle ( veh ) end end end setTimer(respawnVehicles, 10000,0) function isEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end -------------------------------------------------------------------- atualrotnumberJORNAL = {} ppcikJORNAL = {} blips = {} rotasJORNAL = { ["Entregas de Jornais - Los Santos (1) - 20 Entregas - $670"] = { {993.64386, -1050.08850, 30.72189}, {1051.22083, -1049.50073, 31.70257}, {1117.78308, -1030.55933, 31.88287}, {1190.73914, -1027.36011, 32.35918}, {1466.25684, -1172.65686, 23.88302}, {1673.56787, -1169.50952, 23.92861}, {1791.41406, -1164.77539, 23.82813}, {2095.31763, -1292.43701, 23.97214}, {2150.26270, -1291.66003, 23.97753}, {2352.69019, -1513.26306, 24.00000}, {2561.87158, -1467.34753, 24.01236}, {2756.12573, -1180.33130, 69.39844}, {2863.57446, -1440.18982, 10.95315}, {2507.24414, -1725.65881, 13.54688}, {2390.33276, -1721.86511, 13.58705}, {2228.38867, -1722.77356, 13.55438}, {2175, -1742, 13.55438}, {2072.61230, -1793.96008, 13.54688}, {1871.15784, -1923.91858, 13.54688}, {1352.39136, -1758.33508, 13.50781}, }, ["Entregas de Jornais - Los Santos (2) - 20 Entregas - $750"] = { {823.93018, -1413.86011, 13.46503}, {909.32098, -1504.01135, 13.54223}, {797.72333, -1580.37390, 13.54688}, {645.75140, -1694.06555, 14.89330}, {422.36475, -1758.63403, 8.18526}, {305.55188, -1771.70020, 4.54249}, {168.62589, -1770.10681, 4.43438}, {138.38370, -1460.07129, 25.62103}, {169.82892, -1348.34363, 69.36220}, {280.87973, -1320.37817, 53.81308}, {543.01135, -1202.30334, 44.50127}, {562.19452, -1060.57458, 74.59800}, {782.98035, -808.70764, 65.19865}, {908.08984, -684.05566, 116.23006}, {1091.30396, -627.89929, 111.38203}, {1280.77197, -614.80652, 102.93521}, {1437.30725, -935.30865, 36.26117}, {1335.64368, -1066.11133, 27.87136}, {1144.98792, -1131.54431, 23.82813}, {1022.52026, -1122.13037, 23.87152}, }, } pay = { ["Entregas de Jornais - Los Santos (1) - 20 Entregas - $670"] = 670, ["Entregas de Jornais - Los Santos (2) - 20 Entregas - $750"] = 750, } function ifPlayerEnterOnMarker(markerHit,matchingDimension) if isPedInVehicle(source) then if markerHit == ppcikJORNAL[source] then if (matchingDimension) then if isElement(ppcikJORNAL[source]) then local rname = getElementData(source,"rtnameJornal") or nil if rname == nil then return end destroyElement(ppcikJORNAL[source]) triggerClientEvent(source,"AirNew>JOBEntregadorDeJornal>blips<Client",source,false) local vh = getPedOccupiedVehicle(source) toggleAllControls ( source, false ) setControlState ( source, "handbrake", true ) if atualrotnumberJORNAL[source] <= #rotasJORNAL[rname] then exports.Scripts_Dxmessages:outputDx(source, "Entregando Jornais... Aguarde 2 Segundos!", "info") setTimer(gerarrota,2500,1,source) setTimer(function(source) exports.Scripts_Dxmessages:outputDx(source, "Jornais Entregues, Siga Para o Proximo Checkpoint!", "success") end,2500,1,source) elseif atualrotnumberJORNAL[source] == #rotasJORNAL[rname]+1 then setElementData(source,"rtnameJornal",rname) atualrotnumberJORNAL[source] = 1 local rec = pay[rname] givePlayerMoney(source,tonumber(rec)) local vh = getPedOccupiedVehicle(source) setTimer(function(source) exports.Scripts_Dxmessages:outputDx(source, "Você Recebeu um Valor de $"..rec.." Por Finalizar as Entregas de Jornais!", "success") end,2500,1,source) setTimer(function(source) toggleAllControls ( source, true ) end, 2500,1, source ) setTimer(function(source) setControlState ( source, "handbrake", false ) end, 2500,1, source ) setElementData(source,"rtnameJornal",nil) end end end end end end addEventHandler("onPlayerMarkerHit",getRootElement(),ifPlayerEnterOnMarker) -------------------------------------------------------------------- function VerificarCairBike(player) if player then acc = getPlayerAccount ( player ) if isGuestAccount ( acc ) then return end local rname = getElementData(player,"rtnameJornal") or nil if rname == nil then triggerClientEvent ( "Desligar:AntiQueda", player ) else triggerClientEvent ( "Ligar:AntiQueda", player ) end end end setTimer( function() for i, pl in pairs(getElementsByType("player")) do if pl ~= (false or nil) then if getElementData ( pl, "Emprego" ) == "Entregador de Jornal" then VerificarCairBike(pl) end end end end, 3000,0) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function pickjobJornal(source) if not isElement(source) then return end local im = isPedInVehicle(source) if im == false then return end local job = getElementData(source,"Emprego") or false if job == "Entregador de Jornal" then local vh = getPedOccupiedVehicle(source) if isElement(vh) then local x,y = getElementPosition(vh) local x1,y1 = getElementPosition(source) local dist = getDistanceBetweenPoints2D(x,y,x1,y1) local isMarkerSafe = isElementWithinMarker(vh,MarkerSafeEntregadorDeJornal) local id = getElementModel(vh) local seat = getPedOccupiedVehicleSeat(source) if dist > 0 then return end if id == 462 then if seat == 0 then if isMarkerSafe == false then return end triggerClientEvent(source,"AirNew>JOBEntregadorDeJornal>AbrirPainel<Client",source,rotasJORNAL) end end end end end addCommandHandler("rotas",pickjobJornal) function receivert(source,rotaname) if isElement(ppcikJORNAL[source]) then destroyElement(ppcikJORNAL[source]) end triggerClientEvent(source,"AirNew>JOBEntregadorDeJornal>blips<Client",source,false) setElementData(source,"rtnameJornal",rotaname) atualrotnumberJORNAL[source] = 1 gerarrota(source) end addEvent("AirNew>request>Startrota>Server>EntregadorDeJornal", true) addEventHandler("AirNew>request>Startrota>Server>EntregadorDeJornal",getRootElement(), receivert) function gerarrota(source) local rname = getElementData(source,"rtnameJornal") or nil if rname == nil then return end if not isElement(ppcikJORNAL[source]) and isPedInVehicle(source) then local vh = getPedOccupiedVehicle(source) toggleAllControls ( source, true ) setControlState ( source, "handbrake", false ) local id = tonumber(atualrotnumberJORNAL[source]) local x,y,z = rotasJORNAL[rname][id][1],rotasJORNAL[rname][id][2],rotasJORNAL[rname][id][3] ppcikJORNAL[source] = createMarker (x, y,z, "checkpoint", 4, 255, 0, 0, 50,source) triggerClientEvent(source,"AirNew>JOBEntregadorDeJornal>blips<Client",source,true,x,y,z) atualrotnumberJORNAL[source] = id+1 end end function sair ( quitType ) if isElement(ppcikJORNAL[source]) then destroyElement(ppcikJORNAL[source]) end end addEventHandler ( "onPlayerQuit", getRootElement(), sair ) function SairDaBike ( thePlayer, seat, jacked ) local rname = getElementData(thePlayer,"rtnameJornal") or nil if rname == nil then return end canceljobtimer (thePlayer) exports.Scripts_Dxmessages:outputDx(thePlayer, "Você saiu da Lambreta, e suas entregas foram canceladas!", "warning") end addEventHandler ( "onVehicleExit", getRootElement(), SairDaBike ) function canceljobtimer(source) if isElement(ppcikJORNAL[source]) then destroyElement(ppcikJORNAL[source]) end triggerClientEvent(source,"AirNew>JOBEntregadorDeJornal>blips<Client",source,false) atualrotnumberJORNAL[source] = 1 setElementData(source,"rtnameJornal",nil) end function canceljobdeath() local job = getElementData(source,"Emprego") or false if job ~= "Entregador de Jornal" then return end local rname = getElementData(source,"rtnameJornal") or nil if rname == nil then return end canceljobtimer(source) exports.Scripts_Dxmessages:outputDx(source, "Você Morreu e Suas Entregas Foram Canceladas!", "warning") end addEventHandler( "onPlayerWasted", getRootElement( ),canceljobdeath)
-
O B R I G A D O !!!!! Funcionou. Apenas mudei as linhas para "--setPlayerHudComponentVisible("all", true)" e já era
-
Ok, vou ver se acho qual o script que tá causando isso. Foi mal por ter postado em inglês, ia postar aqui em PT/BR C:\Users\dener\OneDrive\Área de Trabalho\Hurley Roleplay\mods\deathmatch\resources\[mapas]\[MAPA]Mec\sourceC.Lua (2 hits) Line 1192: --setPlayerHudComponentVisible("all", false) Line 1203: --setPlayerHudComponentVisible("all", true) C:\Users\dener\OneDrive\Área de Trabalho\Hurley Roleplay\mods\deathmatch\resources\[scripts]\ Hud\AirNewSCR_c.Lua (2 hits) Line 208: setPlayerHudComponentVisible(hudComponents, false) Line 216: setPlayerHudComponentVisible(hudComponents, true) C:\Users\dener\OneDrive\Área de Trabalho\Hurley Roleplay\mods\deathmatch\resources\[scripts]\ Login\Lua\function.Lua (2 hits) Line 72: setPlayerHudComponentVisible("all", false) Line 80: setPlayerHudComponentVisible("all", true) C:\Users\dener\OneDrive\Área de Trabalho\Hurley Roleplay\mods\deathmatch\resources\[scripts]\ MiraSniper\client.Lua (3 hits) Line 23: setPlayerHudComponentVisible ("crosshair", false); Line 52: setPlayerHudComponentVisible ("crosshair", true); Line 62: setPlayerHudComponentVisible ("crosshair", true); C:\Users\dener\OneDrive\Área de Trabalho\Hurley Roleplay\mods\deathmatch\resources\[scripts]\ PainelVIP\AirNew_c.Lua (2 hits) Line 291: setPlayerHudComponentVisible ( v, false ) Line 300: setPlayerHudComponentVisible ( v, true ) C:\Users\dener\OneDrive\Área de Trabalho\Hurley Roleplay\mods\deathmatch\resources\[scripts]\ Radar\client\main.Lua (2 hits) Line 20: setPlayerHudComponentVisible("radar",false) Line 26: setPlayerHudComponentVisible("radar",true) C:\Users\dener\OneDrive\Área de Trabalho\Hurley Roleplay\mods\deathmatch\resources\[scripts]\ Removedor\client.Lua (2 hits) Line 19: setPlayerHudComponentVisible(hudComponents, false) Line 27: setPlayerHudComponentVisible(hudComponents, true) C:\Users\dener\OneDrive\Área de Trabalho\Hurley Roleplay\mods\deathmatch\resources\[scripts]\ Velocimetro\client.Lua (16 hits) Line 303: setPlayerHudComponentVisible ( "ammo", false ) Line 304: setPlayerHudComponentVisible ( "armour", false ) Line 305: setPlayerHudComponentVisible ( "breath", false ) Line 306: setPlayerHudComponentVisible ( "clock", false ) Line 307: setPlayerHudComponentVisible ( "health", false ) Line 308: setPlayerHudComponentVisible ( "money", false ) Line 309: setPlayerHudComponentVisible ( "weapon", false ) Line 310: setPlayerHudComponentVisible ( "wanted", false ) Line 318: setPlayerHudComponentVisible ( "ammo", true ) Line 319: setPlayerHudComponentVisible ( "armour", true ) Line 320: setPlayerHudComponentVisible ( "breath", true ) Line 321: setPlayerHudComponentVisible ( "clock", true ) Line 322: setPlayerHudComponentVisible ( "health", true ) Line 323: setPlayerHudComponentVisible ( "money", true ) Line 324: setPlayerHudComponentVisible ( "weapon", true ) Line 325: setPlayerHudComponentVisible ( "wanted", true ) C:\Users\dener\OneDrive\Área de Trabalho\Hurley Roleplay\mods\deathmatch\resources\[scripts]\ Velocimetro\config.Lua (1 hit) Line 1: setPlayerHudComponentVisible ( "vehicle_name", false ) Deu Esse Resultado
-
Hello MTA community, I have a server on faze BETA and I have this problem. The original GTA SA Hud comes back, a "Solution" I had was to use a function that restarted the script every 5 seconds, is a good "Solution" because it does not return the original hud but is not yet effective. Watch the video and know what I'm talking about
-
Olá comunidade PT/BR do MTA, tenho um servidor em faze BETA e estou com esse problema. O Hud original do GTA SA volta, uma "Solução" que tive foi usar uma função que reiniciava o script a cada 5 segundos, é uma "Solução" boa pois não volta o hud original, mas mesmo assim não é eficaz. Vejam o vídeo e saberão oque to falando https://youtu.be/zblY47fgsUo
-
[Ajude-Me] Painéis invisíveis
dener189 replied to dener189's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
Achei oq estava interferindo nos demais scripts. O radar do mapa quem fazia os painéis sumirem -
[Ajude-Me] Painéis invisíveis
dener189 replied to dener189's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
Vou fazer testes e ver qual script tá causando isso, espero que seja apenas um resource afetando o server em si -
[Ajude-Me] Painéis invisíveis
dener189 replied to dener189's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
https://imgur.com/nInVQeM primeiro Link -
Hello MTA community, I am having problems on my server and I came across this topic a help request '-' 1° Error: Simply all panels that open on "arrow, clynder and etc" markers are invisible, only appear after I open the map. 2° Hud and Radio from the original GTA S.A do not fade from the screen, only if I restart the script "HUD Remover and the Radio Remover" https://imgur.com/nInVQeM --Bug Radar / Dashboard does not appear https://imgur.com/0VpJpUV --Radar showing up after I open the map "Key: F11"
-
Olá comunidade MTA, eu estou tendo problemas em meu servidor e vim através desse tópico um pedido de ajuda '-' 1° Erro: Simplesmente todos os paineis que se abrem em marcadores "arrow, clynder e etc" ficam invisíveis, apenas aparecem depois de eu abrir o mapa. 2° Hud e Radio do GTA S.A original não somem da tela, apenas se eu reiniciar o script "Removedor de HUDs e o Removedor de Rádios" https://imgur.com/undefined --Radar Bugado/Painel não aparece https://imgur.com/0VpJpUV --Radar aparecendo após eu abrir o mapa "Tecla: F11"
-
I sent because I don't know where the error is, and may have other errors in other scripts
-
I'll be sending all the tracks from all the scripts "postos.Lua" local markersPostos = { {city = "LS-2", x = -99.317001342773, y = -1172.4971923828, z = 1.4453792572021, style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -95.26969909668, y = -1174.9270019531, z = 1.2943935394287, style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -88.415390014648, y = -1177.2751464844, z = 1.1038908958435, style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -83.929489135742, y = -1166.6140136719, z = 1.279646396637, style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -83.929489135742, y = -1166.6140136719, z = 1.279646396637, style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -91.114555358887, y = -1163.8930664063, z = 1.316956281662, style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -86.747230529785, y = -1163.6921386719, z = 1.216748714447, style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 1943.6787109375, y = -1778.5, z = 12.390598297119,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 1943.9921875, y = -1771.1083984375, z = 12.390598297119,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 1939.2060546875, y = -1771.4345703125, z = 12.3828125,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 1939.3017578125, y = -1778.236328125, z = 12.390598297119,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 2120.9228515625, y = 927.486328125, z = 9.8203125,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 2114.7607421875, y = 927.7734375, z = 9.8203125,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 2114.951171875, y = 917.513671875, z = 9.8203125,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 70.021484375, y = 1218.794921875, z = 17.810596466064,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -2029.5693359375,y = 157.0537109375, z = 27.8359375,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -2023.94140625, y = 156.91796875, z = 27.8359375,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -2407.7900390625, y = 981.638671875, z = 44.296875,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -2407.966796875, y = 971.537109375, z = 44.296875,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 2205.5888671875, y = 2469.7236328125, z = 9.8203125,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 2205.7412109375, y = 2480.01953125, z = 9.8203125,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 2194.095703125, y = 2475.271484375, z = 9.8203125,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 2194.220703125, y = 2470.84765625, z = 9.8203125,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -1602.03125, y = -2710.5712890625, z = 47.5390625,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -1605.4091796875, y = -2714.3037109375, z = 47.533473968506,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -1608.5830078125, y = -2718.638671875, z = 47.5390625,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 622.9189453125, y = 1680.3486328125, z = 5.9921875,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 615.6982421875, y = 1690.5673828125, z = 5.9921875,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 608.8447265625, y = 1700.0146484375, z = 5.9921875,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 1008.3486328125, y = -939.84375, z = 41.1796875,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 999.6259765625, y = -940.79296875, z = 41.1796875,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -92.314453125, y = -1176.08984375, z = 1.2067136764526,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -94.1083984375, y = -1161.775390625, z = 1.2461423873901,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 1873.2841796875, y = -2380.119140625, z = 12.5546875,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = -1280.7412109375, y = -0.7314453125, z = 13.1484375,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 1574.8916015625, y = 1449.80078125, z = 9.8299560546875,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170}, {city = "LS-2", x = 354.5390625, y = 2538.3251953125, z = 15.717609405518,style = "cylinder", font = 1.0, r = 255, g = 165, b = 0, opaccity = 170} } local blipsGasStations = { {city = "LSBLIP", x = 1943.6787109375, y = -1778.5,12.390598297119, z = 12.390598297119, icon = 44, size = 4, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = 2120.9228515625, y = 927.486328125, z = 9.8203125, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = 70.021484375, y = 1218.794921875, z = 17.810596466064, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = -2029.5693359375, y = 157.0537109375, z = 27.8359375, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = -2407.7900390625, y = 981.638671875, z = 44.296875, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = 2205.5888671875, y = 2469.7236328125, z = 9.8203125, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = -1602.03125, y = -2710.5712890625, z = 47.5390625, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = 622.9189453125, y = 1680.3486328125, z = 5.9921875, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = 1008.3486328125, y = -939.84375, z = 41.1796875, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = -92.314453125, y = -1176.08984375, z = 1.2067136764526, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = 1873.2841796875, y = -2380.119140625, z = 12.5546875, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = -1280.7412109375, y = -0.7314453125, z = 13.1484375, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = 1574.8916015625, y = 1449.80078125, z = 9.8299560546875, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = 354.5390625, y = 2538.3251953125, z = 15.717609405518, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, {city = "LSBLIP", x = -1676.64453125, y = 411.70034790039, z = 7.1796875, icon = 44, size = 2, r = 0, g = 0, b = 0, a = 0, ordering = 0, visibleDistance = 200}, } function createGasStations() for i,v in ipairs(markersPostos) do local m = createMarker(v.x, v.y, v.z, v.style, v.font, v.r, v.g, v.b, v.opaccity) addEventHandler("onClientMarkerHit", m, refuelCar) end end function createBlipsFromGasStations() for i,v in ipairs(blipsGasStations) do local b = createBlip(v.x, v.y, v.z, v.icon, v.size, v.r, v.g, v.b, v.a, v.ordering, v.visibleDistance) end end function refuelCar(player) if (player ~= localPlayer) then return false end local seat = getPedOccupiedVehicleSeat(localPlayer) if(seat ~= 0) then return else addEventHandler("onClientRender", root, drawImages) end end createGasStations() createBlipsFromGasStations() function bindFromRefulling() local vehicle = getPedOccupiedVehicle(localPlayer) triggerServerEvent("onVehicleRefulling", localPlayer, vehicle) end function bindFromRefullingFull() local vehicle = getPedOccupiedVehicle(localPlayer) triggerServerEvent("onVehicleRefullingFull", localPlayer, vehicle) end function getVehicleFuel(v) local fuel = getElementData(v, "fuel") if (fuel) then return fuel end return 0 end function dxDrawBorderedText( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) dxDrawText ( text, x - 1, y - 1, w - 1, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y - 1, w + 1, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y + 1, w - 1, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y + 1, w + 1, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y, w - 1, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y, w + 1, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y - 1, w, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y + 1, w, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) end x,y = guiGetScreenSize() MaxFuel = 100 price = "5,00" tick = getTickCount() addEventHandler("onClientMarkerLeave", root, function (player) if (player ~= localPlayer) then return false end removeEventHandler("onClientRender", root, drawImages) end ) x, y = guiGetScreenSize() local font = "default-bold" function resX(value) return (value/800) * x end function resY(value) return (value/600) * y end function drawImages(v) local pedInVehicle = getPedOccupiedVehicle(localPlayer) local fuel = getVehicleFuel(pedInVehicle) dxDrawRectangleGradiente(x*0.35,y*0.2,resX(125),resY(170),0,0,0,200,"left") dxDrawRectangleGradiente(x*0.35+resX(125),y*0.2,resX(125),resY(170),0,0,0,200,"right") dxDrawRectangleGradiente(x*0.35,y*0.2,resX(150),resY(30),180,0,0,200,"left") dxDrawRectangleGradiente(x*0.35+resX(100),y*0.2,resX(150),resY(30),180,0,0,200,"right") dxDrawRecLine(x*0.35,y*0.2,resX(250),resY(30),tocolor(0,0,0,255)) dxDrawRecLine(x*0.35,y*0.2,resX(250),resY(170),tocolor(0,0,0,255)) dxDrawText("POSTO DE COMBUSTIVEL",x*0.35,y*0.2,x*0.35+resX(250),y*0.2+resY(30),tocolor(255,255,255,255),resY(1.4),font,"center","center",true) dxText("Combustivel: #FF0000" .. math.floor(fuel)*1000/1000 .. "%",x*0.35+resX(20),y*0.2+resY(30),x*0.35+resX(260),y*0.2+resY(60),255,255,255,255,1,font,"left","center",true,false,false,true) if (MaxFuel - fuel) < 1 then dxText("Abastecer: #FF0000"..(MaxFuel) - math.floor(fuel) .. " %",x*0.35+resX(20),y*0.2+resY(50),x*0.35+resX(260),y*0.2+resY(80),255,255,255,255,1,font,"left","center",true,false,false,true) else dxText("Abastecer: #FF0000"..(MaxFuel) - math.floor(fuel)*1000/1000 .. "%",x*0.35+resX(20),y*0.2+resY(50),x*0.35+resX(260),y*0.2+resY(80),255,255,255,255,1,font,"left","center",true,false,false,true) end dxText("Preço por Litro: #FF0000$5 = 1%",x*0.35+resX(20),y*0.2+resY(70),x*0.35+resX(260),y*0.2+resY(100),255,255,255,255,1,font,"left","center",true,false,false,true) dxText("Para Abastecer por #FF0000% #FFFFFFaperte: #FF0000L",x*0.35+resX(20),y*0.2+resY(90),x*0.35+resX(260),y*0.2+resY(120),255,255,255,255,1,font,"left","center",true,false,false,true) dxText("Para Encher o Tanque aperte: #FF0000K",x*0.35+resX(20),y*0.2+resY(110),x*0.35+resX(260),y*0.2+resY(140),255,255,255,255,1,font,"left","center",true,false,false,true) dxText("Meu Dinheiro: #FF0000$"..convertNumber( getPlayerMoney(getLocalPlayer())).."",x*0.35+resX(20),y*0.2+resY(130),x*0.35+resX(260),y*0.2+resY(160),255,255,255,255,1,font,"left","center",true,false,false,true) if (getKeyState("L") and (getTickCount() - tick) > 600 and fuel <= 100) then bindFromRefulling() tick = getTickCount() playSound("sounds/song.mp3") end if (getKeyState("K") and (getTickCount() - tick) > 600 and fuel <= 100) then bindFromRefullingFull() tick = getTickCount() playSound("sounds/song.mp3") end end --addEventHandler("onClientRender",root,painelfreeroam) function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end function dxDrawRecLine(x,y,w,h,color) dxDrawRectangle(x,y,w,1,color) -- h dxDrawRectangle(x,y+h-1,w,1,color) -- h dxDrawRectangle(x,y,1,h,color) -- v dxDrawRectangle(x+w-1,y,1,h,color) -- v end function dxText(text,x,y,w,h,red,green,blue,alpha,scale,font,a,b,c,d,e,f) dxDrawText(string.gsub(text,"(#%x%x%x%x%x%x)",""),x+1,y+1,w+1,h+1,tocolor(0,0,0,alpha),scale,font,a,b,c,d,e,f) dxDrawText(text,x,y,w,h,tocolor(red,green,blue,alpha),scale,font,a,b,c,d,e,f) end function dxDrawRectangleGradiente(x,y,w,h,r,g,b,a,direction) if not x or not y or not w or not h or not r or not g or not b or not a or not direction then return outputDebugString("arguments not correspond") end if direction == "left" then local space = (w/a) for i=1,a do local now = space+(i*space) dxDrawRectangle(x+w+space-now,y,space,h,tocolor(r,g,b,i)) end elseif direction == "right" then local space = (w/a) for i=1,a do local now = space+(i*space) dxDrawRectangle(x-(space*2)+now,y,space,h,tocolor(r,g,b,i)) end elseif direction == "down" then local space = (h/a) for i=1,a do local now = space+(i*space) dxDrawRectangle(x,y+now,w,space,tocolor(r,g,b,i)) end elseif direction == "up" then local space = (h/a) for i=1,a do local now = space+(i*space) dxDrawRectangle(x,y+h-now,w,space,tocolor(r,g,b,i)) end else return outputDebugString("direction invalid") end end "carhud.Lua" local screenW,screenH = guiGetScreenSize() local resW,resH = 1366,768 local x,y = (screenW/resW), (screenH/resH) local font = dxCreateFont("fonts/font.ttf", 10) local MaxFuel = 100 function getVehicleFuel(v) local fuel = getElementData(v, "fuel") if (fuel) then return fuel end return 0 end function onPlayerRequestHUD() local asd = getPedOccupiedVehicle(localPlayer) local seat = getPedOccupiedVehicleSeat(localPlayer) if (seat ~= 0) then return end if not (asd) then return else local fuel = getVehicleFuel(asd) dxDrawText("", x*1000, y*800, x*1431, y*714, tocolor(255, 255, 255, 255), y*1, font, "left", "center", false, false, false, true, false) end end addEventHandler("onClientRender", root, onPlayerRequestHUD) function dxDrawRecLine(x,y,w,h,color) dxDrawRectangle(x,y,w,1,color) -- h dxDrawRectangle(x,y+h-1,w,1,color) -- h dxDrawRectangle(x,y,1,h,color) -- v dxDrawRectangle(x+w-1,y,1,h,color) -- v end "carfunctions.Lua" local addingFuel = {} addEvent("onVehicleRefulling", true) function vehicleRefulling(v) if (getPlayerMoney(source) < 5) then outputChatBox("#000000[ #FF0000GASOLINA #000000] #ffffffVocê não tem dinheiro $10", source, 255, 255, 255, true) else setElementData(v, "fuel", getElementData(v, "fuel") + 1) takePlayerMoney(source, 5) end end addEventHandler("onVehicleRefulling", root, vehicleRefulling) addEvent("onVehicleRefullingFull", true) function vehicleRefullingf(v) gabas = 100 - getElementData(v, "fuel") if (getPlayerMoney(source) < tonumber(gabas*5)) then outputChatBox("#000000[ #FF0000GASOLINA #000000] #ffffffVocê não tem dinheiro $"..convertNumber (gabas*5).."", source, 255, 255, 255, true) else setElementData(v, "fuel", getElementData(v, "fuel")+gabas+1) takePlayerMoney(source, tonumber(gabas*5)) end end addEventHandler("onVehicleRefullingFull", root, vehicleRefullingf) function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end
-
This script is a gas system. Not from my altoria. Error message: "main.Lua:16: attempt to compare string with number" and "main.Lua:16: attempt to compare string with number [DUP 5x]" -Main.Lua factor = 0.03 function createVehicles(player) for i,v in ipairs(getElementsByType("vehicle")) do fuel = math.random(10,25) setElementData(v, "fuel", fuel) end end function processFuel(player) for i,v in ipairs(getElementsByType("vehicle")) do local fuel = getElementData(v, "fuel") or math.random(10,25) if (getVehicleEngineState(v) and fuel > 0 ) then fuel = fuel - factor end if (fuel <= 0.99) then fuel = 0 setVehicleEngineState(v, false) end setElementData(v, "fuel", fuel) end end createVehicles() setTimer(processFuel, 1000, 0)
-
This script aims to spawn the vehicle after you get what you want. But I was wondering why you are giving this error, and I was wondering if there was a way for the vehicle to disappear after a second out of it? Server markers = { { 1175.854, -1308.407, 13}, --Hospital LS { -2650.922, 585.387, 13.453}, --Hospital SF { 1624.4620361328, 1818.3846435547, 9.8203125}, --Hospital LV { 1539.487, -1656.687, 12.547}, --DP LS { -1581.739, 651.289, 6.188}, --DP SF { 2256.035, 2477.413, 9.82}, --DP LV } for i,v in ipairs (markers) do marker = createMarker(v[1], v[2], v[3], "cylinder", get("markerSize"), get("markerColorR"), get("markerColorG"), get("markerColorB"), get("markerAlpha")) end veh = {} addEvent ("getCar", true) addEventHandler ("getCar", getRootElement(), function(car) if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local carID = getVehicleModelFromName (car) local x,y,z = getElementPosition(source) local carName = getVehicleNameFromModel (carID) veh[source] = createVehicle(carID, x,y,z) setVehicleColor(veh[source], 255, 255, 255) warpPedIntoVehicle(source, veh[source]) end ) addEventHandler ( "onPlayerQuit", getRootElement(), function () if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end end) function markerHit (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then return end if getElementType(hitPlayer) == "player" then triggerClientEvent ("openMean", hitPlayer) end end addEventHandler ("onMarkerHit", resourceRoot, markerHit) function markerLeave (hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then triggerClientEvent ("closeOpenMean", hitPlayer) end end addEventHandler ("onMarkerLeave", resourceRoot, markerLeave)
-
could you do the final script for me? if not ask too much '-'
-
Hello, I was doing an experience level script, while you level up would play a sound and appear in the center of the screen as you level up, but it is not working
-
Thank you, it worked.
-
attempt to index field '?' (a nil value)
-
ok, tranks
-
could you pack it for me?
-
so would you have to pack up the band for that? addEventHandler ("onPlayerWasted", getRootElement(), function (spawnPlayer)
-
When the player dies simply he is not born in the nearest hospital, he just goes under the camera local spawnX, spawnY, spawnZ = 1480.9730224609, -1771.46875, 18.8 --Primeiro Spawn function joinHandler() spawnPlayer(source, spawnX, spawnY, spawnZ) fadeCamera(source, true) setCameraTarget(source, source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) local spawnPos = { -- (Prefira usar no máximo 3 casas decimais.) [1] = {2034.9428710938, -1403.2003173828, 18}, -- Hospital 1 LS [2] = {-2655.3991699219, 638.16137695313, 15}, -- Hospital SF [3] = {-1514.6713867188, 2522.4748535156, 56}, -- Hospital Tierra Robada [4] = {1607.62890625, 1818.9958496094, 11}, -- Hospital LV [5] = {-2198.5632324219, -2306.6220703125, 31}, -- Hospital Whetstone } addEventHandler ("onPlayerWasted", getRootElement(), function () -- Executa essa função quando o player morre. local x, y, z = getElementPosition (source) -- x, y, z recebem a posição do player onde ele morreu. local dist = 99999 -- Distância do ponto mais próximo. local id = 0 -- ID da coordenada mais próxima. for i, v in ipairs (spawnPos) do -- Para cada table de coordenadas, faça: local pX, pY, pZ = unpack (spawnPos[i]) -- pX,pY, pZ recebem as coordenadas que estão no spawnPos[i] if getDistanceBetweenPoints3D (x, y, z, pX, pY, pZ) < dist then -- Se a distância dessa coordenada for menor que dist, então: dist = getDistanceBetweenPoints3D (x, y, z, pX, pY, pZ) -- Atualiza a distância para essa. id = i -- Atualiza o id para este. end end if id == 1 then -- Outputs que servem somente para testes. outputChatBox ("Hospital mais próximo: Los Santos", source) elseif id == 2 then outputChatBox ("Hospital mais próximo: San Fierro", source) elseif id == 3 then outputChatBox ("Hospital mais próximo: Tierra Robada", source) elseif id == 4 then outputChatBox ("Hospital mais próximo: Las Venturas", source) elseif id == 5 then outputChatBox ("Hospital mais próximo: Whetstone", source) end setElementData (source, "killNear", id) -- Seta o id mais próximo como data no player. end) function spawnMe () if getElementData (source, "killNear") then -- Se o jogador que morreu tem essa data, então: (quando o jogador entra no server, ele spawna sem essa data) setElementPosition (source, unpack (spawnPos[getElementData (source, "killNear")])) -- Coloca ele na posição desse ID que está na data. removeElementData (source, "killNear") -- Remove essa data, que não será mais usada até que ele morra novamente e uma nova data seja criada. end end addEventHandler ("onPlayerSpawn", getRootElement(), spawnMe) -- Executa essa função quando o player spawna.
-
[AJUDA] Ponto de Spawn de acordo com a localização
dener189 replied to dener189's topic in Programação em Lua
realmente n entendi nada