This repository has been archived by the owner on Aug 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
Entity = class(ValueStorage) | ||
|
||
function Entity:__init(entity_id) | ||
self.entity = entity_id | ||
self:InitializeEntity(self.entity) | ||
end | ||
|
||
function Entity:InitializeEntity(ent) | ||
self.entity = ent | ||
self:InitializeValueStorage(self) | ||
end | ||
|
||
function Entity:GetEntity() | ||
return self.entity | ||
end | ||
|
||
function Entity:GetEntityId() | ||
return self.entity | ||
end | ||
|
||
function Entity:Remove() | ||
DeleteEntity(self.entity) | ||
end | ||
|
||
function Entity:Exists() | ||
return DoesEntityExist(self.entity) | ||
end | ||
|
||
function Entity:GetNetworkId() | ||
return NetworkGetNetworkIdFromEntity(self.entity) | ||
end | ||
|
||
function Entity:GetNetworkOwner() | ||
return NetworkGetEntityOwner(self.entity) | ||
end | ||
|
||
function Entity:NetworkGetFirstEntityOwner() | ||
-- Get first entity owner - with fallback in case of older server version | ||
return NetworkGetFirstEntityOwner and NetworkGetFirstEntityOwner(self.entity) or NetworkGetEntityOwner(self.entity) | ||
end | ||
|
||
function Entity:GetPosition() | ||
return GetEntityCoords(self.entity) | ||
end | ||
|
||
function Entity:GetHeading() | ||
return GetEntityHeading(self.entity) | ||
end | ||
|
||
function Entity:GetHealth() | ||
return GetEntityHealth(self.entity) | ||
end | ||
|
||
function Entity:GetMaxHealth() | ||
return GetEntityMaxHealth(self.entity) | ||
end | ||
|
||
function Entity:GetModel() | ||
return GetEntityModel(self.entity) | ||
end | ||
|
||
function Entity:GetRotation() | ||
return GetEntityRotation(self.entity) | ||
end | ||
|
||
function Entity:GetRotationVelocity() | ||
return GetEntityRotationVelocity(self.entity) | ||
end | ||
|
||
function Entity:GetRoutingBucket() | ||
return GetEntityRoutingBucket(self.entity) | ||
end | ||
|
||
function Entity:SetRoutingBucket(bucket) | ||
SetEntityRoutingBucket(self.entity, bucket) | ||
end | ||
|
||
function Entity:GetType() | ||
return GetEntityType(self.entity) | ||
end | ||
|
||
function Entity:GetVelocity() | ||
return GetEntityVelocity(self.entity) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Ped = class(Entity) | ||
|
||
function Ped:__init(ped_id) | ||
self.ped_id = ped_id | ||
self:InitializeEntity(self.ped_id) | ||
end | ||
|
||
function Ped:GetPedId() | ||
return self.ped_id | ||
end | ||
|