Move entity data utils to native
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user