IT/getProjectileCreator

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
« Torna alla Pagina principale italiana .


Questa funzione restituisce il creatore di uno specifico proiettile.

Sintassi

element getProjectileCreator ( projectile theProjectile )

Argomenti richiesti

  • theProjectile: L'elemento proiettile del creatore che si vuole recuperare.

Valori restituiti

Restituisce l'elemento che ha creato il proiettile in caso di successo, altrimenti restituisce false .

Esempio

Click to collapse [-]
Client

This example will output a message in the chatbox saying who created the projectile.

addEventHandler("onClientProjectileCreation", root, function(projectile)
    local creator = getProjectileCreator(projectile)
    if (getElementType(creator) == "player") then
        local pName = getPlayerName(creator)
	local projectileID = getProjectileType(projectile)
        outputChatBox(pName.." created a projectile! (ID: "..projectileID..")", 255, 200, 0, false)
    end
end)

Vedere anche