Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 13/03/21 in all areas

  1. 1 point
  2. Well then the "zomb" element doesn't exist. To prevent the errors you can put a check if "zomb" is an element in both the timer function and the respawnZombieInTime function and stop the execution of the function with "return". Something like this: function respawnZombieInTime ( zomb, immediatly ) if not isElement(zomb) then return end if exports.npc_hlc:isHLCEnabled ( zomb ) then exports.npc_hlc:disableHLCForNPC (zomb) end --if isElement ( getElementData ( zomb, "zombieShape" ) ) then destroyElement ( getElementData ( zomb, "zombieShape" ) ) end --if isElement ( getElementData ( zomb, "shapeFar" ) ) then destroyElement ( getElementData ( zomb, "shapeFar" ) ) end local resptimer = timeToRespawnZombie if immediatly then resptimer = 20000 end setTimer ( function ( shape, zomb ) if not isElement(zomb) then return end local attaches = getAttachedElements ( zomb,1) if attaches then for ElementKey, ElementValue in ipairs ( attaches ) do if isElement ( ElementValue ) then destroyElement ( ElementValue ) end end end destroyElement ( zomb,1) aliveZ = aliveZ - 1 -- this seems to be useless ?? if isElement ( shape ) then setElementData ( shape, "zSpawned", false ) setElementData ( shape, "zombie", false ) end end,resptimer, 1, getElementData ( zomb, "spawnShape" ), zomb ) --setElementData ( root, 'zombiesalive', getElementData ( root, 'zombiesalive' )-1 ) end
    1 point
  3. Utilize onClientKey e verifique se a tecla for uma dessas que você quer bloquear. Se for, cancele o evento com cancelEvent().
    1 point
  4. O evento que eu mencionei já possui um exemplo. Tente lê-lo e execute-o no seu servidor, também. Faça testes. O importante é sempre tentar alguma coisa, colocar a mão na massa. Se ainda assim, depois de realizar os testes, não tiver sucesso, peça o exemplo novamente. Ou, utilizando o código que você usou pra testar, mande as dúvidas.
    1 point
  5. Oh its my fault sorry! it doesn't work with vehicles i don't know if there's another event to use.
    1 point
  6. You just replace « true/false » with a table or a number or a string or anything you need.
    1 point
  7. Forest generator 1.0.0 ---------------------------------------------------------- ---------------------------------------------------------- Use /forestgen <frency> (frequency is distance between trees) ---------------------------------------------------------- Settings fg_client.lua / generatorData - Generation settings fg_server.lua / treesList - Object settings Forest exported to .map file in root directory of script ---------------------------------------------------------- Download: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14680
    1 point
×
×
  • Create New...