GetWindVelocity

From Multi Theft Auto: Wiki
Revision as of 19:32, 14 March 2011 by Arran Fortuna (talk | contribs) (Created page with "__NOTOC__ {{Server client function}} This function gets the wind velocity in San Andreas. ==Syntax== <syntaxhighlight lang="lua"> int, int, int getWindVelocity ( ) </syntaxhighlight> ===Returns=== *'''vel...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function gets the wind velocity in San Andreas.

Syntax

int, int, int getWindVelocity ( )

Returns

  • velocityX: The velocity on the x-coordinate or false if the wind velocity is default.
  • velocityY: The velocity on the y-coordinate or nil if the wind velocity is default.
  • velocityZ: The velocity on the z-coordinate or nil if the wind velocity is default.

Example

This example returns the wind velocity to a player if they use the command 'getwindvelocity'.

function commandGetWindVelocity(player, command)
   local vx, vy, vz = getWindVelocity()
   if (vx) then
       outputChatBox("Wind Velocity X:"..vx.." Y:"..vy.." Z:"..vz, player, 255, 255, 0)
   else
       outputChatBox("Wind velocity is default.", player, 255, 255, 0)
   end
end
addCommandHandler("getwindvelocity", commandGetWindVelocity)

See Also