natives.ADD_EXPLOSION

From GTA Connected
Revision as of 15:15, 26 November 2025 by ChrisGame20 (talk | contribs) (Created page with "{{ScriptItem |endpoint = client |games = vc |type = function |name = natives.ADD_EXPLOSION |parameters = Vec3 position, int type |parameter1 = Vec3 position World coordinates where the explosion occurs (x, y, z) |parameter2 = int type Explosion type (0–11) |usage = Create an explosion at a specific world position in Vice City |notes = Explosion type determines the visual and physical effect. Use carefully as explosions affect gameplay and nearby entities. |return1 = vo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Client Only icon-vc.png Online and Offline

Available since Client 1.0.0

void natives.ADD_EXPLOSION(Vec3 position, int type)

The natives.ADD_EXPLOSION function is used to Create an explosion at a specific world position in Vice City.

Parameters

1) Vec3 position World coordinates where the explosion occurs (x, y, z).
2) int type Explosion type (0–11).

Return

void This function doesn't return a value.

Notes

  • Explosion type determines the visual and physical effect. Use carefully as explosions affect gameplay and nearby entities.

Examples

Example 1 - JavaScript:

addCommandHandler("exp", function(cmd, args) {

   let type = 0;
   if (args && args.length > 0) {
       let n = parseInt(args[0]);
       if (!isNaN(n)) {
           type = n;
       }
   }
   if (type < 0) type = 0;
   if (type > 11) type = 11;
   natives.ADD_EXPLOSION(new Vec3(-592.0, 670.0, 11.0), type);
   message("Explosion " + type + " at -592.0, 670.0, 11.0");

});

Compatibility

There isn't any compatibility information for this function.