SetWindVelocity

From Multi Theft Auto: Wiki
Revision as of 20:58, 18 April 2012 by John (talk | contribs) (Cleaned up the grammar & example.)
Jump to navigation Jump to search

This function changes the wind velocity.

Syntax

bool setWindVelocity ( float velocityX, float velocityY, float velocityZ )

Required Arguments

  • velocityX: The velocity of the wind along the x axis
  • velocityY: The velocity of the wind along the y axis
  • velocityZ: The velocity of the wind along the z axis

Returns

Returns true if successful, false otherwise.

Example

This example shows how to make a simple /windVelocity command.

Click to collapse [-]
Client
local function windVelocityCommand(_, x, y, z)
	-- Ensure all arguments are valid (default to 0 otherwise)
	x = tonumber(x) or 0
	y = tonumber(y) or 0
	z = tonumber(z) or 0
	
	-- Set the wind velocity, and inform the user of the change.
	setWindVelocity(x, y, z)
	outputChatBox("* Wind velocity set to ("..x..", "..y..", "..z..").", 0, 255, 0)
end
addCommandHandler("windVelocity", windVelocityCommand)

See Also