CreateExplosion: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 43: | Line 43: | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
*[[CreateExplosion]] | |||
*[[CreateFireworks]] |
Revision as of 19:45, 18 November 2019
Description
Creates an explosion at the specified coordinates.
Syntax
CreateExplosion(explosionid, x, y, z [, dimension, soundExplosion, camShakeRadius, radialForce])
Parameters
- explosionid
The explosion identifier. - x
The X axis - y
The Y axis - z
The Z axis - dimension
The dimension identifier - soundExplosion
The sound of explosion - camShakeRadius
The camera shake radius - radialForce (optional)
The radial force of the explosion
Return Value
- __EDIT_ME__
Example
function cmd_burn(player, otherplayer)
if (PlayerData[player].admin < 2) then
return AddPlayerChat(player, "Insufficient permission")
end
if (otherplayer == nil) then
return AddPlayerChat(player, "Usage: /burn <player>")
end
otherplayer = tonumber(otherplayer)
if (not IsValidPlayer(otherplayer)) then
return AddPlayerChat(player, "Selected player does not exist")
end
local x, y, z = GetPlayerLocation(otherplayer)
CreateExplosion(9, x + 200.0, y + 8.0, z + 3.0, true, 1500.0, 1000000.0)
AddPlayerChat(player, "You have burnt "..GetPlayerName(otherplayer).."("..otherplayer..")")
end
AddCommand("burn", cmd_burn)