Skip to content

Commit

Permalink
Merged branch dev into master
Browse files Browse the repository at this point in the history
  • Loading branch information
crosire committed Sep 19, 2015
2 parents debd998 + c0bfc6e commit 84241ec
Show file tree
Hide file tree
Showing 9 changed files with 3,046 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -9,7 +9,7 @@ This is an ASI plugin for Grand Theft Auto V, based on the C++ ScriptHook by Ale
## Requirements

* [C++ ScriptHook by Alexander Blade](http://www.dev-c.com/gtav/scripthookv/)
* [.NET Framework ≥ 4.5.2](https://www.microsoft.com/download/details.aspx?id=30653)
* [.NET Framework ≥ 4.5.2](https://www.microsoft.com/download/details.aspx?id=42642)
* [Visual C++ Redistributable for Visual Studio 2015](https://www.microsoft.com/download/details.aspx?id=48145)

## Downloads
Expand Down
22 changes: 22 additions & 0 deletions source/Entity.cpp
Expand Up @@ -38,6 +38,10 @@ namespace GTA
{
Native::Function::Call(Native::Hash::SET_ENTITY_COLLISION, this->Handle, value, false);
}
void Entity::HasGravity::set(bool value)
{
Native::Function::Call(Native::Hash::SET_PED_GRAVITY, this->Handle, value);
}
float Entity::Heading::get()
{
return Native::Function::Call<float>(Native::Hash::GET_ENTITY_HEADING, this->Handle);
Expand Down Expand Up @@ -212,6 +216,16 @@ namespace GTA
{
return Native::Function::Call<bool>(Native::Hash::IS_ENTITY_ON_FIRE, this->Handle);
}
bool Entity::IsOnlyDamagedByPlayer::get()
{
System::UInt64 address = Native::MemoryAccess::GetAddressOfEntity(this->Handle);

return address == 0 ? false : (*reinterpret_cast<int *>(address + 392) & (1 << 9)) != 0;
}
void Entity::IsOnlyDamagedByPlayer::set(bool value)
{
Native::Function::Call(Native::Hash::SET_ENTITY_ONLY_DAMAGED_BY_PLAYER, this->Handle, value);
}
bool Entity::IsOnScreen::get()
{
return Native::Function::Call<bool>(Native::Hash::IS_ENTITY_ON_SCREEN, this->Handle);
Expand Down Expand Up @@ -247,6 +261,14 @@ namespace GTA
{
Native::Function::Call(Native::Hash::SET_ENTITY_VISIBLE, this->Handle, value);
}
int Entity::LodDistance::get()
{
return Native::Function::Call<int>(Native::Hash::_GET_ENTITY_LOD_DIST, this->Handle);
}
void Entity::LodDistance::set(int value)
{
Native::Function::Call(Native::Hash::SET_ENTITY_LOD_DIST, this->Handle, value);
}
int Entity::MaxHealth::get()
{
return Native::Function::Call<int>(Native::Hash::GET_ENTITY_MAX_HEALTH, this->Handle) - 100;
Expand Down
14 changes: 14 additions & 0 deletions source/Entity.hpp
Expand Up @@ -40,6 +40,10 @@ namespace GTA
{
void set(bool value);
}
property bool HasGravity
{
void set(bool value);
}
property float Heading
{
float get();
Expand Down Expand Up @@ -108,6 +112,11 @@ namespace GTA
{
bool get();
}
property bool IsOnlyDamagedByPlayer
{
bool get();
void set(bool value);
}
property bool IsOnScreen
{
bool get();
Expand All @@ -130,6 +139,11 @@ namespace GTA
bool get();
void set(bool value);
}
property int LodDistance
{
int get();
void set(int value);
}
property int MaxHealth
{
int get();
Expand Down

0 comments on commit 84241ec

Please sign in to comment.