{"slug":"graphics/explosions","category":"graphics","title":"Explosions","kind":"markdown","intro":"","body":"## EXPLOSIONS\n\n## Example\n\n```lua\n\nCitizen.CreateThread(function()\n\twhile true do\n        Citizen.Wait(0)\n        \tif Citizen.InvokeNative(0x91AEF906BCA88877,0, 0x17BEC168) then   -- pressed E\n\t\t\tlocal explosionTag_id = 12  -- EXP_TAG_BULLET\n        \t\tlocal explosion_vfxTag_hash = 0x7DD07579 \t-- applies effect exp_lightning_strike, if native ADD_EXPLOSION_WITH_USER_VFX is used\n        \t\tlocal ped = PlayerPedId()\n        \t\tlocal ped_coords = GetEntityCoords(ped)\n\t\t\tlocal x,y,z = table.unpack(ped_coords)\n\t\t\tlocal forward_fix = 15\n\t\t\tlocal forwardX=GetEntityForwardX(ped)\n    \t    \t\tlocal forwardY=GetEntityForwardY(ped)\n\t        \tlocal explosion_coords_x = x+(forwardX*forward_fix)\n\t        \tlocal explosion_coords_y = y+(forwardY*forward_fix)\n\t        \tlocal explosion_coords_z = z\n\t        \tlocal damageScale = 1.0\n\t        \tlocal isAudible = true\n\t        \tlocal isInvisible = false\n\t        \tlocal cameraShake = true\n\n\t        \t-- ADD_EXPLOSION_WITH_USER_VFX:\n\t\t\t--Citizen.InvokeNative(0x53BA259F3A67A99E, explosion_coords_x, explosion_coords_y, explosion_coords_z, explosionTag_id, explosion_vfxTag_hash, damageScale, isAudible, isInvisible, cameraShake)\n\t\t\t\n\t\t\t-- ADD_EXPLOSION:\n\t\t\tCitizen.InvokeNative(0x7D6F58F69DA92530, explosion_coords_x, explosion_coords_y, explosion_coords_z, explosionTag_id, damageScale, isAudible, isInvisible, cameraShake)\n\t\tend\n\tend\nend)\n\n```\n\n## ExplosionTag Examples","tables":[{"id":279,"name":"ExplosionTag Examples","columns":["explosiontag_id","explosiontag_name"],"rows":36}],"sourceUrl":"https://github.com/femga/rdr3_discoveries/tree/477aaaccadb7f0c042286611d9939009636cff12/graphics/explosions","rows":[{"row":0,"cells":{"explosiontag_id":"0","explosiontag_name":"EXP_TAG_GRENADE"},"note":null},{"row":1,"cells":{"explosiontag_id":"1","explosiontag_name":"EXP_TAG_STICKYBOMB"},"note":null},{"row":2,"cells":{"explosiontag_id":"2","explosiontag_name":"EXP_TAG_MOLOTOV"},"note":null},{"row":3,"cells":{"explosiontag_id":"3","explosiontag_name":"EXP_TAG_MOLOTOV_VOLATILE"},"note":null},{"row":4,"cells":{"explosiontag_id":"4","explosiontag_name":"EXP_TAG_HI_OCTANE"},"note":null},{"row":5,"cells":{"explosiontag_id":"5","explosiontag_name":"EXP_TAG_CAR"},"note":null},{"row":6,"cells":{"explosiontag_id":"6","explosiontag_name":"EXP_TAG_PLANE"},"note":null},{"row":7,"cells":{"explosiontag_id":"7","explosiontag_name":"EXP_TAG_PETROL_PUMP"},"note":null},{"row":8,"cells":{"explosiontag_id":"8","explosiontag_name":"EXP_TAG_DIR_STEAM"},"note":null},{"row":9,"cells":{"explosiontag_id":"9","explosiontag_name":"EXP_TAG_DIR_FLAME"},"note":null},{"row":10,"cells":{"explosiontag_id":"10","explosiontag_name":"EXP_TAG_DIR_WATER_HYDRANT"},"note":null},{"row":11,"cells":{"explosiontag_id":"11","explosiontag_name":"EXP_TAG_BOAT"},"note":null},{"row":12,"cells":{"explosiontag_id":"12","explosiontag_name":"EXP_TAG_BULLET"},"note":null},{"row":13,"cells":{"explosiontag_id":"13","explosiontag_name":"EXP_TAG_SMOKEGRENADE"},"note":null},{"row":14,"cells":{"explosiontag_id":"14","explosiontag_name":"EXP_TAG_BZGAS"},"note":null},{"row":15,"cells":{"explosiontag_id":"15","explosiontag_name":"EXP_TAG_GAS_CANISTER"},"note":null},{"row":16,"cells":{"explosiontag_id":"16","explosiontag_name":"EXP_TAG_EXTINGUISHER"},"note":null},{"row":17,"cells":{"explosiontag_id":"17","explosiontag_name":"EXP_TAG_TRAIN"},"note":null},{"row":18,"cells":{"explosiontag_id":"18","explosiontag_name":"EXP_TAG_DIR_FLAME_EXPLODE"},"note":null},{"row":19,"cells":{"explosiontag_id":"19","explosiontag_name":"EXP_TAG_VEHICLE_BULLET"},"note":null},{"row":20,"cells":{"explosiontag_id":"20","explosiontag_name":"EXP_TAG_BIRD_CRAP"},"note":null},{"row":21,"cells":{"explosiontag_id":"21","explosiontag_name":"EXP_TAG_FIREWORK"},"note":null},{"row":22,"cells":{"explosiontag_id":"22","explosiontag_name":"EXP_TAG_TORPEDO"},"note":null},{"row":23,"cells":{"explosiontag_id":"23","explosiontag_name":"EXP_TAG_TORPEDO_UNDERWATER"},"note":null},{"row":24,"cells":{"explosiontag_id":"24","explosiontag_name":"EXP_TAG_LANTERN"},"note":null},{"row":25,"cells":{"explosiontag_id":"25","explosiontag_name":"EXP_TAG_DYNAMITE"},"note":null},{"row":26,"cells":{"explosiontag_id":"26","explosiontag_name":"EXP_TAG_DYNAMITESTACK"},"note":null},{"row":27,"cells":{"explosiontag_id":"27","explosiontag_name":"EXP_TAG_DYNAMITE_VOLATILE"},"note":null},{"row":28,"cells":{"explosiontag_id":"28","explosiontag_name":"EXP_TAG_RIVER_BLAST"},"note":null},{"row":29,"cells":{"explosiontag_id":"29","explosiontag_name":"EXP_TAG_PLACED_DYNAMITE"},"note":null},{"row":30,"cells":{"explosiontag_id":"30","explosiontag_name":"EXP_TAG_FIRE_ARROW"},"note":null},{"row":31,"cells":{"explosiontag_id":"31","explosiontag_name":"EXP_TAG_DYNAMITE_ARROW"},"note":null},{"row":32,"cells":{"explosiontag_id":"32","explosiontag_name":"EXP_TAG_PHOSPHOROUS_BULLET"},"note":null},{"row":33,"cells":{"explosiontag_id":"33","explosiontag_name":"EXP_TAG_LIGHTNING_STRIKE"},"note":null},{"row":34,"cells":{"explosiontag_id":"34","explosiontag_name":"EXP_TAG_TRACKING_ARROW"},"note":null},{"row":35,"cells":{"explosiontag_id":"35","explosiontag_name":"EXP_TAG_POISON_BOTTLE"},"note":null}],"table":279}