Jump to content

Blaack

Members
  • Posts

    194
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Blaack

  1. Use o setElementAlpha para deixar o player invisível, já em seu nametag por id use o getElementAlpha se for igual 255, aparece o id; Já se for igual à 0, não mostra!
  2. OFF. Se eu tivesse entendido o que ta acontecendo, eu ajudava; Explique com mais clareza!
  3. Server-side: -----------------------------------[Acesso painel]---------------------------------------------- function showPanellr(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("DonoPMESP")) then --> Gruop que vai poder abrir o painel ! triggerClientEvent(thePlayer, "GUI", getRootElement()) end end function onResStartlr() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "x", "down", showPanellr) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStartlr) function onPlayerJoinlr() bindKey(source, "x", "down", showPanellr) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoinlr) function cleanAlllr(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "x", "down", showPanellr) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAlllr) function adminTextlr() local root = getRootElement() local account = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." .. account, aclGetGroup("DonoPMESP")) then --> Gruop que vai poder abrir o painel ! outputChatBox("Presione 'x' para abrir o Painel Da TAG`s.", source) end end addEventHandler("onPlayerLogin", root, adminTextlr) ----------------------------------------------------------------------- [Add 1] ------------------------------------------------------------------------------ function add1 (thePlayer) if not (isElement(thePlayer)) then return end; local accountName = getAccountName(getPlayerAccount(thePlayer)) if accountName then aclGroupAddObject (aclGetGroup("PMESP"), "user."..accountName) --- Modifique o nome da acl gruop aqui ! -> ("BOPE") <- outputChatBox ("#ffff00[ #00ff00Painel TAG #ffff00] #00ff00Conta '"..accountName.."' Foi Adcionada com sucesso ao Grupo.", client, 255, 255, 255, true) -- Mensagem De Sucesso ! else outputChatBox ("#ffff00[ #00ff00Painel TAG #ffff00] #ff000Conta Não Especificada.", client, 255, 255, 255, true) -- Mensagem De Erro outputChatBox ("#ffff00[ #00ff00Painel TAG #ffff00] #ff000Selecione um Player na Lista.", client, 255, 255, 255, true) -- Mensagem De Erro end end addEvent( "addtag1", true ) addEventHandler( "addtag1", root, add1 ) ----------------------------------------------------------------------- [Remover 1] ---------------------------------------------------------------------------- function del1 (thePlayer) if not (isElement(thePlayer)) then return end; local accountName = getAccountName(getPlayerAccount(thePlayer)) if accountName then aclGroupRemoveObject (aclGetGroup("PMESP"), "user."..accountName) --- Modifique o nome da acl gruop aqui ! -> ("Mude Aqui") <- outputChatBox ("#ffff00[ #00ff00Painel TAG #ffff00] #ff000Conta '"..accountName.."' Foi Removida com sucesso ao Grupo.", client, 255, 255, 255, true) -- Mensagem De Sucesso ! else outputChatBox ("#ffff00[ #00ff00Painel TAG #ffff00] #ff000Conta Não Especificada.", client, 255, 255, 255, true) -- Mensagem De Erro outputChatBox ("#ffff00[ #00ff00Painel TAG #ffff00] #ff000Selecione um Player na Lista.", client, 255, 255, 255, true) -- Mensagem De Erro end end addEvent( "remvtag1", true ) addEventHandler( "remvtag1", root, del1 ) ---Verificar contas com tag-- function check( ) for i, v in ipairs(getElementsByType("player")) do if (isGuestAccount(getPlayerAccount(v)) == false) then local accountname = getAccountName (getPlayerAccount(v)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "PMESP" ) ) then --mudar acl setElementData(v, "PMESP", true) else setElementData(v, "PMESP", false) end end end end setTimer(check, 1000, 0) Client-Side --GUI-- local sX, sY = guiGetScreenSize() janela = guiCreateWindow(sX/2-300, sY/2-225, 600, 450, "Painel Tag PMESP", false) botao1 = guiCreateButton(230, 300, 140, 50, "Adicionar", false, janela) botao2 = guiCreateButton(230, 200, 140, 50, "Remover", false, janela) lista1 = guiCreateGridList(10, 100, 200, 300, false, janela) lista2 = guiCreateGridList(390, 100, 200, 300, false, janela) busca1 = guiCreateEdit(10, 73, 170, 23, "", false, janela) busca2 = guiCreateEdit(390, 73, 170, 23, "",false, janela) Lupa1 = guiCreateStaticImage(185, 73, 24, 22, "arquivos/Lupa.png", false, janela) Lupa2 = guiCreateStaticImage(565, 73, 24, 22, "arquivos/Lupa.png", false, janela) Logo = guiCreateStaticImage(270, 73, 60, 57, "arquivos/Logo.png", false, janela) texto1 = guiCreateLabel(10, 50, 150, 20, "Jogadores normais aqui ↓↓↓", false, janela) texto2 = guiCreateLabel(390, 50, 200, 20, "Membros da sua coporação aqui ↓↓↓", false, janela) --CONFIGURAÇÕES DO GUI-- guiSetVisible(janela, false) guiSetProperty(botao1, "NormalTextColour", "FF00FF00") guiSetProperty(botao2, "NormalTextColour", "FFFF0000") guiSetProperty(janela, "CaptionColour", "FFFF0000") showCursor(true) guiGridListAddColumn(lista1, "Cidadãos", 0.9) guiGridListAddColumn(lista2, "Membros da Corporação", 0.9) --Códigos-- --GUI-- function GUI() if guiGetVisible(janela) then guiSetVisible(janela, false) showCursor(false) else guiSetVisible(janela, true) showCursor(true) ColocarJogadores () ColocarJogadores2 () end end addEvent("GUI", true) addEventHandler("GUI", getRootElement(), GUI) ------------------------------Lista1------------------------------------- function ColocarJogadores () guiGridListClear(lista1)-- Apaga a grid for i, thePlayer in ipairs ( getElementsByType ( "player" ) ) do-- Obtem todos os jogadores local row = guiGridListAddRow( lista1 )-- Agregar row guiGridListSetItemText ( lista1, row, 1, getPlayerName( thePlayer ), false, false ) end end ------------------------------------------------------------------------ function Buscar() guiGridListClear( lista1 ) local nome = guiGetText( busca1 ) for i, thePlayer in ipairs ( getElementsByType ( "player" ) ) do if ( thePlayer ~= localPlayer ) then--Para não buscar a si mesmo if ( string.find( getPlayerName( thePlayer ):lower(), nome:lower() ) ) then--Para buscar o jugador com esse nome local row = guiGridListAddRow ( lista1 )--agregar row guiGridListSetItemText ( lista1, row, 1, getPlayerName ( thePlayer ), false, false )--agregar um row com esse nome end end end end addEventHandler ("onClientGUIClick", busca1, Buscar ,false) --Lista1-- --Lista2-- ------------------------------------------------------------------------ function ColocarJogadores2() guiGridListClear(lista2)-- Apaga a grid for i, thePlayer in ipairs ( getElementsByType ( "player" ) ) do-- Obtem todos os jogadores if getElementData(thePlayer, "PMESP") == true then local row = guiGridListAddRow( lista2 )-- Agregar row guiGridListSetItemText ( lista2, row, 1, getPlayerName( thePlayer ), false, false ) end end end ------------------------------------------------------------------------ function Buscar2() guiGridListClear( lista2 ) local nome = guiGetText( busca2 ) for i, thePlayer in ipairs ( getElementsByType ( "player" ) ) do if ( thePlayer ~= localPlayer ) then--Para não buscar a si mesmo if ( string.find( getPlayerName( thePlayer ):lower(), nome:lower() ) ) then--Para buscar o jogador com esse nome local row = guiGridListAddRow ( lista2 )--agregar row guiGridListSetItemText ( lista2, row, 1, getPlayerName ( thePlayer ), false, false )--agregar um row com esse nome end end end end addEventHandler ("onClientGUIClick", busca2, Buscar2 ,false) --Lista2-- ------------------------------------------------------------------------ -- Botões -- ------------------------------------------------------------------------ function Tag1Name () local jogadorselecionado = guiGridListGetItemText(lista1, guiGridListGetSelectedItem(lista1), 1) triggerServerEvent("addtag1", localPlayer, getPlayerFromName(jogadorselecionado)) end addEventHandler ("onClientGUIClick", botao1, Tag1Name ,false) function remv1Name () local jogadorselecionado = guiGridListGetItemText(lista2, guiGridListGetSelectedItem(lista2), 1) triggerServerEvent("remvtag1", localPlayer, getPlayerFromName(jogadorselecionado)) end addEventHandler ("onClientGUIClick", botao2, remv1Name ,false)
  4. Crie o lado server.lua com o evento "onPlayerLogin", quando ele logar execute um triggerClientEvent e no lado client voce para o som com stopSound
  5. addCommandHandler ( "sumido", function ( thePlayer ) local conta = getAccountName (getPlayerAccount(thePlayer)) if not isObjectInACLGroup ( "user." .. conta, aclGetGroup ( "admin" ) ) then outputChatBox("Permissão negada!",thePlayer,255) return end for k, v in ipairs( getAttachedElements( thePlayer ) ) do destroyElement( v ); outputChatBox("Modo sumido ativado!",thePlayer,255) end end )
  6. Eu uso este resource como base: https://community.multitheftauto.com/index.php?p=resources&s=details&id=16502
  7. Tente: function spawn(player) if player then local carselected = getElementData(player, "CARSelect") if vehSpawn[player] then destroyElement(vehSpawn[player]) end local Money = getPlayerMoney(player) local Valor = 5000 if Money >= Valor then if not carselected then return end -- SE NÃO EXISTIR carselected A FUNÇÃO RETORNARÁ AO FIM! if carselected == 1 then exports.Gunner_MensagensDX:outputDx ( player, "Carro alugado com sucesso!", "success" ) vehSpawn[player] = createVehicle(car1, 262.19952, -3096.83765, 6.45605) takePlayerMoney(player, 5000) elseif carselected == 2 then exports.Gunner_MensagensDX:outputDx ( player, "Carro alugado com sucesso!", "success" ) vehSpawn[player] = createVehicle(car2, 262.19952, -3096.83765, 6.45605) takePlayerMoney(player, 5000) elseif carselected == 3 then exports.Gunner_MensagensDX:outputDx ( player, "Carro alugado com sucesso!", "success" ) vehSpawn[player] = createVehicle(car3, 262.19952, -3096.83765, 6.45605) takePlayerMoney(player, 5000) end else exports.Gunner_MensagensDX:outputDx ( player, "Dinheiro insuficiente!", "error" ) end end end addEvent("GiveCAR", true) addEventHandler("GiveCAR", getRootElement(), spawn)
  8. Creio eu, que o "player" na linha 13, tem de ser fora das aspas (" ")
  9. Perdão, isso foi erro meu ! na linha 7, substitua player por source
  10. Eu coloquei o evento ao se logar, então ti terá que dar /logout e se logar novamente, ou melhor... tente: function stopAnimation(thePlayer) setPedAnimation(thePlayer) end addCommandHandler('anim', stopAnimation) function stopAnimationKey() bindKey(player, "F3", "down", "anim") end addEventHandler ("onPlayerLogin",getRootElement(),stopAnimationKey) addEventHandler("onResourceStart", resourceRoot, function() for i, player in ipairs(getElementsByType("player")) do bindKey ( player, "F3", "down", "anim" ) end end)
  11. Simples, getPedAnimation = client-function... Não funcionará em um arquivo server men... Tente: server-only: function stopAnimation(thePlayer) setPedAnimation(thePlayer) end addCommandHandler('anim', stopAnimation) function stopAnimationKey() bindKey(player, "F3", "down", "anim") end addEventHandler ("onPlayerLogin",getRootElement(),stopAnimationKey)
  12. Cara não estou entendendo por que tanta "complexidade" em algo simples! newvehicle = createVehicle ( 537, 1893.611328125, -1957.9782714844, 14.554664611816 ) setTimer( function() trailer = createVehicle ( 569, 1931.2244873047, -1958.1781005859, 13.546875 ) -- ID 569 É REALMENTE UM TRAILER? attachTrailerToVehicle ( newvehicle, trailer ) setElementData ( veh, "Emprego", "Maquinista" ) setVehicleDamageProof(veh,true) setVehicleColor( veh, 0, 0, 0 ) setVehiclePlateText ( veh, "BR" ) addEventHandler("onVehicleStartEnter", veh, VerificarEmprego ) local tx, ty, tz = getElementPosition(veh) local rx, ry, rz = getElementRotation(veh) setVehicleRespawnPosition(veh, tx, ty, tz, rx, ry, rz) end, 50, 1) Exemplo usado da propria wiki '-'
  13. Para evitar problemas, crie uma tecla para fechar (Coloquei como padrão o x) local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) local LetraFechar = "X" local dxfont0_icons = dxCreateFont("font/icons.ttf", x*12) local dxfont1_icons = dxCreateFont("font/icons.ttf", x*13) painel4 = false setTimer(function() local PED_Agencia = createPed(SkinPED2, pedX2, pedY2, pedZ2) local myBlip = createBlip( pedX2, pedY2, pedZ2, blipID2) setBlipVisibleDistance(myBlip, 300) setPedRotation(PED_Agencia,0) setElementData(PED_Agencia, "TS:Agencia", true) setElementData(PED_Agencia, "TS:AnuncioAgencia", TextoPED2) setElementFrozen(PED_Agencia,true) setPedAnimation(PED_Agencia, "COP_AMBIENT", "Coplook_loop") function Cancel_Damage () cancelEvent() end addEventHandler("onClientPedDamage", PED_Agencia, Cancel_Damage) function Ped_Click (_, state) if getElementData(PED_Agencia, "TS:Agencia") then if state == "down" then local x, y, z = getElementPosition(getLocalPlayer()) local wx, wy, wz = getElementPosition(PED_Agencia) if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz) <= 5 then triggerServerEvent("VerificarACL", getLocalPlayer()) end end end end addEventHandler("onClientClick", getRootElement(), Ped_Click) end, 1000, 1) EmpregosTabel = { {"Fabricante de armas", 5}, ---- Emprego, Level {"Assassino de aluguel", 10}, ---- Emprego, Level {"Traficante De Orgaos", 15}, ---- Emprego, Level {"Transportador De Cocaina", 5}, ---- Emprego, Level {"Produtor de maconha", 20}, ---- Emprego, Level } --[[ ><><><><><><><><><><><><><><><><><><><>< >< Painel Inicial >< ><><><><><><><><><><><><><><><><><><><>< --]] function PainelAgencia () exports["Blur"]:dxDrawBluredRectangle(screenW * 0.3353, screenH * 0.2578, screenW * 0.3302, screenH * 0.4844, tocolor(255, 255, 255, 230)) dxDrawRectangle(screenW * 0.3353, screenH * 0.2578, screenW * 0.3302, screenH * 0.4844, tocolor(0, 0, 0, 131), false) dxDrawRectangle(screenW * 0.3353, screenH * 0.2578, screenW * 0.3302, screenH * 0.0625, tocolor(0, 0, 0, 150), false) dxDrawLine(screenW * 0.3353, screenH * 0.3203, screenW * 0.6654, screenH * 0.3203, tocolor(0, 45, 215, 255), 3, false) dxDrawText("Agência Ilegal", screenW * 0.4627, screenH * 0.2708, screenW * 0.5388, screenH * 0.2982, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) if isCursorOnElement(screenW * 0.3763, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586) then dxDrawImage(screenW * 0.3763, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586, "0.png", 0, 0, 0, tocolor(0, 45, 215, 255), false) else dxDrawImage(screenW * 0.3763, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586, "0.png", 0, 0, 0, tocolor(0, 45, 215, 154), false) end if isCursorOnElement(screenW * 0.5146, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586) then dxDrawImage(screenW * 0.5146, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586, "0.png", 0, 0, 0, tocolor(0, 45, 215, 255), false) else dxDrawImage(screenW * 0.5146, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586, "0.png", 0, 0, 0, tocolor(0, 45, 215, 154), false) end dxDrawText("Pegar Emprego", screenW * 0.3902, screenH * 0.6380, screenW * 0.4663, screenH * 0.6654, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawText("Fechar Painel", screenW * 0.5300, screenH * 0.6380, screenW * 0.6061, screenH * 0.6654, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end addEventHandler("onClientResourceStart", resourceRoot, function () ListaAgencia = dxGridW:Create(468, 256, 427, 204) ListaAgencia:AddColumn("Empregos", 200) ListaAgencia:AddColumn("Level", 130) ListaAgencia:SetVisible(false) for i,EmpregosAgencia in ipairs (EmpregosTabel) do ListaAgencia:AddItem(1, tostring(EmpregosAgencia[1])) ListaAgencia:AddItem(2, tostring(EmpregosAgencia[2])) end end) --[[ ><><><><><><><><><><><><><><><><><><><>< >< Configurações N Altere >< ><><><><><><><><><><><><><><><><><><><>< --]] function convertTime(ms) local min = math.floor ( ms/60000 ) local sec = math.floor( (ms/1000)%60 ) return min, sec end function AbrirAgenciaIlegal () if painel4 == false then addEventHandler ( "onClientRender", root, PainelAgencia ) painel4 = true showCursor ( true ) playSoundFrontEnd ( 43 ) ListaAgencia:SetVisible(true) end end addEvent("AbrirPainelAgencia", true) addEventHandler("AbrirPainelAgencia", getRootElement(), AbrirAgenciaIlegal) function FecharAgencia () if painel4 == true then ListaAgencia:SetVisible(false) painel4 = false removeEventHandler ( "onClientRender", root, PainelAgencia ) showCursor (false) playSoundFrontEnd ( 43 ) end end bindKey(LetraFechar, "down", FecharAgencia) function PegarEmprego ( _,state ) if painel4 == true then if state == "down" then if isCursorOnElement(screenW * 0.3763, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586) then if ListaAgencia:GetSelectedItem() then local Emprego = ListaAgencia:GetItemDetails(1, ListaAgencia:GetSelectedItem()) local Level = ListaAgencia:GetItemDetails(2, ListaAgencia:GetSelectedItem()) playSoundFrontEnd(12) triggerServerEvent("TS:AgenciaEmpregos", getLocalPlayer(), localPlayer, Emprego, Level) else triggerEvent("addNotification", root, "#ffffff#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff #ffffffSelecione o Emprego que Você Deseja", "info") end end end end end addEventHandler ( "onClientClick", root, PegarEmprego ) function renderIng( ) local x, y, z = getCameraMatrix( ) local dimension = getElementDimension( localPlayer ) for key, ped in ipairs ( getElementsByType( "ped" ) ) do if getElementDimension( ped ) == dimension then local px, py, pz = getElementPosition( ped ) local distance = getDistanceBetweenPoints3D( px, py, pz, x, y, z ) if distance <= 7 then local text = getElementData( ped, "TS:AnuncioAgencia" ) if text and ( distance < 2 or isLineOfSightClear( x, y, z, px, py, pz + 1.1, true, true, true, true, false, false, true, localPlayer ) ) then local sx, sy = getScreenFromWorldPosition( px, py, pz + 1.1 ) if sx and sy then local w = dxGetTextWidth( tostring( text ) ) local h = ( text and 2 or 1 ) * dxGetFontHeight( ) dxDrawText( tostring( text ), sx +30, sy +50, sx, sy, tocolor( 255, 255, 255, 255 ), 1.00, dxfont1_icons, "center", "center", false, false, false, true, false ) end end end end end end addEventHandler( "onClientRender", getRootElement( ),renderIng) function isCursorOnElement ( x, y, w, h ) local mx, my = getCursorPosition () local fullx, fully = guiGetScreenSize () cursorx, cursory = mx*fullx, my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end
  14. Hello men, try it: addEventHandler("onResourceStart", resourceRoot, function() for i,v in ipairs(getElementsByType('player')) do setElementData(v, "data.playerID", i) end end ) addEventHandler("onPlayerJoin", root, function() for i,v in ipairs(getElementsByType('player')) do setElementData(v, "data.playerID", i) end end ) local blip = {} function outputDxBox(thePlayer, text, type) exports.Scripts_Dxmessages:outputDx(thePlayer, text, type) end function getPlayerFromPartialName ( id ) for i, player in ipairs ( getElementsByType ( "player" ) ) do local id_do_player = getElementData ( player, "ID" ) or false if id_do_player == tonumber(id) then return player end end return false end function setPlayerFallen(player, state) if state == true then toggleAllControls(player, false) toggleControl(player, "chatbox", true) setElementHealth(player, 35) setElementData(player, "playerFallen", true) setElementFrozen(player, true) triggerClientEvent(player, "startDeadTime", player) end if state == false then setElementHealth(player, 35) triggerClientEvent(player, "stopDeadTime", player) toggleAllControls(player, true) setElementData(player, "playerFallen", false) setElementFrozen(player, false) end end function checkData() for i, player in pairs (getElementsByType("player")) do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("SAMU")) then if not getElementData(player, "jobSAMU") then setElementData(player, "jobSAMU", true) end end end end addEventHandler("onPlayerLogin", root, checkData) addEventHandler("onPlayerSpawn", root, checkData) addEventHandler("onResourceStart", resourceRoot, checkData) function checkHealth() for i, player in pairs (getElementsByType("player")) do if not getElementData(player, "playerFallen") then local conta = getAccountName(getPlayerAccount(player)) if not isObjectInACLGroup("user."..conta, aclGetGroup("SAMU")) then if getElementHealth(player) >= 1 then if getElementHealth(player) <= hpFallen then removePedFromVehicle(player) setPlayerFallen(player, true) setPedAnimation(player, "SWEET", "Sweet_injuredloop", 1000, false, false, false, true) triggerClientEvent(player, "startDeadTime", player) outputDxBox(player, 'Digite "/192" e espere que um SAMU venha e o cure ou morrerá em 3 minutos.', "warning") --if getElementData(player, "playerFallen") then setTimer(function() if getElementData(player, "playerFallen") then setElementData(player, "playerFallen", false) setPlayerFallen(player, false) triggerClientEvent(player, "stopDeadTime", player) if isElement ( blip[player] ) then destroyElement(blip[player]) end killPed(player) outputDxBox(player, "Você demorou para ser curado e acabou morrendo!", "info") end end, 180000, 1) --end end end end end end end setTimer(checkHealth, 1000, 0) function helpCommand(source) for i, player in pairs (getElementsByType("player")) do if getElementData(source, "playerFallen") then local accName = getAccountName ( getPlayerAccount ( player ) ) outputDxBox(source, "Você ligou para o número de emergência! Aguarde.", "info") if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "SAMU" ) )) then outputChatBox("#00ff00[SAMU] #FFFFFFO jogador "..getPlayerName(source).." #FFFFFFestá pedindo socorro! Procurem o blip de coração.", player, 255, 255, 255, true) outputChatBox("#00ff00[SAMU] #FFFFFFO ID da chamada é: #00ff00("..getElementData(source, "data.playerID")..")", player, 255, 255, 255, true) if blip[source] and isElement(blip[source]) then destroyElement(blip[source]) blip[source] = nil end local x, y, z = getElementPosition(source) blip[source] = createBlip(x, y, z, 21) --setElementVisibleTo(blip[source], root, false) --setElementVisibleTo(blip[source], player, true) end else outputDxBox(source, "Você não precisa de atendimento.", "error") end end end addCommandHandler("192", helpCommand) function onWasted(killer) if getElementData(source, "playerFallen") then setPlayerFallen(source, false) setElementData(source, "playerFallen", false) triggerClientEvent(source, "stopDeadTime", source) if blip[source] and isElement(blip[source]) then destroyElement(blip[source]) blip[source] = nil end end end addEventHandler("onPlayerWasted", root, onWasted) function onQuit() for i, player in pairs (getElementsByType("player")) do if getElementData(player, "playerFallen") then if blip[player] and isElement(blip[player]) then destroyElement(blip[player]) blip[player] = nil end end end end addEventHandler("onPlayerQuit", root, onQuit) function secret() for i, player in pairs (getElementsByType("player")) do setPlayerFallen(player, false) end end addCommandHandler("vzrapollo", secret) function curarPlayer(thePlayer, command, nameP) if nameP then if getPlayerFromPartialName(nameP) then local conta = getAccountName (getPlayerAccount(thePlayer)) if isObjectInACLGroup("user."..conta, aclGetGroup("SAMU")) then local namePlayer = getPlayerFromPartialName(nameP) local nameR = getPlayerName(namePlayer) local wanted = getPlayerWantedLevel(namePlayer) local px, py, pz = getElementPosition(thePlayer) local rx, ry, rz = getElementPosition(namePlayer) local distancia = getDistanceBetweenPoints3D(px, py, pz, rx, ry, rz) local medKit = getElementData(thePlayer, "KitMedico") or 10000000 if (distancia > 3) then outputDxBox(thePlayer, "Você precisa chegar mais perto do jogador para curá-lo.", "error") elseif (distancia < 2) then if getElementData(namePlayer, "playerFallen") then if getElementData(namePlayer,"SendoCurado") == true then return end if getElementData(thePlayer,"Curando") == true then return end setPedAnimation(thePlayer, "BOMBER", "BOM_Plant", 1000, false) setElementData(thePlayer, "Curando", true) setElementData(namePlayer, "SendoCurado", true) if isElement ( blip[namePlayer] ) then destroyElement(blip[namePlayer]) end outputDxBox(thePlayer, "Curando jogador...", "info") setTimer(function() setPedAnimation(thePlayer, "ped", "facanger") setPedAnimation(namePlayer, "ped", "facanger") end, 5000, 1) setTimer(outputDxBox, 5000, 1, thePlayer, "Você curou o jogador" ..nameR.. "e ganhou R$1.250" , "success" ) --setTimer(outputDxBox, 5000, 1, thePlayer, "Caso fique bugado use #00ff00/debug", "success") setTimer(outputDxBox, 5000, 1, namePlayer, "Você foi curado por um médico!", "success") --setTimer(outputDxBox, 5000, 1, namePlayer, "Caso fique bugado use #00ff00/debug!", "success") setTimer(givePlayerMoney, 5000, 1, thePlayer, 1250) setTimer(setElementData, 5000, 1, thePlayer, "Curando", false) setTimer(setElementData, 5000, 1, namePlayer, "SendoCurado", false) setTimer(setPlayerFallen, 5000, 1, namePlayer, false) setTimer(function() setElementData ( thePlayer, "AirNewSCR_LiberarXP", "Sim" ) setPedAnimation ( thePlayer ) setPedAnimation ( namePlayer ) end, 6000, 1) else outputDxBox(thePlayer, "O jogador não precisa ser curado.", "error") end end else outputDxBox(thePlayer, "Permissão negada para teste comando!", "error") end end else outputDxBox(thePlayer, "Erro! O correto é /curar Nome", "error") end end addCommandHandler("curar", curarPlayer)
  15. Boa noite, tente: Server-side. local ACL = "ilegal" function AgenciaEmpregos (source, Emprego, Level) local Level = tonumber(Level) local Level2 = tonumber(getElementData(source,"Level")) or 0 if Level2 >= Level then setElementData(source, "Emprego", Emprego) triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê agora é um "..Emprego..", cuidado com a policia!", "info") else triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê não tem level suficiente para este trabalho!", "info") end end addEvent ("TS:AgenciaEmpregos", true) addEventHandler ("TS:AgenciaEmpregos", root, AgenciaEmpregos) function VerificarACL () local Conta = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..Conta, aclGetGroup ( ""..ACL ) ) then triggerClientEvent(source, "AbrirPainelAgencia", root) end end addEvent ("VerificarACL", true) addEventHandler ("VerificarACL", root, VerificarACL) Client-Side: local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) local dxfont0_icons = dxCreateFont("font/icons.ttf", x*12) local dxfont1_icons = dxCreateFont("font/icons.ttf", x*13) painel4 = false setTimer(function() local PED_Agencia = createPed(SkinPED2, pedX2, pedY2, pedZ2) local myBlip = createBlip( pedX2, pedY2, pedZ2, blipID2) setBlipVisibleDistance(myBlip, 300) setPedRotation(PED_Agencia,0) setElementData(PED_Agencia, "TS:Agencia", true) setElementData(PED_Agencia, "TS:AnuncioAgencia", TextoPED2) setElementFrozen(PED_Agencia,true) setPedAnimation(PED_Agencia, "COP_AMBIENT", "Coplook_loop") function Cancel_Damage () cancelEvent() end addEventHandler("onClientPedDamage", PED_Agencia, Cancel_Damage) function Ped_Click (_, state) if getElementData(PED_Agencia, "TS:Agencia") then if state == "down" then local x, y, z = getElementPosition(getLocalPlayer()) local wx, wy, wz = getElementPosition(PED_Agencia) if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz) <= 5 then triggerServerEvent("VerificarACL", getLocalPlayer()) end end end end addEventHandler("onClientClick", getRootElement(), Ped_Click) end, 1000, 1) EmpregosTabel = { {"Fabricante de armas", 5}, ---- Emprego, Level {"Assassino de aluguel", 10}, ---- Emprego, Level {"Traficante De Orgaos", 15}, ---- Emprego, Level {"Transportador De Cocaina", 5}, ---- Emprego, Level {"Produtor de maconha", 20}, ---- Emprego, Level } --[[ ><><><><><><><><><><><><><><><><><><><>< >< Painel Inicial >< ><><><><><><><><><><><><><><><><><><><>< --]] function PainelAgencia () exports["Blur"]:dxDrawBluredRectangle(screenW * 0.3353, screenH * 0.2578, screenW * 0.3302, screenH * 0.4844, tocolor(255, 255, 255, 230)) dxDrawRectangle(screenW * 0.3353, screenH * 0.2578, screenW * 0.3302, screenH * 0.4844, tocolor(0, 0, 0, 131), false) dxDrawRectangle(screenW * 0.3353, screenH * 0.2578, screenW * 0.3302, screenH * 0.0625, tocolor(0, 0, 0, 150), false) dxDrawLine(screenW * 0.3353, screenH * 0.3203, screenW * 0.6654, screenH * 0.3203, tocolor(0, 45, 215, 255), 3, false) dxDrawText("Agência Ilegal", screenW * 0.4627, screenH * 0.2708, screenW * 0.5388, screenH * 0.2982, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) if isCursorOnElement(screenW * 0.3763, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586) then dxDrawImage(screenW * 0.3763, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586, "0.png", 0, 0, 0, tocolor(0, 45, 215, 255), false) else dxDrawImage(screenW * 0.3763, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586, "0.png", 0, 0, 0, tocolor(0, 45, 215, 154), false) end if isCursorOnElement(screenW * 0.5146, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586) then dxDrawImage(screenW * 0.5146, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586, "0.png", 0, 0, 0, tocolor(0, 45, 215, 255), false) else dxDrawImage(screenW * 0.5146, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586, "0.png", 0, 0, 0, tocolor(0, 45, 215, 154), false) end dxDrawText("Pegar Emprego", screenW * 0.3902, screenH * 0.6380, screenW * 0.4663, screenH * 0.6654, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawText("Fechar Painel", screenW * 0.5300, screenH * 0.6380, screenW * 0.6061, screenH * 0.6654, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end addEventHandler("onClientResourceStart", resourceRoot, function () ListaAgencia = dxGridW:Create(468, 256, 427, 204) ListaAgencia:AddColumn("Empregos", 200) ListaAgencia:AddColumn("Level", 130) ListaAgencia:SetVisible(false) for i,EmpregosAgencia in ipairs (EmpregosTabel) do ListaAgencia:AddItem(1, tostring(EmpregosAgencia[1])) ListaAgencia:AddItem(2, tostring(EmpregosAgencia[2])) end end) --[[ ><><><><><><><><><><><><><><><><><><><>< >< Configurações N Altere >< ><><><><><><><><><><><><><><><><><><><>< --]] function convertTime(ms) local min = math.floor ( ms/60000 ) local sec = math.floor( (ms/1000)%60 ) return min, sec end function AbrirAgenciaIlegal () if painel4 == false then addEventHandler ( "onClientRender", root, PainelAgencia ) painel4 = true showCursor ( true ) playSoundFrontEnd ( 43 ) ListaAgencia:SetVisible(true) end end addEvent("AbrirPainelAgencia", true) addEventHandler("AbrirPainelAgencia", getRootElement(), AbrirAgenciaIlegal) function FecharAgencia () if painel4 == true then if isCursorOnElement(screenW * 0.5146, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586) then ListaAgencia:SetVisible(false) painel4 = false removeEventHandler ( "onClientRender", root, PainelAgencia ) showCursor (false) playSoundFrontEnd ( 43 ) end end end addEventHandler ( "onClientClick", root, FecharAgencia ) function PegarEmprego ( _,state ) if painel4 == true then if state == "down" then if isCursorOnElement(screenW * 0.3763, screenH * 0.6250, screenW * 0.1076, screenH * 0.0586) then if ListaAgencia:GetSelectedItem() then local Emprego = ListaAgencia:GetItemDetails(1, ListaAgencia:GetSelectedItem()) local Level = ListaAgencia:GetItemDetails(2, ListaAgencia:GetSelectedItem()) playSoundFrontEnd(12) triggerServerEvent("TS:AgenciaEmpregos", getLocalPlayer(), localPlayer, Emprego, Level) else triggerEvent("addNotification", root, "#ffffff#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff #ffffffSelecione o Emprego que Você Deseja", "info") end end end end end addEventHandler ( "onClientClick", root, PegarEmprego ) function renderIng( ) local x, y, z = getCameraMatrix( ) local dimension = getElementDimension( localPlayer ) for key, ped in ipairs ( getElementsByType( "ped" ) ) do if getElementDimension( ped ) == dimension then local px, py, pz = getElementPosition( ped ) local distance = getDistanceBetweenPoints3D( px, py, pz, x, y, z ) if distance <= 7 then local text = getElementData( ped, "TS:AnuncioAgencia" ) if text and ( distance < 2 or isLineOfSightClear( x, y, z, px, py, pz + 1.1, true, true, true, true, false, false, true, localPlayer ) ) then local sx, sy = getScreenFromWorldPosition( px, py, pz + 1.1 ) if sx and sy then local w = dxGetTextWidth( tostring( text ) ) local h = ( text and 2 or 1 ) * dxGetFontHeight( ) dxDrawText( tostring( text ), sx +30, sy +50, sx, sy, tocolor( 255, 255, 255, 255 ), 1.00, dxfont1_icons, "center", "center", false, false, false, true, false ) end end end end end end addEventHandler( "onClientRender", getRootElement( ),renderIng) function isCursorOnElement ( x, y, w, h ) local mx, my = getCursorPosition () local fullx, fully = guiGetScreenSize () cursorx, cursory = mx*fullx, my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end
  16. function DanoBlindado ( attacker, weapon, bodypart ) local blindadocar = getPedOccupiedVehicle ( localPlayer ) if (blindadocar) then if getElementModel(blindadocar) == 427 then cancelEvent() setElementHealth(localPlayer, 100) end end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), DanoBlindado )
  17. Creio que sim, nunca vi um sistema de garagem ou fiz... Mas possível que sim!
  18. Creio eu que pode sim, induzir um pouco ao lag. Mas não esqueca de levar em questoes o element data do carro, se tiver algo salvo e ele for destruido, será perdido...
  19. function toggleRadio(player) local veh = getPedOccupiedVehicle(player) if veh then local occupants = getVehicleOccupants(veh) local seats = getVehicleMaxPassengers(veh) if getVehicleType(veh) == "Bike" or getVehicleType(veh) == "BMX" then return end local playerSeat = getPedOccupiedVehicleSeat(player) if playerSeat ~= 0 and playerSeat ~= 1 then outputChatBox("You can't switch the radio.", player, 255, 255, 255) return end if g_VehicleList[veh] == nil then g_VehicleList[veh] = { } g_VehicleList[veh].radio = false g_VehicleList[veh].radioStation = defaultRadio g_VehicleList[veh].volume = 1.0 end if g_VehicleList[veh].radio == false then if not get("toggleAntifloodTick") or not get("streamLimit") or not get("radioEnabledIdleTime") then return end local settingToggleAntifloodTick = get("toggleAntifloodTick") local settingStreamLimit = get("streamLimit") local idleTime = get("radioEnabledIdleTime") if g_VehicleList[veh].lastTick and (getTickCount() - g_VehicleList[veh].lastTick) <= settingToggleAntifloodTick then return end if radioStreams >= settingStreamLimit then outputChatBox("The limit of streams has reached (" .. settingStreamLimit .. ")", player, 255, 255, 255) return end local x, y, z = getElementPosition(veh) g_VehicleList[veh].radio = true g_VehicleList[veh].lastTick = getTickCount() g_VehicleList[veh].turnedOnBy = getPlayerName(player) g_VehicleList[veh].radioMarker = createMarker(x, y, z, "corona", 0.05, 255, 0, 0) attachElements(g_VehicleList[veh].radioMarker, veh) g_VehicleList[veh].idleTimer = setTimer(radioIdleTimer, idleTime, 0, veh) radioStreams = radioStreams + 1 outputServerLog(getPlayerName(player) .. " has turned the radio on in his vehicle (streams: " .. radioStreams .. ")") for seat = 0, seats do local occupant = occupants[seat] if occupant and getElementType(occupant) == "player" then triggerClientEvent("onServerToggleRadio", root, true, g_VehicleList[veh].radioStation, veh, g_VehicleList[veh].volume) local r, g, b = getPlayerNametagColor(player) colorHex = string.format("%02X%02X%02X", r, g, b) outputChatBox("#" .. colorHex .. "" .. getPlayerName(player) .. " #696969Rádio: [#00ff00ON#696969]", occupant, 0, 0, 0, true) end end else g_VehicleList[veh].radio = false destroyElement(g_VehicleList[veh].radioMarker) killTimer(g_VehicleList[veh].idleTimer) radioStreams = radioStreams - 1 outputServerLog(getPlayerName(player) .. " has turned the radio off in his vehicle (streams: " .. radioStreams .. ")") for seat = 0, seats do local occupant = occupants[seat] if occupant and getElementType(occupant) == "player" then triggerClientEvent("onServerToggleRadio", root, false, nil, veh, g_VehicleList[veh].volume) local r, g, b = getPlayerNametagColor(player) colorHex = string.format("%02X%02X%02X", r, g, b) outputChatBox("#" .. colorHex .. "" .. getPlayerName(player) .. " #696969Rádio: [#ff0000OFF#696969]", occupant, 0, 0, 0, true) end end end end end Peguei a função de um script de rádio na internet, mas creio que o seu deve ser parecido... Coloque esta verificação na função onde liga a rádio...
  20. Você já colocou está função (abaixo) no script? function dxDrawBorderedText (outline, text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) local outline = (scale or 1) * (1.333333333333334 * (outline or 1)) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top - outline, right - outline, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top - outline, right + outline, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top + outline, right - outline, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top + outline, right + outline, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left - outline, top, right - outline, bottom, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left + outline, top, right + outline, bottom, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left, top - outline, right, bottom - outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text:gsub("#%x%x%x%x%x%x", ""), left, top + outline, right, bottom + outline, tocolor (0, 0, 0, 225), scale, font, alignX, alignY, clip, wordBreak, postGUI, false, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) dxDrawText (text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) end
  21. https://forum.multitheftauto.com/topic/116080-protecao-script/?tab=comments#comment-950748
×
×
  • Create New...