Jump to content

Lord Henry

Other Languages Moderators
  • Posts

    3,992
  • Joined

  • Last visited

  • Days Won

    183

Everything posted by Lord Henry

  1. if (getAccountData (acc, "Reporter.level") == 4) then
  2. Tópico movido para a seção Ajudas relacionadas ao MTA:SA (Cliente/Servidor). @Pedro mayeer veja as regras do fórum aqui:
  3. Tópico movido para a seção de Programação em Lua. @serjaoberranteiro veja as regras do fórum aqui:
  4. Troque seu onPlayerSpawn pra onPlayerLogin para fazer o jogador aparecer na base ao logar. Use onPlayerSpawn para fazer ele ir pro hospital ao spawnar.
  5. source não existe dentro de um setTimer. Ou você salva ele em outra variável ou então você passa ele por parâmetro de função do setTimer. Está faltando o resto do código. Mas vou supor que esse setTimer esteja dentro de outra função onde o source exista. Se não estiver dentro de outra função com source, então seu código nunca vai funcionar e não faz sentido nenhum. function Assaltar (theSource) weapon = getPedWeaponSlot (theSource) mira = getPlayerTarget (theSource) if (isElementWithinMarker (theSource, mAssaltar)) then if (weapon == 0) then return Assaltar end if not (getControlState (theSource, "aim_weapon")) then return Assaltar end if not (getElementData (theSource, "LojaSendoAssaltada")) then if (mira) then if ((mira) == pedLojista) then setElementData (theSource, "LojaSendoAssaltada", true) triggerClientEvent (theSource, "Som", theSource) triggerClientEvent (root, "notifiAssal", root) setPedAnimation (pedLojista, "shop", "SHP_Rob_HandsUp", 30000, true, true, true) setElementFrozen (theSource, true) toggleAllControls (theSource, false) setPedAnimation (theSource, "shop", "shp_gun_aim", 30000, true, true, true) setElementVisibleTo (assalto1PG, root, true) setTimer (function (otherSource) setElementFrozen (otherSource, false) toggleAllControls (otherSource, true) givePlayerMoney (otherSource, 4000) setPedAnimation (otherSource, 0) outputChatBox ("Você terminou o assalto e ganhou #ffff00R$4000", otherSource, 114, 114, 114, true) end, 30000, 1, theSource) setTimer (function (otherSource) setElementData (otherSource, "LojaSendoAssaltada", false) setElementVisibleTo (assalto1PG, root, false) end, 60000, 1, theSource) end end end end end setTimer (Assaltar, 1, 0, source)
  6. Eu faria com setAccountData. Salvando tipo assim: setAccountData (acc, "Reporter.level", 4) -- Líder setAccountData (acc, "Reporter.level", 3) -- Sub-Líder setAccountData (acc, "Reporter.level", 2) -- Repórter setAccountData (acc, "Reporter.level", 1) -- Temporário E depois quando o cara logar, verificar essa data com getAccountData. Dependendo do número salvo na conta, ele vai ter determinado acesso aos comandos.
  7. É a administração do fórum que faz isso. Caso julguem necessário.
  8. Solicite a remoção da outra conta, ou então para juntar o conteúdo daquela nesta conta.
  9. Não faz sentido você verificar com valores diferentes dos valores usados pra criar o DX.
  10. Essa sua função getPlayerFromID está errada. Não tem nada a ver com ID dos jogadores, apenas com o índice daquele loop. Dai é óbvio que não vai retornar o mesmo ID pro mesmo jogador. function getPlayerFromID (theID) if (tonumber (theID)) then theID = tonumber (theID) local players = getElementsByType ("player") for id, p in ipairs (players) do local accID = getAccountID (getPlayerAccount (p)) if (theID == accID) then return p end end return false else return false end end
  11. Sem código fica difícil adivinhar. Mas já vou logo adiantando que vc usa o getAccountID.
  12. Não se esqueça de deixar um Thanks nas respostas que lhe ajudaram.
  13. Não se esqueça do Thanks nas respostas que lhe ajudaram.
  14. Só pegar as coordenadas que vc usou pra criar o botão. No caso os parâmetros do DxDrawRectangle.
  15. Ele está procurando isso na linha 9. local rand = math.random(1, 5) Mas não prestei atenção se foi removido de propósito.
  16. @NeoGM você está usando a o botão de page do fórum de maneira equivocada. Tome mais cuidado.
  17. Já tentou com onResourceStop?
  18. Não seria melhor ter feito tudo junto? SpawnM = createMarker (-2396.8295898438, -617.03546142578, 131.75123596191, "cylinder", 1.5, 255, 255, 255, 50) function msg (player) if (player) and (getElementType (player) == "player") then outputChatBox ("Você foi congelado até iniciar o Round!!", player, 255, 255, 255) setElementFrozen (player, true) end end addEventHandler ("onMarkerHit", SpawnM, msg)
  19. @+MarceloM. favor não exagerar no uso de negrito. Use no bom senso.
  20. source não é o jogador no evento onResourceStart. Preste atenção na Wiki. local vZones = { {x = 190, y = -489, z = 980, width = 65, depth = 60, height = 1}, } local z = {} function initvZones() if vZones and #vZones ~= 0 then for _,v in ipairs (vZones) do if v then if v.x and v.y and v.z and v.width and v.depth and v.height then local c = createColCuboid (v.x, v.y, v.z, v.width, v.depth, v.height) if c then z[c] = true for _,thePlayer in ipairs (getElementsByType("player")) do if (getElementDimension (thePlayer) == 100) then -- Tentativa de verdade. if isElementWithinColShape (thePlayer, c) then killPed (thePlayer) end end addEventHandler ("onElementDestroy", c, function() -- Não recomendo fazer isso dentro de loops. if z[source] then z[source] = nil end end) addEventHandler ("onColShapeHit", c, function (h, d) -- Prefira usar nomes fáceis de identificar em vez de letras. if h and isElement(h) and getElementType (h) == "player" then killPed (h) end end) end end end end end end end addEventHandler ("onResourceStart", resourceRoot, initvZones)
  21. Não. Pois se fizer isso não será mais possível falar no chat normal também. Quando vc aperta T e escreve alguma mensagem, vc está internamente usando o comando /say Se você está querendo evitar Spam, só usar um setTimer. Quando o jogador enviar uma mensagem, verifica se existe esse timer, se existir, cancela o envio da mensagem com cancelEvent no evento onPlayerChat. Se não tiver o timer, manda a mensagem normalmente e cria o timer.
  22. Mostre seu acl.xml então. Ele está na pasta deathmatch.
  23. Você sabe criar botões DX, certo? Então qual a dificuldade de criar um botão pequeno com um X? Dai quando clicar nesse botão, vc cancela a renderização do painel com: removeEventHandler ("onClientRender", root, renderPanel)
  24. Dê acesso admin para o resource.
×
×
  • Create New...