Jump to content

Jonas^

Members
  • Posts

    1,016
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Jonas^

  1. Ela ainda funciona, porém é bom mudar mesmo, eu particularmente uso setElementModel... Mas o código deve funcionar igual com setPedSkin, isso não altera nada no uso (pelo menos até o momento desse meu post não).
  2. local skin = createMarker (2248.80, -1208.73, 1048.10, 'cylinder', 1.0, 255, 0,0, 150) setElementInterior (skin, 10) addEventHandler ("onMarkerHit", skin, function (hitElement, matchingDimension) if getElementType(hitElement) == "player" and matchingDimension then -- verifica se o elemento é um player e se o elemento esta na mesma dimensão que o marcador setPedSkin (hitElement, 305) -- seta a skin end end) addCommandHandler ("ir", function (thePlayer, cmd) setElementPosition (thePlayer, 2251, -1208, 1049) setElementInterior (thePlayer, 10) end) Tente desta forma @MRXBBC
  3. Qual dificuldade de pelo menos tentar fazer? não só dar ctrl c + v. function AceitarEmprego02 (source) exports.Scripts_OnMarkerMsgs_:delete (source) unbindKey (source, LetraParaMarkers, "down", AceitarEmprego02) if not isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (source)), aclGetGroup("Entregador")) then -- Se o jogador não estiver na acl "Entregador", então: aclGroupAddObject (aclGetGroup("Entregador"), "user."..getAccountName (getPlayerAccount (source))) -- Adiciona ele na acl "Entregador". if getElementData (source, "AirNew>Encaminhamento") == "Entregador de Jornal" then setElementData (source, "AirNew>Encaminhamento", false) setElementData (source, "Emprego", "Entregador de Jornal") exports.Scripts_Dxmessages:outputDx (source, "Você Agora Trabalha de Entregador de Jornal, Para Mais Informações Digite ( /Profissao )", "success") else exports.Scripts_Dxmessages:outputDx (source, "Você Precisa Estar Encaminhado da Agencia de Empregos para Trabalhar neste Local!", "error") end end end function RecusarEmprego02 (source) exports.Scripts_OnMarkerMsgs_:delete (source) unbindKey (source, LetraParaMarkers, "down", RecusarEmprego02) if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (source)), aclGetGroup("Entregador")) then -- Se o jogador já estiver na acl "Entregador", então: aclGroupRemoveObject (aclGetGroup("Entregador"), "user."..getAccountName (getPlayerAccount (source))) -- Remove ele da acl "Entregador". if isElementVisibleTo (HQEntregadorDeJornalBlip, source) then setElementVisibleTo (HQEntregadorDeJornalBlip, source, false) end removeElementData (source, "Emprego", "Entregador de Jornal") exports.Scripts_Dxmessages:outputDx(source, "Você se Demitiu do Emprego de Entregador de Jornal com Sucesso!", "warning") end end Troque as duas funções do seu código por essas, digite /debugscript 3 quando for testar, poste resultados.
  4. Na verdade não, apenas os admins com acesso a aba (resources) conseguem setar novos cargos manualmente pelo painel (p), por tanto, você pode modificar isso na acl, por padrão os grupos que tem acesso a aba resources são: SuperModerator ++, ou seja, apenas 2 grupos possuem acesso a ela, caso queria remover é bem simples, abra seu acl.xml e procure por: <right name="general.tab_resources" access="true"></right> Onde tiver true troque por false, desta forma: <right name="general.tab_resources" access="false"></right> Salve e de reload na acl, /reloadacl e de restart no painel admin, mas eu aconselho desligar o servidor pra fazer esse tipo de mudança pra evitar qualquer tipo de bug alienígena....
  5. O bloqueio deve ser feito pelo evento OnClientKey. Desta forma: addEventHandler ("onClientKey", root, function (button, press) if getElementData (localPlayer, "dataPreso") then -- Suponhando que a data que o jogador recebe quando é preso é "dataPreso", então: if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "F9" or button == "F10" or button == "F11" or button == "F12" or button == "t" then cancelEvent () end end end)
  6. Código bem mal feito.... Respondendo sua dúvida, este tópico ira te ajudar: Clique Aqui
  7. Vai dar erro @EW1611, thePlayer não foi declarado em lugar nenhum. local objeto = createObject (IdObjeto, PosX, PosY, PosZ, RotX, RotY, RotZ) local x, y, z = getElementPosition (objeto) local Zona = createColCircle (x, y, 7, 7) addEventHandler ("onColShapeHit", Zona, function (thePlayer, matchingDimension) if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount(thePlayer)), aclGetGroup("Bope")) then -- Se o jogador estiver na acl "Bope", então: moveObject (objeto, 3000, PosX, PosY, PosZ, RotX, RotY, RotZ) outputChatBox ("Bem vindo", thePlayer, 0, 255, 0) else outputChatBox ("Você não é do Bope", thePlayer, 255, 0, 0) end end) addEventHandler ("onColShapeLeave", Zona, function (thePlayer, matchingDimension) if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount(thePlayer)), aclGetGroup("Bope")) then -- Se o jogador estiver na acl "Bope", então: moveObject (objeto, 3000, PosX, PosY, PosZ, RotX, RotY, RotZ) outputChatBox ("Youtube: GamerMagnataHD", thePlayer, 0, 255, 0) end end)
  8. 1. Pra fazer isso, você precisa fazer com que o client ligue para o servidor e avise, (coloque tal jogador em tal acl) pois o painel só é possível criar do lado client já que o jogador precisa pressionar um botão pra ser adicionado na acl e pra isso iremos utilizar TriggerServerEvent. Sabendo dessa primeira informação, então vamos lá! Fiz um painel de exemplo e comentei as linhas pra você entender, tentei ser o mais breve possível pra você entender, até porque isso é algo bem simples. Client: local sX, sY = guiGetScreenSize () addEventHandler ("onClientResourceStart", resourceRoot, function () mainWindow = guiCreateWindow (sX/2 - 155, sY/2 - 115, 310, 230, "", false) guiWindowSetSizable (mainWindow, false) showCursor (true) guiSetProperty (mainWindow, "TitlebarEnabled", "False") guiSetProperty (mainWindow, "CloseButtonEnabled", "False") btnPegar = guiCreateButton (85, 80, 140, 30, "Pegar Emprego", false, mainWindow) btnSair = guiCreateButton (85, 122, 140, 30, "Sair Emprego", false, mainWindow) btnClose = guiCreateButton (266, 195, 34, 25, "x", false, mainWindow) end) addEventHandler ("onClientGUIClick", guiRoot, function (btn) if btn ~= "left" then return end -- Se o botão clicado do mouse não for o esquerdo, cancela a função e nada acontece. if source == btnPegar then -- Se o botão clicado for o botão de btnPegar, então: triggerServerEvent ("onRequestPegarEmprego", localPlayer, "pegarEmprego") -- Enviamos para o servidor setar o jogador na acl. elseif source == btnSair then -- Se o botão clicado for o botão de btnSair, então: triggerServerEvent ("onRequestPegarEmprego", localPlayer, "sairEmprego") -- Enviamos para o servidor tirar o jogador da acl. elseif source == btnClose then -- Se o botão clicado for o botão de btnClose, então: guiSetVisible (mainWindow, false) showCursor (false) end end) Server: function confirmTrampo (type, join, leave) if (type == "pegarEmprego") then -- Se a string enviada pelo client for "pegarEmprego", então: if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (client)), aclGetGroup("Mecanico"))) then -- Se o jogador já estiver na acl "Mecanico", então: outputChatBox ("Você já está no trabalho de mecanico!", client, 255, 30, 30) else -- Senão: aclGroupAddObject (aclGetGroup("Mecanico"), "user."..getAccountName (getPlayerAccount (client))) -- Coloca o jogador na acl "Mecanico". outputChatBox ("Parabéns! Agora você está trabalhando de mecânio!", client, 0, 255, 0) end elseif (type == "sairEmprego") then -- Se a string enviada pelo client for "sairEmprego", então: if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (client)), aclGetGroup("Mecanico"))) then -- Se o jogador estiver na acl "Mecanico", então: aclGroupRemoveObject (aclGetGroup("Mecanico"), "user."..getAccountName (getPlayerAccount (client))) -- Remove o jogador da acl "Mecanico". outputChatBox ("Você saiu do trabalho de mecânico!", client, 0, 255, 0) else outputChatBox ("Você não está no trabalho de mecânico!", client, 255, 30, 30) end end end addEvent ("onRequestPegarEmprego", true) addEventHandler ("onRequestPegarEmprego", root, confirmTrampo) É aqui onde a mágica acontece, onde recebe as informações do client e seta o jogador na acl, então preste bastante atenção nessa parte. Espero ter ajudado, boa tarde
  9. marker1 = createMarker(2122.7575683594,-1784.9986572266,12.387022018433, "cylinder", 1.5) addEventHandler ("onClientMarkerHit", root, function (hitPlayer, matchingDimension) if isElementWithinMarker (hitPlayer, marker1) then if (getElementType (hitPlayer) == "player") then addEventHandler ("onClientRander", root, DX1) end end end) function DX1 () dxDrawLine (395 - 1, 0 - 1, 395 - 1, 38, tocolor(255, 254, 254, 255), 1, false) dxDrawLine (972, 0 - 1, 395 - 1, 0 - 1, tocolor(255, 254, 254, 255), 1, false) dxDrawLine (395 - 1, 38, 972, 38, tocolor(255, 254, 254, 255), 1, false) dxDrawLine (972, 38, 972, 0 - 1, tocolor(255, 254, 254, 255), 1, false) dxDrawRectangle (395, 0, 577, 38, tocolor(0, 0, 0, 93), false) dxDrawText ("Pizzaria: Temos ... Pizzas disponíveis para entrega", 443, 5, 923, 28, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "top", false, false, false, false, false) end
  10. Era só ter lido, onde esta escrito nome_acl na linha 4.
  11. Eu já respondi seu tópico: Veja Aqui Preste mais atenção na hora de criar novos tópicos e evite futuras punições.
  12. seat é representado os acentos do veículo, faça assim: addEventHandler ("onVehicleEnter", root, function (thePlayer, seat, jacked) if (seat == 0) then -- Se o jogador estiver no acento 0 (motorista), então: outputChatBox ("Aperte M para ligar o veículo.", thePlayer, 0, 255, 0) end end)
  13. Ou, faça o local da tela de login em outra dimensão, ou, no céu bem longe.
  14. Não cara, é a segunda vez já que você upa o arquivo em um servidor, é muito mais simples usar a ferramenta do fórum. Veja aqui onde por: O código deve ser feito assim, vou te dar somente dessa vez pronto, pelo que vi você nem se quer se interessou de ler a wiki, apenas chutou e tentou acertar... Server addCommandHandler ("confiscar", function (thePlayer, cmd, nick) if not nick then -- Se nem um nick for informado no parametro nick, então: return -- Retorna end local nickPlayer = getPlayerFromPartialName (nick) if not nickPlayer then -- Se nenhum jogador for encontrado, então: return outputChatBox ("Nenhum jogador com este nick encontrado!.", thePlayer, 255, 30, 30) -- Retorna a output informando... end local nickAlvo = string.gsub (nick, "#%x%x%x%x%x%x", "") takeAllWeapons (nickPlayer) outputChatBox ("Você confiscou as armas do jogador "..nickAlvo.."!", thePlayer, 0, 255, 0) end) function getPlayerFromPartialName (name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end EDIT: Não testei, digite /debugscript 3 quando for testar...
  15. Tem, exemplo: addCommandHandler ("rights", function (thePlayer, cmd) if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup("x")) or isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup("y")) then -- Se o jogador estiver na acl x, ou y tanto faz, então: outputChatBox ("Parabéns! Você está na acl x ou na acl y.", thePlayer, 0, 255, 0) else outputChatBox ("Erro! Você não está na acl x e nem na y!", thePlayer, 255, 30, 30) end end)
  16. local sX, sY = guiGetScreenSize () -- Obtendo a resolução do jogador janelaLogin = guiCreateWindow (sX/2 - 225, sY/2 - 165, 450, 330, "Efetue o Login", false) x, y é a posição da janela. Este exemplo cria uma janela no centro da tela do jogador, independente da resolução dele.
  17. Sim, são os parâmetros do evento onPlayerLogin. thePreviousAccount : a conta na qual o jogador estava logado antes. theCurrentAccount : a conta em que o jogador fez login agora.
  18. addEventHandler ("onPlayerLogin", root, function (prevAcc, curAcc) givePlayerMoney (source, 500) outputChatBox ("Bem-vindo ao meu servidor!", source) end)
  19. Você esta usando triggerClientEvent no mesmo lado, nunca vai funcionar, fiz um upgrade no seu código: Client function TrabTaxista (_, state) if painel == true then if (state == "down") then if (isCursorOnElement (615, 224, 128, 32)) then removeEventHandler ("onClientRender", root, Dx) showCursor (false) painel = false triggerServerEvent ("trabtax", getLocalPlayer()) -- outputChatBox ("Agora é taxista", 255, 255, 255) -- triggerClientEvent ("trabtax", getLocalPlayer()) -- Erro aqui, ''triggerClientEvent''. end end end end addEventHandler ("onClientClick", root, TrabTaxista) Server function taxx () if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (client)), aclGetGroup("Taxista"))) then -- Se o jogador já estiver na acl, então: outputChatBox ("Erro! Você já está no trabalho de taxista!", client, 255, 30, 30) else -- Senão: aclGroupAddObject (aclGetGroup("Taxista"), "user."..getAccountName (getPlayerAccount (client))) -- Adiciona o jogador na acl. outputChatBox ("Parabéns! Agora você é um taxista!", client, 0, 255, 0) end end addEvent ("trabtax", true) addEventHandler ("trabtax", root, taxx)
  20. Só pra complementar a resposta do Lord: addCommandHandler ("rights", function (thePlayer, cmd) if (getAccountData (getPlayerAccount (thePlayer), "Reporter.level") == 4) then -- Se o jogador tiver a accountData Reportar.level 4, então: outputChatBox ("Eu "..getPlayerName (thePlayer).." Sou o líder do grupo reporter!", root) else outputChatBox ("Error! Tente novamente!", thePlayer, 255, 30, 30) end end) EDIT: Em relação aos comandos é bem simples, função útil: function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end Se tiver dúvidas fique a vontade em perguntar.
  21. Se for usar o código do gw8 como exemplo, não esqueça de habilitar o oop no meta.
  22. Ok, ainda acho estranho você me dizer que fez até aqui sozinho e não saber fazer uma coisa tão simples. Aqui está: Client local screenW, screenH = guiGetScreenSize () local resW, resH = 358, 380 local x, y = (screenW/resW), (screenH/resH) local markerWeapons = createMarker (x, y, z, "cylinder", 1.0, 255, 255, 255, 255) -- Coloque as coordenadas do seu marker aqui onde tem x, y, z. function Pdx () dxDrawLine (333 - 1, 194 - 1, 333 - 1, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine (691, 194 - 1, 333 - 1, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawLine (333 - 1, 574, 691, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine (691, 574, 691, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawRectangle ((screenW - 358) / 2, (screenH - 380) / 2, 358, 380, tocolor(0, 0, 0, 138), false) dxDrawImage (333, 194, 358, 380, ":GUI/images/examples/new_city_sfundo.png", 0, 0, 0, tocolor(254, 254, 254, 50), false) dxDrawImage (417, 257, 202, 160, ":GUI/images/examples/G-18.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRectangle (333, 194, 358, 53, tocolor(21, 133, 6, 111), false) dxDrawRectangle (359, 468, 310, 80, tocolor(21, 133, 6, 111), false) dxDrawText ("R$15.000", 346, 417, 681, 463, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText ("Glock-18", 338, 203, 681, 237, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText ("comprar", 372, 481, 659, 538, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) end addEventHandler ("onClientMarkerHit", markerWeapons, function (hitElement, matchingDimension) if (getElementType (hitElement) == "player") then abrir () end end) function abrir (_, state) if painel == false then showCursor (true) addEventHandler ("onClientRender", root, Pdx) painel = true else showCursor (false) removeEventHandler ("onClientRender", root, Pdx) painel = false end end addEvent ("painelglock", true) addEventHandler ("painelglock", root , abrir) --[[ -- Não entendi necessidade disso aqui, deixei comentado. function togglePanel () if getElementData (localPlayer, nomeDaACL_Comandante) then if not isEventHandlerAdded ("onClientRender", root, onClientRender) then guiGridListClear (playerList) for id, player in ipairs(getElementsByType("player")) do guiGridListSetItemText (playerList, guiGridListAddRow(playerList), 1, getPlayerName(player):gsub('#%x%x%x%x%x%x', ''), false, false) end guiSetVisible (playerList, true) guiSetVisible (edit, true) aVisible = true rVisible = true addEventHandler ("onClientRender", root, onClientRender) showCursor (true) else guiSetVisible (playerList, false) guiSetVisible (edit, false) removeEventHandler ("onClientRender", root, onClientRender) showCursor (false) end end end --]] 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 function arma (_, state) if painel == true then if state == "down" then if isCursorOnElement (372, 481, 659, 538) then triggerServerEvent ("glock", localPlayer) end end end end addEventHandler ("onClientClick", root, arma) Server function arma () giveWeapon (source, 22, 300, true) outputChatBox ("( #ff0000INFO#ffffff ) #ffff00Você comprou #00ff00Glock-18 !", source, 255, 255, 255, true) end addEvent ("glock",true) addEventHandler ("glock", root, arma) OBS: Não testado, vale lembrar que é bom sempre você indentar o código, assim fica mais fácil de você entender e o código fica mais organizado.
  23. Ele já te deu todos eventos/funções que você precisa, porque não tenta? quem sabe você consegue, não adianta você baixar esse resource aí e não saber nem como ele funciona.
  24. Nice vídeo bro thanks
×
×
  • Create New...