Jump to content

HG Snuuk

Members
  • Posts

    69
  • Joined

  • Last visited

Everything posted by HG Snuuk

  1. Opa tudo bom ^^ , é que estou tendo um conflito com dois scripts no momento que seria com o inventario do carro e o script de prisão quando o individuo vai pro porta malas e ele consegue acessar o porta malas assim travando o carro . gostaria de fazer com que assim que o mesmo for preso ele n consiguir acessar nada nem o mouseclicker nem cancelar anim de afogado . function ColocarNaViatura (source) local Jogador = getElementData(source, "TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end local viatura = VeiculoPolicial[source] if VeiculoPolicial[source] then triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial te colocou na viatura !", "info") attachElements (Jogador, viatura, 0.2, -1.5, 0, 0,0,90) setPedAnimation(Jogador, "ped", "CAR_dead_LHS", false, false) local RotVX, RotVY, RotVZ = getElementRotation(viatura) setElementRotation(Jogador, RotVX, RotVY, RotVZ + 65) end end end addEvent ( "TS:ColocarNaViatura", true ) addEventHandler ( "TS:ColocarNaViatura", root, ColocarNaViatura)
  2. Sim a forma que for mais facil pra mim entender mais ou menos , oque eu quero é que apenas um grupo da acl possa ativar o vip . Veiculo_VIPs = {} Grupo_01 = "Ouro" VIP_Ouro_ID_Veiculo_01 = 411 VIP_Ouro_Pack_de_Armas_01 = { 1, 22, 22, 25 } VIP_Ouro_Personagem_01 = 98 Grupo_02 = "Platina" VIP_Platina_ID_Veiculo_01 = 411 VIP_Platina_ID_Veiculo_02 = 522 VIP_Platina_Pack_de_Armas_01 = { 29, 32, 1, 22 } VIP_Platina_Personagem_01 = 98 VIP_Platina_Personagem_02 = 211 VIP_Platina_Vida = 100 Grupo_03 = "Diamante" VIP_Diamante_ID_Veiculo_01 = 411 VIP_Diamante_ID_Veiculo_02 = 522 VIP_Diamante_Pack_de_Armas_01 = { 30, 24, 4, 34 } VIP_Diamante_Pack_de_Armas_02 = { 29, 32, 1, 22 } VIP_Diamante_Personagem_01 = 98 VIP_Diamante_Personagem_02 = 200 VIP_Diamante_Personagem_03 = 211 VIP_Diamante_Vida = 100 VIP_Diamante_Colete = 70 Grupo_04 = "Rubi" VIP_Rubi_ID_Veiculo_01 = 411 VIP_Rubi_ID_Veiculo_02 = 522 VIP_Rubi_Pack_de_Armas_01 = { 31, 24, 4, 34, 26, 34 } VIP_Rubi_Pack_de_Armas_02 = { 29, 27, 1, 22, 30, 46 } VIP_Rubi_Personagem_01 = 98 VIP_Rubi_Personagem_02 = 200 VIP_Rubi_Personagem_03 = 211 VIP_Rubi_Vida = 100 VIP_Rubi_Colete = 100 function Receber_Client_AirNewSCR ( Tipo, VIP, ID ) if Tipo == "Veiculo(s)" then local Jogador_X, Jogador_Y, Jogador_Z = getElementPosition ( source ) local Rotacao_X, Rotacao_Y, Rotacao_Z = getElementRotation ( source ) if isElement ( Veiculo_VIPs[source] ) then destroyElement ( Veiculo_VIPs[source] ) end if VIP == "Ouro" and ID == 1 then Veiculo_VIPs[source] = createVehicle ( VIP_Ouro_ID_Veiculo_01, Jogador_X, Jogador_Y, Jogador_Z ) elseif VIP == "Platina" and ID == 1 then Veiculo_VIPs[source] = createVehicle ( VIP_Platina_ID_Veiculo_01, Jogador_X, Jogador_Y, Jogador_Z ) elseif VIP == "Platina" and ID == 2 then Veiculo_VIPs[source] = createVehicle ( VIP_Platina_ID_Veiculo_02, Jogador_X, Jogador_Y, Jogador_Z ) elseif VIP == "Diamante" and ID == 1 then Veiculo_VIPs[source] = createVehicle ( VIP_Diamante_ID_Veiculo_01, Jogador_X, Jogador_Y, Jogador_Z ) elseif VIP == "Diamante" and ID == 2 then Veiculo_VIPs[source] = createVehicle ( VIP_Diamante_ID_Veiculo_02, Jogador_X, Jogador_Y, Jogador_Z ) elseif VIP == "Rubi" and ID == 1 then Veiculo_VIPs[source] = createVehicle ( VIP_Rubi_ID_Veiculo_01, Jogador_X, Jogador_Y, Jogador_Z ) elseif VIP == "Rubi" and ID == 2 then Veiculo_VIPs[source] = createVehicle ( VIP_Rubi_ID_Veiculo_02, Jogador_X, Jogador_Y, Jogador_Z ) end setElementRotation ( Veiculo_VIPs[source], Rotacao_X, Rotacao_Y, Rotacao_Z ) warpPedIntoVehicle ( source, Veiculo_VIPs[source] ) exports.Scripts_Dxmessages:outputDx ( source, "Veiculo VIP "..VIP.." Criado com Sucesso!", "success" ) elseif Tipo == "Arma(s)" then if VIP == "Ouro" and ID == 1 then if getElementData ( source, "Ouro_Arma(s)" ) == "Bloqueado" then exports.Scripts_Dxmessages:outputDx ( source, "Você está bloqueado de usar está opção Temporariamente! [1 Minuto]", "warning" ) else setElementData ( source, "Ouro_Arma(s)", "Bloqueado" ) -- 1 Minuto for _, Armas in ipairs ( VIP_Ouro_Pack_de_Armas_01 ) do giveWeapon ( source, Armas, 999 ) end exports.Scripts_Dxmessages:outputDx ( source, "Você Recebeu o Pack de Arma(s) do VIP "..VIP.." com Sucesso!", "success" ) setTimer ( setElementData, 60000, 1, source, "Ouro_Arma(s)", "Desbloqueado" ) end elseif VIP == "Platina" and ID == 1 then if getElementData ( source, "Platina_Arma(s)" ) == "Bloqueado" then exports.Scripts_Dxmessages:outputDx ( source, "Você está bloqueado de usar está opção Temporariamente! [10 Segundo(s)]", "warning" ) else setElementData ( source, "Platina_Arma(s)", "Bloqueado" ) -- 10 Segundos for _, Armas in ipairs ( VIP_Platina_Pack_de_Armas_01 ) do giveWeapon ( source, Armas, 999 ) end exports.Scripts_Dxmessages:outputDx ( source, "Você Recebeu o Pack de Arma(s) do VIP "..VIP.." com Sucesso!", "success" ) setTimer ( setElementData, 10000, 1, source, "Platina_Arma(s)", "Desbloqueado" ) end elseif VIP == "Diamante" and ID == 1 then for _, Armas in ipairs ( VIP_Diamante_Pack_de_Armas_01 ) do giveWeapon ( source, Armas, 999 ) end elseif VIP == "Diamante" and ID == 2 then for _, Armas in ipairs ( VIP_Diamante_Pack_de_Armas_02 ) do giveWeapon ( source, Armas, 999 ) end elseif VIP == "Rubi" and ID == 1 then for _, Armas in ipairs ( VIP_Rubi_Pack_de_Armas_01 ) do giveWeapon ( source, Armas, 999 ) end elseif VIP == "Rubi" and ID == 2 then for _, Armas in ipairs ( VIP_Rubi_Pack_de_Armas_02 ) do giveWeapon ( source, Armas, 999 ) end end if getElementData ( source, "Ouro_Arma(s)" ) == "Bloqueado" or getElementData ( source, "Platina_Arma(s)" ) == "Bloqueado" then return end exports.Scripts_Dxmessages:outputDx ( source, "Você Recebeu o Pack de Arma(s) do VIP "..VIP.." com Sucesso!", "success" ) elseif Tipo == "Skin(s)" then if VIP == "Ouro" and ID == 1 then setElementModel ( source, VIP_Ouro_Personagem_01 ) elseif VIP == "Platina" and ID == 1 then setElementModel ( source, VIP_Platina_Personagem_01 ) elseif VIP == "Platina" and ID == 2 then setElementModel ( source, VIP_Platina_Personagem_02 ) elseif VIP == "Diamante" and ID == 1 then setElementModel ( source, VIP_Diamante_Personagem_01 ) elseif VIP == "Diamante" and ID == 2 then setElementModel ( source, VIP_Diamante_Personagem_02 ) elseif VIP == "Diamante" and ID == 3 then setElementModel ( source, VIP_Diamante_Personagem_03 ) elseif VIP == "Rubi" and ID == 1 then setElementModel ( source, VIP_Rubi_Personagem_01 ) elseif VIP == "Rubi" and ID == 2 then setElementModel ( source, VIP_Rubi_Personagem_02 ) elseif VIP == "Rubi" and ID == 3 then setElementModel ( source, VIP_Rubi_Personagem_03 ) end exports.Scripts_Dxmessages:outputDx ( source, "Personagem VIP "..VIP.." ID "..ID.." Setado com Sucesso!", "success" ) elseif Tipo == "Vida" then if VIP == "Platina" and ID == 1 then if getElementData ( source, "Platina_Vida" ) == "Bloqueado" then exports.Scripts_Dxmessages:outputDx ( source, "Você está bloqueado de usar está opção Temporariamente! [2 Minuto(s)]", "warning" ) else if getElementHealth ( source ) < VIP_Platina_Vida then setElementData ( source, "Platina_Vida", "Bloqueado" ) -- 2 Minuto(s) setElementHealth ( source, VIP_Platina_Vida ) exports.Scripts_Dxmessages:outputDx ( source, "Sua Vida foi Alterada para "..VIP_Platina_Vida.."% com Sucesso!", "success" ) setTimer ( setElementData, 120000, 1, source, "Platina_Vida", "Desbloqueado" ) else exports.Scripts_Dxmessages:outputDx ( source, "Você já está com mais de "..VIP_Platina_Vida.."% de Vida!", "error" ) end end elseif VIP == "Diamante" and ID == 1 then if getElementData ( source, "Diamante_Vida" ) == "Bloqueado" then exports.Scripts_Dxmessages:outputDx ( source, "Você está bloqueado de usar está opção Temporariamente! [2 Minuto(s)]", "warning" ) else if getElementHealth ( source ) < VIP_Diamante_Vida then setElementData ( source, "Diamante_Vida", "Bloqueado" ) -- 2 Minuto(s) setElementHealth ( source, VIP_Diamante_Vida ) exports.Scripts_Dxmessages:outputDx ( source, "Sua Vida foi Alterada para "..VIP_Diamante_Vida.."% com Sucesso!", "success" ) setTimer ( setElementData, 120000, 1, source, "Diamante_Vida", "Desbloqueado" ) else exports.Scripts_Dxmessages:outputDx ( source, "Você já está com "..VIP_Diamante_Vida.."% de Vida!", "error" ) end end elseif VIP == "Rubi" and ID == 1 then if getElementHealth ( source ) < VIP_Rubi_Vida then setElementHealth ( source, VIP_Rubi_Vida ) exports.Scripts_Dxmessages:outputDx ( source, "Sua Vida foi Alterada para "..VIP_Rubi_Vida.."% com Sucesso!", "success" ) else exports.Scripts_Dxmessages:outputDx ( source, "Você já está com "..VIP_Rubi_Vida.."% de Vida!", "error" ) end end elseif Tipo == "Colete" then if VIP == "Diamante" and ID == 1 then if getPedArmor ( source ) < VIP_Diamante_Colete then setPedArmor ( source, VIP_Diamante_Colete ) exports.Scripts_Dxmessages:outputDx ( source, "Seu Colete foi Alterado para "..VIP_Diamante_Colete.."% com Sucesso!", "success" ) else exports.Scripts_Dxmessages:outputDx ( source, "Você já está com mais de "..VIP_Diamante_Colete.."% de Colete!", "error" ) end elseif VIP == "Rubi" and ID == 1 then if getPedArmor ( source ) < VIP_Rubi_Colete then setPedArmor ( source, VIP_Rubi_Colete ) exports.Scripts_Dxmessages:outputDx ( source, "Seu Colete foi Alterado para "..VIP_Rubi_Colete.."% com Sucesso!", "success" ) else exports.Scripts_Dxmessages:outputDx ( source, "Você já está com "..VIP_Rubi_Colete.."% de Colete!", "error" ) end end elseif Tipo == "Blindagem" then if VIP == "Rubi" and ID == 1 then if isPedInVehicle ( source ) then if isVehicleDamageProof ( getPedOccupiedVehicle ( source ) ) == false then setVehicleDamageProof ( getPedOccupiedVehicle ( source ), true ) exports.Scripts_Dxmessages:outputDx ( source, "Você Aplicou Blindagem no Seu Veiculo Atual com Sucesso!", "success") else exports.Scripts_Dxmessages:outputDx ( source, "O Veiculo que você está atualmente já está Blindado!", "error") end else exports.Scripts_Dxmessages:outputDx ( source, "Entre em um Veiculo para utilizar esta função!", "error") end end elseif Tipo == "Mensagem" then if VIP == "Diamante" or VIP == "Rubi" then if ID then exports.Scripts_Dxmessages:outputDx ( source, ID, "info") end end end end addEvent ( "AirNewSCR_EnviarServidor", true ) addEventHandler ( "AirNewSCR_EnviarServidor", getRootElement ( ), Receber_Client_AirNewSCR ) function Sair_do_Servidor_AirNewSCR ( quitType ) if isElement ( Veiculo_VIPs[source] ) then destroyElement ( Veiculo_VIPs[source] ) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), Sair_do_Servidor_AirNewSCR ) function Morrer_no_Servidor_AirNewSCR ( ) if isElement ( Veiculo_VIPs[source] ) then destroyElement ( Veiculo_VIPs[source] ) end end addEventHandler( "onPlayerWasted", getRootElement( ), Morrer_no_Servidor_AirNewSCR ) function Verificar_VIP_AirNewSCR ( ) for i, player in ipairs ( getElementsByType ( "player" ) ) do local acc = getPlayerAccount ( player ) if acc and not isGuestAccount ( acc ) then local accName = getAccountName (acc) if isObjectInACLGroup ("user."..accName, aclGetGroup ( Grupo_01 ) ) then setElementData ( player, "VIP_01", "Sim" ) else setElementData ( player, "VIP_01", "Não" ) end if isObjectInACLGroup ("user."..accName, aclGetGroup ( Grupo_02 ) ) then setElementData ( player, "VIP_02", "Sim" ) else setElementData ( player, "VIP_02", "Não" ) end if isObjectInACLGroup ("user."..accName, aclGetGroup ( Grupo_03 ) ) then setElementData ( player, "VIP_03", "Sim" ) else setElementData ( player, "VIP_03", "Não" ) end if isObjectInACLGroup ("user."..accName, aclGetGroup ( Grupo_04 ) ) then setElementData ( player, "VIP_04", "Sim" ) else setElementData ( player, "VIP_04", "Não" ) end end end end setTimer ( Verificar_VIP_AirNewSCR, 1500, 0 )
  3. vlw meu querido dei uma olhada tava dando erro no dx da arma por causa de uma letra no arquivo da font , tava fonte . vlw meu querido
  4. https://prnt.sc/owdo4u local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) local components = { "area_name", "radio", "vehicle_name" } local font = dxCreateFont('files/fonts/font.ttf', 10, false); local font2 = dxCreateFont('files/fonts/font.ttf', 14, false); function f_hud( ... ) if (not isPlayerMapVisible()) then local money = convertNumber(getPlayerMoney(getLocalPlayer())) local bank = convertNumber(getElementData(localPlayer, "Bank:Royal") or "0") local realName = getPlayerName(getLocalPlayer()) local Cargo_Atual = getElementData(localPlayer, "DNL:Cargo") local weapon = getPedWeapon ( getLocalPlayer() ) local arma = getWeaponNameFromID ( weapon ) dxDrawRectangle(x*1180, y*50, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*100, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*150, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawLine(x*1340, y*85, x*1180, y*85, tocolor(0, 60, 160, 255), 3, false) dxDrawLine(x*1340, y*135, x*1180, y*135, tocolor(0, 60, 160, 255), 3, false) dxDrawLine(x*1340, y*185, x*1180, y*185, tocolor(0, 60, 160, 255), 3, false) dxDrawImage(x*1180, y*155, x*35, y*35, "files/img/card.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1180, y*110, x*22, y*20, "files/img/money.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1185, y*60, x*20, y*20, "files/img/maleta.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$: "..money, x*1240, y*110, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) dxDrawText("R$: "..bank, x*1240, y*160, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) local Encaminhado = getElementData ( localPlayer, "Emprego") or "Desempregado" dxDrawText(Encaminhado, x*1230, y*60, x*1470, y*30, tocolor(255, 255, 255, 221), x*1.00, font, "left", "top", false, false, false, false, false) dxDrawText("Arma: "..arma.. " || Pente: " ..tostring (showammo1).." / "..tostring (showammo2), x*1143, y*130, x*1195, y*82, tocolor(255, 255, 255, 255), x*0.9, fonte, "left", "center", false, false, true, false, false) end end addEventHandler("onClientRender", root, f_hud) function toggleF11() if isVisible then addEventHandler("onClientRender", root, f_hud) else removeEventHandler("onClientRender", root, f_hud) end isVisible = not isVisible end bindKey ("F11", "down", toggleF11)
  5. https://prnt.sc/owault este é o debug
  6. pode me dar uma idéia para pesquisar e fazer ou alguma dica de como se faz ? queria aprender a fazer
  7. Como posso tar criando uma acl que apenas o dono ou admin g consegue ver , ps : peguei o gancho do amigo @Lord _+[N]injA deixando os creditos da pergunta pra ele , porem gostaria de saber tambem como fazer
  8. Intão fiz isso porem nada ainda local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) local components = { "area_name", "radio", "vehicle_name" } local font = dxCreateFont('files/fonts/font.ttf', 10, false); local font2 = dxCreateFont('files/fonts/font.ttf', 14, false); function f_hud( ... ) if (not isPlayerMapVisible()) then local money = convertNumber(getPlayerMoney(getLocalPlayer())) local bank = convertNumber(getElementData(localPlayer, "Bank:Royal") or "0") local realName = getPlayerName(getLocalPlayer()) local Cargo_Atual = getElementData(localPlayer, "DNL:Cargo") dxDrawRectangle(x*1180, y*50, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*100, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*150, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawLine(x*1340, y*85, x*1180, y*85, tocolor(0, 60, 160, 255), 3, false) dxDrawLine(x*1340, y*135, x*1180, y*135, tocolor(0, 60, 160, 255), 3, false) dxDrawLine(x*1340, y*185, x*1180, y*185, tocolor(0, 60, 160, 255), 3, false) dxDrawImage(x*1180, y*155, x*35, y*35, "files/img/card.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1180, y*110, x*22, y*20, "files/img/money.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1185, y*60, x*20, y*20, "files/img/maleta.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$: "..money, x*1240, y*110, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) dxDrawText("R$: "..bank, x*1240, y*160, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) local Encaminhado = getElementData ( localPlayer, "Emprego") or "Desempregado" dxDrawText(Encaminhado, x*1230, y*60, x*1470, y*30, tocolor(255, 255, 255, 221), x*1.00, font, "left", "top", false, false, false, false, false) local arma = getWeaponNameFromID ( weapon ) dxDrawText("Arma: "..arma.. " || Pente: " ..tostring (showammo1).." / "..tostring (showammo2), x*1240, y*180, x*1132, y*37, tocolor(255, 255, 255, 255), x*0.9, fonte, "left", "center", false, false, true, false, false) end end addEventHandler("onClientRender", root, f_hud) function toggleF11() if isVisible then addEventHandler("onClientRender", root, f_hud) else removeEventHandler("onClientRender", root, f_hud) end isVisible = not isVisible end bindKey ("F11", "down", toggleF11)
  9. intão eu coloquei porem continua n funcionando talvez seja alguma coisa que esta faltando esse é o script inteiro local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) local components = { "area_name", "radio", "vehicle_name" } local font = dxCreateFont('files/fonts/font.ttf', 10, false); local font2 = dxCreateFont('files/fonts/font.ttf', 14, false); function f_hud( ... ) if (not isPlayerMapVisible()) then local money = convertNumber(getPlayerMoney(getLocalPlayer())) local bank = convertNumber(getElementData(localPlayer, "Bank:Royal") or "0") local realName = getPlayerName(getLocalPlayer()) local Cargo_Atual = getElementData(localPlayer, "DNL:Cargo") dxDrawRectangle(x*1180, y*50, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*100, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*150, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawLine(x*1340, y*85, x*1180, y*85, tocolor(0, 60, 160, 255), 3, false) dxDrawLine(x*1340, y*135, x*1180, y*135, tocolor(0, 60, 160, 255), 3, false) dxDrawLine(x*1340, y*185, x*1180, y*185, tocolor(0, 60, 160, 255), 3, false) dxDrawImage(x*1180, y*155, x*35, y*35, "files/img/card.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1180, y*110, x*22, y*20, "files/img/money.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1185, y*60, x*20, y*20, "files/img/maleta.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$: "..money, x*1240, y*110, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) dxDrawText("R$: "..bank, x*1240, y*160, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) local Encaminhado = getElementData ( localPlayer, "Emprego") or "Desempregado" dxDrawText(Encaminhado, x*1230, y*60, x*1470, y*30, tocolor(255, 255, 255, 221), x*1.00, font, "left", "top", false, false, false, false, false) local arma = getWeaponNameFromID ( weapon ) dxDrawText("Arma: "..arma.. " || Pente: " ..tostring (showammo1).." / "..tostring (showammo2), x*1240, y*180, x*1132, y*37, tocolor(255, 255, 255, 255), x*0.9, fonte, "left", "center", false, false, true, false, false) addEventHandler("onClientRender", root, f_hud) end end function toggleF11() if isVisible then addEventHandler("onClientRender", root, f_hud) else removeEventHandler("onClientRender", root, f_hud) end isVisible = not isVisible end bindKey ("F11", "down", toggleF11) function setHud() addEventHandler("onClientRender", getRootElement(), f_hud) setPlayerHudComponentVisible("armour", false) setPlayerHudComponentVisible("wanted", false) setPlayerHudComponentVisible("weapon", false) setPlayerHudComponentVisible("money", false) setPlayerHudComponentVisible("health", false) setPlayerHudComponentVisible("clock", false) setPlayerHudComponentVisible("breath", false) setPlayerHudComponentVisible("ammo", false) setPlayerHudComponentVisible("radar", false) for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), setHud) function removeHud() setPlayerHudComponentVisible("armour", true) setPlayerHudComponentVisible("wanted", true) setPlayerHudComponentVisible("weapon", true) setPlayerHudComponentVisible("money", true) setPlayerHudComponentVisible("health", true) setPlayerHudComponentVisible("clock", true) setPlayerHudComponentVisible("breath", true) setPlayerHudComponentVisible("ammo", true) setPlayerHudComponentVisible("radar", true) end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), removeHud) 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 getPedMaxHealth(ped) assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") local stat = getPedStat(ped, 24) local maxhealth = 100 + (stat - 569) / 4.31 return math.max(1, maxhealth) end
  10. vlw meu querido tou aprendendo dos poucos ainda
  11. eu deixei o codigo assim porem continua n aparecendo nada local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) local components = { "area_name", "radio", "vehicle_name" } local font = dxCreateFont('files/fonts/font.ttf', 10, false); local font2 = dxCreateFont('files/fonts/font.ttf', 14, false); function f_hud( ... ) if (not isPlayerMapVisible()) then local money = convertNumber(getPlayerMoney(getLocalPlayer())) local bank = convertNumber(getElementData(localPlayer, "Bank:Royal") or "0") local realName = getPlayerName(getLocalPlayer()) local Cargo_Atual = getElementData(localPlayer, "DNL:Cargo") dxDrawRectangle(x*1180, y*50, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*100, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*150, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawLine(x*1340, y*85, x*1180, y*85, tocolor(0, 60, 160, 255), 3, false) dxDrawLine(x*1340, y*135, x*1180, y*135, tocolor(0, 60, 160, 255), 3, false) dxDrawLine(x*1340, y*185, x*1180, y*185, tocolor(0, 60, 160, 255), 3, false) dxDrawImage(x*1180, y*155, x*35, y*35, "files/img/card.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1180, y*110, x*22, y*20, "files/img/money.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1185, y*60, x*20, y*20, "files/img/maleta.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$: "..money, x*1240, y*110, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) dxDrawText("R$: "..bank, x*1240, y*160, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) local Encaminhado = getElementData ( localPlayer, "Emprego") or "Desempregado" dxDrawText(Encaminhado, x*1230, y*60, x*1470, y*30, tocolor(255, 255, 255, 221), x*1.00, font, "left", "top", false, false, false, false, false) local arma = getWeaponNameFromID ( weapon ) dxDrawText("Arma: "..arma.. " || Pente: " ..tostring (showammo1).." / "..tostring (showammo2), x*1240, y*180, x*1132, y*37, tocolor(255, 255, 255, 255), x*0.9, fonte, "left", "center", false, false, true, false, false) end end
  12. Opa tudo bom eu gostaria de tar colocando sistema na hud de ver a arma e o tanto de munição escrito exemplo : colt | munição: 30 . Ja tentei copiar codigos e passar pra hud porem n consigui local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) local components = { "area_name", "radio", "vehicle_name" } local font = dxCreateFont('files/fonts/font.ttf', 10, false); local font2 = dxCreateFont('files/fonts/font.ttf', 14, false); function f_hud( ... ) if (not isPlayerMapVisible()) then local money = convertNumber(getPlayerMoney(getLocalPlayer())) local bank = convertNumber(getElementData(localPlayer, "Bank:Royal") or "0") local realName = getPlayerName(getLocalPlayer()) local Cargo_Atual = getElementData(localPlayer, "DNL:Cargo") dxDrawRectangle(x*1180, y*50, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*100, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*150, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawLine(x*1340, y*85, x*1180, y*85, tocolor(0, 60, 160, 255), 3, false) dxDrawLine(x*1340, y*135, x*1180, y*135, tocolor(0, 60, 160, 255), 3, false) dxDrawLine(x*1340, y*185, x*1180, y*185, tocolor(0, 60, 160, 255), 3, false) dxDrawImage(x*1180, y*155, x*35, y*35, "files/img/card.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1180, y*110, x*22, y*20, "files/img/money.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1185, y*60, x*20, y*20, "files/img/maleta.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$: "..money, x*1240, y*110, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) dxDrawText("R$: "..bank, x*1240, y*160, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) local Encaminhado = getElementData ( localPlayer, "Emprego") or "Desempregado" dxDrawText(Encaminhado, x*1230, y*60, x*1470, y*30, tocolor(255, 255, 255, 221), x*1.00, font, "left", "top", false, false, false, false, false) end end
  13. -------------------------------- Funções Iniciais viatura = {} function salvacarro (vei, assento, vitima) viatura[source] = vei end addEventHandler ('onPlayerVehicleEnter', root, salvacarro) ------ Abrir Prender local AbrirPainel = createMarker(1570.77722, -1697.50439, 11.98994,"cylinder",2, 0, 60, 160, 60) function AbrirPrender (source) local login = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..login, aclGetGroup("Policial")) then triggerClientEvent(source, "TS:AbrirPrender", source) end end addEventHandler("onMarkerHit", AbrirPainel, AbrirPrender) function Prender (Jogador_Selecionado, getMotivo, getTempo) local Criminoso = getPlayerFromPartialName(Jogador_Selecionado) local Estrelas = getPlayerWantedLevel(Criminoso) local Tempo = tonumber(getTempo) local Motivo = getMotivo local jX, jY, jZ = getElementPosition (Criminoso) local pX, pY, pZ = getElementPosition (source) local IDPolicial = getElementData(source, "ID") or 0 local dist = tonumber(getDistanceBetweenPoints3D ( pX, pY, pZ, jX, jY, jZ)) if Tempo == 0 then outputChatBox ( "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffDigite o tempo!", source, 255, 0, 0, true ) return end if dist <= 50 then if Estrelas >= 1 then givePlayerMoney(source, 50*Estrelas) else givePlayerMoney(source, 50) end detachElements(Criminoso, viatura[source]) setElementData(Criminoso, "TempoPrisao", Tempo) setElementData(Criminoso, "Mtv_Prisao", Motivo) setElementData(Criminoso, "ID2", IDPolicial) setElementInterior(Criminoso, 0) setElementPosition(Criminoso, 1572.03333, -1692.45874, 13.58994) outputChatBox ( "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê prendeu o jogador "..getPlayerName(Criminoso).."#ffffff por "..Tempo.." minutos pelo motivo de "..Motivo.." !", source, 255, 0, 0, true ) outputChatBox ( "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial "..getPlayerName(source).." prendeu o jogador "..getPlayerName(Criminoso).."#ffffff por "..Tempo.." minutos pelo motivo de "..Motivo.." !", root, 255, 0, 0, true ) outputChatBox ( "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê foi preso !", Criminoso, 255, 0, 0, true ) triggerClientEvent(Criminoso, "TS:SendoPreso", Criminoso) takeAllWeapons(Criminoso) setPlayerWantedLevel(Criminoso, 0) setTimer(function() setElementData(Criminoso, "TempoPrisao", nil) setElementData(Criminoso, "Mtv_Prisao", nil) setElementData(Criminoso, "ID2", nil) setElementData(Criminoso, "TempoPrisao2", nil) setElementInterior(Criminoso, 0) setElementPosition(Criminoso, 1539.87463, -1675.75757, 13.54949) triggerClientEvent(Criminoso, "TS:Liberado", Criminoso) outputChatBox ( "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê foi solto !", Criminoso, 255, 0, 0, true ) takeAllWeapons(Criminoso) setPlayerWantedLevel(Criminoso, 0) end, Tempo*60000, 1) end end addEvent ("TS:FazerPrisao", true) addEventHandler ("TS:FazerPrisao", root, Prender) function Loguei () setTimer(function(source) local Tempo = getElementData(source, "TempoPrisao") or 0 if Tempo >= 1 then local Tempo2 = getElementData(source, "TempoPrisao2") or 0 local Tempo3 = Tempo2 + 3 setTimer(function (source) if Tempo3 >= 1 then setElementInterior(source, 0) setElementPosition(source, 1572.03333, -1692.45874, 13.58994) setElementData(source, "TempoPrisao", Tempo3) setElementData(source, "TempoVolta", Tempo3) triggerClientEvent(source, "TS:SendoPreso", source) takeAllWeapons(source) setPlayerWantedLevel(source, 0) end end, 3000, 1, source) setTimer(function (source) if Tempo3 >= 1 then setElementData(source, "TempoPrisao", nil) setElementData(source, "TempoPrisao2", nil) setElementData(source, "Mtv_Prisao", nil) setElementData(source, "ID2", nil) setElementInterior(source, 0) setElementPosition(source, 1539.87463, -1675.75757, 13.54949) triggerClientEvent(source, "TS:Liberado", source) outputChatBox ( "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê foi solto !", source, 255, 0, 0, true ) takeAllWeapons(source) setPlayerWantedLevel(source, 0) end end, Tempo3*60000, 1, source)
  14. Opa Tudo bom é que eu estou com um script de prisão aki porem ele consegue se auto prender e prender pessoas da mesma tag , gostaria de colocar pra ele n consiguir prender nem ele mesmo ou de forma mais facil de resolver ele n consiguir prender um certo grupo da acl
  15. Opa Gostartia De Mudar O Button De Mode para ativar e desativar sirene como posso tar efetuando essa ação tentei por meio dos conhecimento basico que tenho mais consigui não gui_visible = false mouse_visible = false local screenW, screenH = guiGetScreenSize() giroflexWindow = guiCreateWindow((screenW - 418) / 2, (screenH - 134), 418, 128, "Giroflex", false) guiWindowSetSizable(giroflexWindow, false) normalButton = guiCreateButton(16, 28, 122, 38, "Normal", false, giroflexWindow) setElementData(normalButton, "type", "normal") stroboButton = guiCreateButton(16, 76, 122, 38, "Strobo", false, giroflexWindow) setElementData(stroboButton, "type", "strobo") alternatedButton = guiCreateButton(148, 28, 122, 38, "Alternated", false, giroflexWindow) setElementData(alternatedButton, "type", "alternated") otherButton = guiCreateButton(148, 76, 122, 38, "Alternated Strobo", false, giroflexWindow) setElementData(otherButton, "type", "alternated strobo") offButton = guiCreateButton(280, 76, 122, 38, "OFF", false, giroflexWindow) setElementData(offButton, "type", "off") modeButton = guiCreateButton(280, 28, 122, 38, "MODE: LAMP", false, giroflexWindow) setElementData(modeButton, "mode", "lamp") function mode_click(button, state) if button == "left" then mode = getElementData(source, "mode") if mode == "lamp" then setElementData(source, "mode", "led") guiSetText(modeButton, "MODE: LED") else setElementData(source, "mode", "lamp") guiSetText(modeButton, "MODE: LAMP") end end end addEventHandler("onClientGUIClick", modeButton, mode_click) Observação ele esta sem função nenhuma apenas troca o texto function bt_click(button, state) if button == "left" then type = getElementData(source, "type") if not type or type == nil then return end requestEmerlights(getElementData(modeButton, "mode"), type) end end addEventHandler("onClientGUIClick", getRootElement(), bt_click) Logo heim baixo tem essa função mais não entendi direito pra que serve
  16. Opa Tudo Bom primeiramente Bom Dia Ou Boa Noite ! Eu gostaria de saber se teria script de renderizar objetos por id ah uma certa distancia , pq procurei na net e não achei nenhum que funcione e eu tenho dificuldades heim scripts se puder me ajudar agradeço .
  17. oh meu caro muito obrigado meu lindro
  18. Opa Sou novo gostaria de pedir ajuda pois esta tudo perfeito só que desce apenas o colete e a vida não mostra pela nametag descendo [Lua]local drawDistance = 70 g_StreamedInPlayers = {} function drawHPBar(x, y, v, d) if v < 0 then v = 0 elseif v > 100 then v = 100 end dxDrawRectangle(x - 21, y, 42, 6, tocolor(0, 0, 0, 150 - d)) dxDrawRectangle(x - 20, y + 1, v / 2.5, 4, tocolor((100 - v) * 2.55, v * 2.55, 0, 255 - d)) end function drawArmourBar(x, y, v, d) if v < 0 then v = 0 elseif v > 100 then v = 100 end dxDrawRectangle(x - 21, y, 42, 6, tocolor(0, 0, 0, 150 - d)) dxDrawRectangle(x - 20, y + 1, v / 2.5, 4, tocolor(255, 255, 255, 255 - d)) end function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then local vx, vy, vz = getPedBonePosition(player, 8) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then local name = getPlayerName(player) local w = dxGetTextWidth(name, 1, "default-bold", true) local h = dxGetFontHeight(1, "default-bold", true) dxDrawText(name, x - w + 40, y - 30, x + h, y, tocolor(255,255,255,255), 1, "default-bold", "center", "top", false, false, false, true) local health = getPedMaxHealth(player) local armour = getPedArmor(player) if health > 0 then drawHPBar(x, y - 6, health, dist) end if armour > 0 then drawArmourBar(x, y - 12, armour, dist) end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart(startedResource) visibleTick = getTickCount() normalhealthbar = false for k, v in pairs(getElementsByType("player")) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) function dxDrawColorText(str, ax, ay, bx, by, color, scale, font) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x" .. col:sub(1, 2)), tonumber("0x" .. col:sub(3, 4)), tonumber("0x" .. col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x" .. col:sub(1, 2)), tonumber("0x" .. col:sub(3, 4)), tonumber("0x" .. col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end function getPedMaxHealth(ped) -- Output an error and stop executing the function if the argument is not valid assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") -- Grab his player health stat. local stat = getPedStat(ped, 24) -- Do a linear interpolation to get how many health a ped can have. -- Assumes: 100 health = 569 stat, 200 health = 1000 stat. local maxhealth = 100 + (stat - 569) / 4.31 -- Return the max health. Make sure it can't be below 1 return math.max(1, maxhealth) end[/Lua ]
×
×
  • Create New...