ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getProjectileCreator

Function

getProjectileCreator

ServerProjectilesIdentical to MTA:SA

Returns the element that fired the projectile.

Syntax

element getProjectileCreator(projectile theProjectile)

Arguments

theProjectileprojectile
The projectile.

Returns

The creator, or false.

Example

addEventHandler("onProjectileCreation", root, function()
    local creator = getProjectileCreator(source)
    if creator and getElementType(creator) == "player" then
        outputDebugString(getPlayerName(creator) .. " rzucil pocisk")
    end
end)

See also