LuaAPI.wiki
changeset 48 3c5d26c1562a
parent 47 adf440f87f1e
child 49 863995d12a27
equal deleted inserted replaced
47:adf440f87f1e 48:3c5d26c1562a
   247     !SetAmmo(amGrenade, 0, 0, 0, 3) -- crates should contain always three grenade</code>
   247     !SetAmmo(amGrenade, 0, 0, 0, 3) -- crates should contain always three grenade</code>
   248 === <tt>!SetHealth(gearUid, health)</tt> ===
   248 === <tt>!SetHealth(gearUid, health)</tt> ===
   249 
   249 
   250 <blockquote>Sets the health of the specified gear.
   250 <blockquote>Sets the health of the specified gear.
   251 </blockquote>
   251 </blockquote>
   252 === <tt>!SetEffect(gearUid, effect, true/false)</tt> (0.9.14) ===
   252 === <tt>!SetEffect(gearUid, effect, true/false)</tt> (0.9.14 / dev) ===
   253 
   253 
   254 <blockquote>Enables (true) or disables (false) one of the effects <tt>heInvulnerable, heResurrectable, hePoisoned</tt> for the specified hedgehog gear.
   254 <blockquote>Enables (true) or disables (false) one of the effects <tt>heInvulnerable, heResurrectable, hePoisoned</tt> for the specified hedgehog gear.
   255 </blockquote>
   255 </blockquote>
   256 Example: (sets all bots poisoned)
   256 Example: (sets all bots poisoned)
   257 
   257 
   258 <code lang="lua">    function onGearAdd(gear)
   258 <code lang="lua">    function onGearAdd(gear)
   259         if (!GetGearType(gear) === gtHedgehog) and (!GetBotLevel(gear) > 0) then
   259         if (!GetGearType(gear) == gtHedgehog) and (!GetBotLevel(gear) > 0) then
   260             !SetEffect(gear, hePoisoned, true)
   260             !SetEffect(gear, hePoisoned, true)
   261         end
   261         end
   262     end</code>
   262     end</code>
       
   263 Notice: In 0.9.14 this function takes 0 or 1 instead of true/false.
   263 === <tt>CopyPV(gearUid, gearUid)</tt> ===
   264 === <tt>CopyPV(gearUid, gearUid)</tt> ===
   264 
   265 
   265 <blockquote>This sets the position and velocity of the second gear to the first one.
   266 <blockquote>This sets the position and velocity of the second gear to the first one.
   266 </blockquote>
   267 </blockquote>
   267 === <tt>CopyPV2(gearUid, gearUid)</tt> ===
   268 === <tt>CopyPV2(gearUid, gearUid)</tt> ===