removeElementData | Multi Theft Auto: Wiki Skip to content

removeElementData

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function removes the element data with the given key for that element. The element data removal is synced with all the clients.

Note

If you want to remove the data in client side you can use 'setElementData(element, key, nil)'.

Syntax

removeElementData ( )

Code Examples

server

This will set element data for player which spawned, and then remove it on death.

function onPlayerSpawn()
setElementData(source, "playerSpawned", true)
end
addEventHandler("onPlayerSpawn", root, onPlayerSpawn)
function onPlayerWasted()
removeElementData(source, "playerSpawned")
end
addEventHandler("onPlayerWasted", root, onPlayerWasted)

See Also

Element Functions