IT/getProjectileForce: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(4 intermediate revisions by 4 users not shown) | |||
Line 15: | Line 15: | ||
Restituisce un [[IT/Float|float]] in caso di successo, altrimenti restituisce ''false''. | Restituisce un [[IT/Float|float]] in caso di successo, altrimenti restituisce ''false''. | ||
== | ==Esempio== | ||
'''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 | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | |||
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 | |||
) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== | ==Vedere anche== | ||
{{IT/Client projectile functions}} | {{IT/Client projectile functions}} | ||
[[ | [[en:getProjectileForce]] |
Latest revision as of 18:55, 18 January 2014
« Torna alla Pagina principale italiana ▇▇▇.
Questa funzione restituisce la forza del proiettile specificato.
Sintassi
float getProjectileForce ( projectile theProjectile )
Required Arguments
- theProjectile: L'elemento proiettile la quale forza si vuole recuperare.
Valori restituiti
Restituisce un float in caso di successo, altrimenti restituisce false.
Esempio
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 )