CreateFireworks

From Onset Developer Wiki
Revision as of 19:24, 19 December 2019 by Justus (talk | contribs) (Added a create firework command example)
CreateFireworks

Type: Function
Context: Client
Introduced: v1.0

Description

__EDIT_ME__

Syntax

CreateFireworks(modelid, x, y, z, rx, ry, rz)

Parameters

  • modelid
    Id for fireworks preset (1-13).
  • x
    World X location.
  • y
    World Y location.
  • z
    World Z location.
  • rx
    Pitch rotation. Should be 90.0 to have the fireworks shoot up.
  • ry
    Yaw rotation.
  • rz
    Roll rotation.

Return Value

  • Returns true on success.

Example

Client:

function ClientCreateFireworks(type)
	local x, y, z = GetPlayerLocation()
	CreateFireworks(type, x, y, z + 150, 90, 0, 0)
end
AddRemoteEvent("ClientCreateFireworks", ClientCreateFireworks)

Server:

function cmd_fireworks(player, type)
	if (type == nil) then
		return AddPlayerChat(player, "Usage: /fireworks <type 1-13>")
	end
	
	type = tonumber(type)

	if (type < 0 or type > 13) then
		return AddPlayerChat(player, "Parameter \"type\" 1-13")
	end

	CallRemoteEvent(player, "ClientCreateFireworks", type)
	AddPlayerChat(player, "Fireworks created!")
end
AddCommand("fireworks", cmd_fireworks)

See also