Jump to content

czarsight

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by czarsight

  1. Eu confundi. Não é nativa, eu a usava com a lib sys = sys.sleep(ms).
  2. Você deve ter esquecido de ligar o recurso que exporta essa função: "exports.pool:getPoolElementsByType"
  3. Fiz uma gambiarra para obter a função nativa sleep() da Lua. Acham que terei problemas futuros? function timer(ms) function timerunning() outputChatBox("Passaram se " ..ms.. " ms") end setTimer(timerunning, ms, 1) end addCommandHandler("sleep", function(player, cmd, ms) timer(ms) end)
  4. function getPedWeapons(ped) local playerWeapons = {} if ped and isElement(ped) and getElementType(ped) == "ped" or getElementType(ped) == "player" then for i=2,9 do local wep = getPedWeapon(ped,i) if wep and wep ~= 0 then table.insert(playerWeapons,wep) end end else return false end return playerWeapons end function SaberArmas (player) qtdArmas = 0 for i,wep in ipairs(getPedWeapons(player)) do qtdArmas = i end if qtdArmas > 0 then outputChatBox("Você tem: " ..qtdArmas.. " armas") else outputChatBox("Você não tem nenhum armamento!") end end addEventHandler("onMarkerHit", MarkerInfo, SaberArmas) Tente isso, meu jovem.
×
×
  • Create New...