Move entity data utils to native

This commit is contained in:
Vortrex
2022-04-16 21:43:16 -05:00
parent dd2adbf02a
commit 3eadb37b3b

View File

@@ -1140,4 +1140,30 @@ function getPlayerPed(client) {
}
}
// ===========================================================================
function setEntityData(entity, dataName, dataValue, syncToClients = true) {
if(entity != null) {
return entity.setData(dataName, dataValue, syncToClients);
}
}
// ===========================================================================
function removeEntityData(entity, dataName) {
if(entity != null) {
return entity.removeData(dataName);
}
return null;
}
// ===========================================================================
function doesEntityDataExist(entity, dataName) {
if(entity != null) {
return (entity.getData(dataName) != null);
}
return null;
}
// ===========================================================================