-
Posts
3,992 -
Joined
-
Last visited
-
Days Won
183
Everything posted by Lord Henry
-
if (getAccountData (acc, "Reporter.level") == 4) then
-
poderiam me ajudar a fazer dois scripts
Lord Henry replied to serjaoberranteiro's topic in Programação em Lua
Tópico movido para a seção de Programação em Lua. @serjaoberranteiro veja as regras do fórum aqui: -
Troque seu onPlayerSpawn pra onPlayerLogin para fazer o jogador aparecer na base ao logar. Use onPlayerSpawn para fazer ele ir pro hospital ao spawnar.
-
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)
-
Como fasso pra editar o local após o Player fazer o Longin ?
Lord Henry replied to NeoGM's topic in Programação em Lua
Mostre o script do hospital. -
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.
-
como fazer para o painel dx abrir no marker ?
Lord Henry replied to MatheusWW's topic in Programação em Lua
É a administração do fórum que faz isso. Caso julguem necessário. -
como fazer para o painel dx abrir no marker ?
Lord Henry replied to MatheusWW's topic in Programação em Lua
Solicite a remoção da outra conta, ou então para juntar o conteúdo daquela nesta conta. -
Não faz sentido você verificar com valores diferentes dos valores usados pra criar o DX.
-
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
-
Sem código fica difícil adivinhar. Mas já vou logo adiantando que vc usa o getAccountID.
-
Não se esqueça de deixar um Thanks nas respostas que lhe ajudaram.
-
Não se esqueça do Thanks nas respostas que lhe ajudaram.
-
Só pegar as coordenadas que vc usou pra criar o botão. No caso os parâmetros do DxDrawRectangle.
-
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.
-
Como desvincula o emprego de mecânico da agência?
Lord Henry replied to NeoGM's topic in Programação em Lua
@NeoGM você está usando a o botão de page do fórum de maneira equivocada. Tome mais cuidado. -
Já tentou com onResourceStop?
-
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)
-
@+MarceloM. favor não exagerar no uso de negrito. Use no bom senso.
-
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)
-
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.
-
Mostre seu acl.xml então. Ele está na pasta deathmatch.
-
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)
-
Dê acesso admin para o resource.