GetProjectileType: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 17: Line 17:
==Example==
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--TODO
function projectileCreation()
local type = getProjectileType(source);
outputChatBox("A projectile was created! Its type: "..type);
end
addEventHandler("onClientProjectileCreation", getRootElement(), projectileCreation)
</syntaxhighlight>
</syntaxhighlight>


==See also==
==See also==
{{Client projectile functions}}
{{Client projectile functions}}

Revision as of 11:48, 25 June 2009

This function returns the type of the specified projectile.

Syntax

int getProjectileType ( projectile theProjectile )

Required Arguments

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

Returns

Returns an integer over the type of the projectile or false if invalid arguments were passed.

ID Name/Description
16 Grenade
17 Tear Gas Grenade
18 Molotov
19 Rocket (simple)
20 Rocket (heat seeking)
21 Air Bomb
39 Satchel Charge
58 Hydra flare

Example

function projectileCreation()
	local type = getProjectileType(source);
	outputChatBox("A projectile was created! Its type: "..type);
end
addEventHandler("onClientProjectileCreation", getRootElement(), projectileCreation)

See also