ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setProjectileCounter

Function

setProjectileCounter

ServerProjectilesIdentical to MTA:SA

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