- Documentation
- Server functions
- setProjectileCounter
Function
setProjectileCounter
Sets the projectile's time to explosion in ms. When it runs out, an explosion matching the projectile type happens at its position and the projectile disappears.
Syntax
bool setProjectileCounter(projectile theProjectile, int timeToDetonate)Arguments
theProjectileprojectile- The projectile.
timeToDetonateint- Time in ms (at least 50; 0 = no explosion).
Returns
true on success.
Example
addCommandHandler("bomba", function(player)
local x, y, z = getElementPosition(player)
setProjectileCounter(createProjectile(player, 39, x, y, z), 5000)
end)
See also
getProjectileCounterReturns the projectile counter in ms (time to explosion set withsetProjectileCounter; 0 = none).createProjectileCreates a projectile element on the server (grenade, rocket, Molotov, satchel charge, etc.) with a creator, type, force and target. FiresonProjectileCreation. The type is a weapon ID, e.g. 16 grenade, 17 tear gas, 18 Molotov, 19 rocket, 20 heat-seeking rocket, 39 satchel.