GetProjectileForce: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Client function}}
{{Client function}}
{{Needs_Example}}
This function returns the force of the specified projectile.
This function returns the force of the specified projectile.


Line 23: Line 22:
--The source of this event is the projectile that was created.
--The source of this event is the projectile that was created.
function ()
function ()
local getForce = getProjectileForce(source)
    local getForce = getProjectileForce(source)
outputChatBox(getForce*100) -- outputs the force of the projectile on 1-100 scale
    outputChatBox(getForce*100) -- outputs the force of the projectile on 1-100 scale
end
end
)
)

Revision as of 10:36, 18 January 2014

This function returns the force of the specified projectile.

Syntax

float getProjectileForce ( projectile theProjectile )

Required Arguments

  • theProjectile: The projectile element which force you want to retrieve.

Returns

Returns a float if successful, false otherwise.

Example

Click to collapse [-]
Client script

Example 1: This example would outputs the force of the projectile on 1-100 scale. This function just works with projectiles which you throw so just grenades, satchel charge etc


addEventHandler("onClientProjectileCreation", getRootElement(),
--The source of this event is the projectile that was created.
function ()
    local getForce = getProjectileForce(source)
    outputChatBox(getForce*100) -- outputs the force of the projectile on 1-100 scale
end
)

See also