CreateFire: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 22: Line 22:


<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function burn(player, commandName, height)
function burn(commandName, theSize)
   if height then
  local thePlayer = getLocalPlayer()
         x, y, z = getPlayerPosition(player)
   if theSize then
         createFire(x, y, z, height)
         local x, y, z = getElementPosition(thePlayer)
         outputChatBox("Burn motherfucker, buuuuurn >:]", player)
         createFire(x, y, z, theSize)
         outputChatBox("Burn, buuuuurn >:]", thePlayer)
   else
   else
         outputChatBox("Syntax: /fire <height>", player)
         outputChatBox("Syntax: /fire <size>", thePlayer)
   end
   end
end
end

Revision as of 21:11, 3 May 2010

Creates a patch of fire that will spread a bit and die out after a while.

Syntax

bool createFire ( float x, float y, float z [, float size = 1.8 ] )

Required Arguments

  • x, y, z: coordinates of the fire.

Optional Arguments

  • size: the size of the initial fire.

Returns

Returns true if successful, false otherwise. There can be a maximum of 60 active fires.

Example

Click to collapse [-]
Client

Command for creating Clientside Fire on the Players Position.

function burn(commandName, theSize)
   local thePlayer = getLocalPlayer()
   if theSize then
        local x, y, z = getElementPosition(thePlayer)
        createFire(x, y, z, theSize)
        outputChatBox("Burn, buuuuurn >:]", thePlayer)
   else
        outputChatBox("Syntax: /fire <size>", thePlayer)
   end
end
addCommandHandler("fire", burn)

See Also