FxAddWaterHydrant: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ {{Client function}} This function creates a water hydrant particle effect. ==Syntax== <syntaxhighlight lang="lua"> bool fxAddWaterHydrant ( float posX, float posY, float posZ ) </syntaxhighlight> ===R...)
 
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}  
{{Client function}}
[[Image:Fxwaterhydrant.png|thumb|200px|Water hydrant]]
This function creates a water hydrant particle effect.
This function creates a water hydrant particle effect.


Line 7: Line 8:
bool fxAddWaterHydrant ( float posX, float posY, float posZ )
bool fxAddWaterHydrant ( float posX, float posY, float posZ )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||[[Effect]].addWaterHydrant}}


===Required Arguments===  
===Required Arguments===  
* '''posX:''' A float representing the '''x''' position of the hydrant  
* '''posX:''' A float representing the '''x''' position of the hydrant  
* '''posY:''' A float representing the '''y''' position of the hydrant  
* '''posY:''' A float representing the '''y''' position of the hydrant  
* '''posZ:''' A float representing the '''z''' position of the hydrant  
* '''posZ:''' A float representing the '''z''' position of the hydrant


===Returns===
===Returns===
Line 17: Line 19:


==Example==
==Example==
This page lacks an example
This example will create 20 water hydrant effects around the players position when they use the command: hydrantmania.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--add an example here
function createHydrants()
local x, y, z = getElementPosition(localPlayer) -- Get your location.
for i=0, 20 do -- 20 Hydrants.
fxAddWaterHydrant(x + math.random(-5,5), y + math.random(-5,5), z) -- Using math.random, and your current location 20 water hydrants are created.
end
end
addCommandHandler("hydrantmania", createHydrants)
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Client Effects functions}}
{{Client Effects functions}}
[[Category:Needs_Example]]

Latest revision as of 12:49, 18 August 2015

Water hydrant

This function creates a water hydrant particle effect.

Syntax

bool fxAddWaterHydrant ( float posX, float posY, float posZ )

OOP Syntax Help! I don't understand this!

Method: Effect.addWaterHydrant(...)


Required Arguments

  • posX: A float representing the x position of the hydrant
  • posY: A float representing the y position of the hydrant
  • posZ: A float representing the z position of the hydrant

Returns

Returns a true if the operation was successful, false otherwise.

Example

This example will create 20 water hydrant effects around the players position when they use the command: hydrantmania.

function createHydrants()
	local x, y, z = getElementPosition(localPlayer) -- Get your location.
	for i=0, 20 do -- 20 Hydrants.
		fxAddWaterHydrant(x + math.random(-5,5), y + math.random(-5,5), z) -- Using math.random, and your current location 20 water hydrants are created.
	end
end
addCommandHandler("hydrantmania", createHydrants)

See Also