Jump to content

DNL291

Retired Staff
  • Posts

    3,875
  • Joined

  • Days Won

    67

Everything posted by DNL291

  1. https://forum.multitheftauto.com/topic/121297-socorro-script-rp/
  2. setAccountData @NeoGM O tópico tá na área errada. https://forum.multitheftauto.com/forum/97-portuguese-português/
  3. Provavelmente na estrutura das pastas dentro do resource, na verdade nem pode usar pastas, ambos arquivos de script devem estar no diretório root do resource, pois estão sendo carregados pela pasta raíz, então movê-los para uma pasta irá causar um erro semelhante ao que você teve. Embora eu não possa afirmar qual foi o verdadeiro problema já que não tive acesso ao seu resource. Isso acredito que você mesmo vai saber comparando com a versão que enviei.
  4. Passing the marker to the server-side isn't the algorithm you are looking for, this is just an algorithm task. Not to mention that this isn't gonna work as you have already been warned. If you explain what's the purpose of your code we can help you to achieve it in a way it should work. Besides that, you have a bad programming practice in your code like two similar events to which will trigger at the same time, also, calling the event "onClientResourceStart" for root will activate the attached function when any resource is started on the server.
  5. https://www.dropbox.com/s/ws4df7ci3e6t04q/hudmta.zip?dl=0 Só copiar a pasta files para o resource. Obs: Descompacte o arquivo.
  6. Só fazer o que eu disse aqui Quando copiar o código do meta daqui do fórum, edite para .Lua minúsculo. e também na extensão do arquivo.
  7. No hay problema, no es necesario, ya moví el topic.
  8. onVehicleEnter onVehicleExit setPlayerHudComponentVisible Próxima vez lembre-se de postar no local certo @fl0wzin https://forum.multitheftauto.com/forum/97-portuguese-português/
  9. "onPlayerLogin" getAccountData -- verifica se existe a data na conta referente ao primeira vez no server setAccountData -- remove essa data da conta spawnPlayer -- spawna o player no local determinado Se não tiver um painel de login, você pode setar a account-data do registro no comando /register no painel admin, se tiver só adicionar o setAccountData junto com o addAccount no sistema de login.
  10. Has publicado en la sección incorrecta, sub-foro español: https://forum.multitheftauto.com/forum/166-spanish-español/ @Synieztro
  11. Porque você tá com o código antigo da Hud. Substitui pelo editado: local screenH, screenW = guiGetScreenSize() local x, y = (screenH/1366), (screenW/768) local fonte = dxCreateFont("files/fonts/fonte.ttf", 10) --[[ dxDrawRectangle(451, 298, 186, 97, tocolor(0, 0, 0, 122), false) dxDrawRectangle(461, 308, 166, 77, tocolor(229, 112, 17, 208), false) ]] local hud_rendering = false function HUD () if getElementData(getLocalPlayer(), "isPolice") then jobPolice = "Policial" else jobPolice = nil end local showammo1 = getPedAmmoInClip (localPlayer,getPedWeaponSlot(localPlayer)) local showammo2 = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer) local showammo3 = getPedTotalAmmo(getLocalPlayer()) local clip = getPedAmmoInClip (getLocalPlayer()) local weapon = getPedWeapon ( getLocalPlayer() ) local arma = getWeaponNameFromID ( weapon ) local SaldoBanco = getElementData(localPlayer,"banco:Saldo") or 0 local Procurado = getPlayerWantedLevel(localPlayer) local Level = getElementData(localPlayer,"Level") or 0 local Fome = getElementData(getLocalPlayer(), "hunger") or 0 local Emp = jobPolice or (getElementData(getLocalPlayer(), "Emprego") or "Desempregado") local Sede = getElementData(getLocalPlayer(), "sede") or 0 local Sono = getElementData(getLocalPlayer(), "AirNew:Sono") or 0 local dinheiro1 = ("%008d"):format(getPlayerMoney(getLocalPlayer())) local color1 = tocolor(0,0,0,178) local color2 = tocolor(0,0,0,178) local color3 = tocolor(0,0,0,178) if arma == Fist then arma = Sono end if Fome > 10 then color1 = tocolor(0,0,0,178) else color1 = tocolor(238,89,16,math.abs(math.sin(getTickCount()/200))*200) end if Sede > 10 then color2 = tocolor(0,0,0,178) else color2 = tocolor(65,105,225,math.abs(math.sin(getTickCount()/200))*200) end if Sono > 10 then color3 = tocolor(0,0,0,178) else color3 = tocolor(34,139,34,math.abs(math.sin(getTickCount()/200))*200) end if Fome < 100 then ptfome = x*1148 else ptfome = x*1143 end if Sede < 100 then ptsede = x*1210 else ptsede = x*1205 end if Sono < 100 then ptsono = x*1273 else ptsono = x*1268 end dxDrawImage(x*1110, y*-25, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*1110, y*16, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*1110, y*61, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*1110, y*107, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*1110, y*154, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), false) dxDrawImage(x*1134, y*18, x*26, y*30, "files/img/IconeMala.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(x*1134, y*54, x*31, y*38, "files/img/IconeDinheiro.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(x*1139, y*102, x*23, y*26, "files/img/IconeCartao.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(x*1140, y*198, x*23, y*21, "files/img/EstrelaIcone.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawText("Level: "..Level, x*1139, y*154, x*1202, y*173, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawCircle (x*1161, y*270, x*20, 0.0, 360.0, color1, color1 ) dxDrawCircle (x*1223, y*270, x*20, 0.0, 360.0, color2, color2 ) dxDrawCircle (x*1284, y*270, x*20, 0.0, 360.0, color3, color3 ) dxDrawText(math.floor(Fome).. "%",ptfome , y*474, x*1195, y*128, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText(math.floor(Sede).. "%",ptsede , y*474, x*1195, y*128, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText(math.floor(Sono).. "%",ptsono , y*474, x*1195, y*128, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawImage(x*1270, y*256, x*27, y*31, "files/img/SonoIcone.png", 0, 0, 0, tocolor(254, 254, 254, 187), false) dxDrawImage(x*1207, y*256, x*30, y*27, "files/img/DrinkIcone.png", 0, 0, 0, tocolor(254, 254, 254, 187), false) dxDrawImage(x*1146, y*256, x*26, y*27, "files/img/ComidaIcone.png", 0, 0, 0, tocolor(254, 254, 254, 187), false) dxDrawText(""..SaldoBanco, x*1175, y*107, x*1195, y*128, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText(""..Procurado, x*1169, y*198, x*1189, y*219, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText("$"..dinheiro1, x*1175, y*61, x*1195, y*82, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText(Emp, x*1175, y*-16, x*1195, y*82, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText("Arma: "..arma.. " || Pente: " ..tostring (showammo1).." / "..tostring (showammo2), x*1143, y*400, x*1195, y*82, tocolor(255, 255, 255, 255), x*0.9, fonte, "left", "center", false, false, true, false, false) end function setHudVisible( bool ) if type(bool) == "boolean" then if bool == hud_rendering then return end local addRemove = bool and addEventHandler or removeEventHandler addRemove( "onClientRender", root, HUD ) hud_rendering = bool end end addEvent( "onServerRequestSetHudVisible", true ) addEventHandler( "onServerRequestSetHudVisible", root, setHudVisible ) function OnStop () setPlayerHudComponentVisible("armour", true) setPlayerHudComponentVisible("wanted", true) setPlayerHudComponentVisible("weapon", true) setPlayerHudComponentVisible("money", true) setPlayerHudComponentVisible("health", true) setPlayerHudComponentVisible("clock", true) setPlayerHudComponentVisible("breath", true) setPlayerHudComponentVisible("ammo", true) end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), OnStop) function OnStart () setPlayerHudComponentVisible("armour", false) setPlayerHudComponentVisible("wanted", false) setPlayerHudComponentVisible("weapon", false) setPlayerHudComponentVisible("money", false) setPlayerHudComponentVisible("health", false) setPlayerHudComponentVisible("clock", false) setPlayerHudComponentVisible("breath", false) setPlayerHudComponentVisible("ammo", false) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), OnStart ) local hudTable = { "ammo", "armour", "clock", "health", "money", "weapon", "wanted", "area_name", "vehicle_name", "breath", "clock" } addEventHandler("onClientResourceStart", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, false) end end ) addEventHandler("onClientResourceStop", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, true) end end )
  12. <meta> <info name="Hud RP" author="Sem Autor" version="1.0.0" type="script" /> <script src="c.Lua" type="client" /> <script src="server.Lua" type="server" /> <export function="setHudVisible" type="shared"/> <file src="files/fonts/fonte.ttf" /> <file src="files/img/Circulo.png" /> <file src="files/img/ComidaIcone.png" /> <file src="files/img/DrinkIcone.png" /> <file src="files/img/EstrelaIcone.png" /> <file src="files/img/IconeCartao.png" /> <file src="files/img/IconeDinheiro.png" /> <file src="files/img/IconeMala.png" /> <file src="files/img/RetanguloHud.png" /> <file src="files/img/SonoIcone.png" /> </meta> Faça um teste e vê se funciona. Obs: deixe .Lua em minúsculo, por algum motivo, o fórum sempre deixa o L maiúsculo.
  13. Cria um arquivo e cole isto: addEventHandler("onPlayerLogin", root, function() setTimer( function(player) setHudVisible( player, true ) end, 500, 1, source ) end, true, "low") function setHudVisible( player, bool ) if isElement(player) and type(bool) == "boolean" then return triggerClientEvent(player, "onServerRequestSetHudVisible", player, bool) end return false end Depois salve como server.Lua, deixe no diretório do resource da Hud DX e no meta.xml inclua o script: <script src="server.Lua" type="server"/> Também cole isto: <export function="setHudVisible" type="shared"/> (no meta.xml) Se não entendeu, mostre aqui o seu arquivo meta.
  14. https://community.multitheftauto.com/index.php?p=resources&s=details&id=7668
  15. Não podemos ajudar com isso, primeiro que você precisa pedir suporte ao autor do gamemode. Não damos suporte para scripts vazados.
  16. Seu crash é relacionada a memória de vídeo esgotada, recomendo buscar servidores que demandam menos do PC ou fazer um upgrade no seu hardware @uLeozinn
  17. https://community.multitheftauto.com/index.php?p=resources&s=details&id=1778 Quando for postar, vê se está na seção correta @Torugo
  18. Use: https://wiki.multitheftauto.com/wiki/GetPlayersByData Você pode colocar um timer para auto-atualizar a lista, ou gerar a lista quando abrir o painel da gridlist.
  19. Ops, eu tinha movido o tópico para o lugar errado @wesley souza angelo Corrigi seu código com a sintaxe Lua, lembre-se de fazer o que o Lord Henry disse. Aqui tá o código com função de alternar o DX, Client: local screenH, screenW = guiGetScreenSize() local x, y = (screenH/1366), (screenW/768) local fonte = dxCreateFont("files/fonts/fonte.ttf", 10) --[[ dxDrawRectangle(451, 298, 186, 97, tocolor(0, 0, 0, 122), false) dxDrawRectangle(461, 308, 166, 77, tocolor(229, 112, 17, 208), false) ]] local hud_rendering = false function HUD () if getElementData(getLocalPlayer(), "isPolice") then jobPolice = "Policial" else jobPolice = nil end local showammo1 = getPedAmmoInClip (localPlayer,getPedWeaponSlot(localPlayer)) local showammo2 = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer) local showammo3 = getPedTotalAmmo(getLocalPlayer()) local clip = getPedAmmoInClip (getLocalPlayer()) local weapon = getPedWeapon ( getLocalPlayer() ) local arma = getWeaponNameFromID ( weapon ) local SaldoBanco = getElementData(localPlayer,"banco:Saldo") or 0 local Procurado = getPlayerWantedLevel(localPlayer) local Level = getElementData(localPlayer,"Level") or 0 local Fome = getElementData(getLocalPlayer(), "hunger") or 0 local Emp = jobPolice or (getElementData(getLocalPlayer(), "Emprego") or "Desempregado") local Sede = getElementData(getLocalPlayer(), "sede") or 0 local Sono = getElementData(getLocalPlayer(), "AirNew:Sono") or 0 local dinheiro1 = ("%008d"):format(getPlayerMoney(getLocalPlayer())) local color1 = tocolor(0,0,0,178) local color2 = tocolor(0,0,0,178) local color3 = tocolor(0,0,0,178) if arma == Fist then arma = Sono end if Fome > 10 then color1 = tocolor(0,0,0,178) else color1 = tocolor(238,89,16,math.abs(math.sin(getTickCount()/200))*200) end if Sede > 10 then color2 = tocolor(0,0,0,178) else color2 = tocolor(65,105,225,math.abs(math.sin(getTickCount()/200))*200) end if Sono > 10 then color3 = tocolor(0,0,0,178) else color3 = tocolor(34,139,34,math.abs(math.sin(getTickCount()/200))*200) end if Fome < 100 then ptfome = x*1148 else ptfome = x*1143 end if Sede < 100 then ptsede = x*1210 else ptsede = x*1205 end if Sono < 100 then ptsono = x*1273 else ptsono = x*1268 end dxDrawImage(x*1110, y*-25, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*1110, y*16, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*1110, y*61, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*1110, y*107, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*1110, y*154, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), false) dxDrawImage(x*1134, y*18, x*26, y*30, "files/img/IconeMala.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(x*1134, y*54, x*31, y*38, "files/img/IconeDinheiro.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(x*1139, y*102, x*23, y*26, "files/img/IconeCartao.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(x*1140, y*198, x*23, y*21, "files/img/EstrelaIcone.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawText("Level: "..Level, x*1139, y*154, x*1202, y*173, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawCircle (x*1161, y*270, x*20, 0.0, 360.0, color1, color1 ) dxDrawCircle (x*1223, y*270, x*20, 0.0, 360.0, color2, color2 ) dxDrawCircle (x*1284, y*270, x*20, 0.0, 360.0, color3, color3 ) dxDrawText(math.floor(Fome).. "%",ptfome , y*474, x*1195, y*128, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText(math.floor(Sede).. "%",ptsede , y*474, x*1195, y*128, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText(math.floor(Sono).. "%",ptsono , y*474, x*1195, y*128, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawImage(x*1270, y*256, x*27, y*31, "files/img/SonoIcone.png", 0, 0, 0, tocolor(254, 254, 254, 187), false) dxDrawImage(x*1207, y*256, x*30, y*27, "files/img/DrinkIcone.png", 0, 0, 0, tocolor(254, 254, 254, 187), false) dxDrawImage(x*1146, y*256, x*26, y*27, "files/img/ComidaIcone.png", 0, 0, 0, tocolor(254, 254, 254, 187), false) dxDrawText(""..SaldoBanco, x*1175, y*107, x*1195, y*128, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText(""..Procurado, x*1169, y*198, x*1189, y*219, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText("$"..dinheiro1, x*1175, y*61, x*1195, y*82, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText(Emp, x*1175, y*-16, x*1195, y*82, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText("Arma: "..arma.. " || Pente: " ..tostring (showammo1).." / "..tostring (showammo2), x*1143, y*400, x*1195, y*82, tocolor(255, 255, 255, 255), x*0.9, fonte, "left", "center", false, false, true, false, false) end function setHudVisible( bool ) if type(bool) == "boolean" then if bool == hud_rendering then return end local addRemove = bool and addEventHandler or removeEventHandler addRemove( "onClientRender", root, HUD ) hud_rendering = bool end end addEvent( "onServerRequestSetHudVisible", true ) addEventHandler( "onServerRequestSetHudVisible", root, setHudVisible ) function OnStop () setPlayerHudComponentVisible("armour", true) setPlayerHudComponentVisible("wanted", true) setPlayerHudComponentVisible("weapon", true) setPlayerHudComponentVisible("money", true) setPlayerHudComponentVisible("health", true) setPlayerHudComponentVisible("clock", true) setPlayerHudComponentVisible("breath", true) setPlayerHudComponentVisible("ammo", true) end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), OnStop) function OnStart () setPlayerHudComponentVisible("armour", false) setPlayerHudComponentVisible("wanted", false) setPlayerHudComponentVisible("weapon", false) setPlayerHudComponentVisible("money", false) setPlayerHudComponentVisible("health", false) setPlayerHudComponentVisible("clock", false) setPlayerHudComponentVisible("breath", false) setPlayerHudComponentVisible("ammo", false) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), OnStart ) local hudTable = { "ammo", "armour", "clock", "health", "money", "weapon", "wanted", "area_name", "vehicle_name", "breath", "clock" } addEventHandler("onClientResourceStart", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, false) end end ) addEventHandler("onClientResourceStop", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, true) end end ) Server: addEventHandler("onPlayerLogin", root, function() setTimer( function(player) setHudVisible( player, true ) end, 500, 1, source ) end, true, "low") function setHudVisible( player, bool ) if isElement(player) and type(bool) == "boolean" then return triggerClientEvent(player, "onServerRequestSetHudVisible", player, bool) end return false end Não testei, mas o teste cabe a você. No mais, adicione a função exportada no meta.xml: <export function="setHudVisible" type="shared"/> E crie um novo arquivo com o código do lado server; também adicione no meta.
  20. Probably because at the time of trigger the value isn't defined. What are you trying to achieve anyway? @ShohpBEK
  21. Deve ser o parâmetro player não sendo passado no trigger, tenta com source no lugar de player, o parâmetro da função pode remover. Se não funcionar, mostre como tá sendo o trigger desse evento.
  22. Como se trata de uma HUD personalizada (DX), vai precisar criar uma função para remover o DX da tela. @wesley souza angelo (estou marcando para ajudar a localizar o tópico que foi postado na área errada, pois para não poluir o fórum, evito deixar o link do tópico lá)
×
×
  • Create New...