GetProjectileCreator

From Multi Theft Auto: Wiki
Revision as of 01:20, 17 November 2011 by Jaysds1 (talk | contribs)
Jump to navigation Jump to search

This function returns the creator of the specified projectile.

Syntax

element getProjectileCreator ( projectile theProjectile )

Required Arguments

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

Returns

Returns the element which created the projectile if successful, false otherwise.

Example

This example tells the player who's the projectile creator that killed them.

function killed(killer,weapon,bodypart)
   if (weapon == 16 or 17 or 18 or 39) then
       outputChatBox("Who killed you: "getProjectileCreator(weapon)".",100,0,0)
   end
end
addEventHandler("onClientPedWasted",getRootElement(),killed)

See also