mirror of
https://github.com/ChronosX88/mta-mono.git
synced 2024-11-22 10:12:20 +00:00
Lua Ped functions (CLuaFunctionDefinitions)
This commit is contained in:
parent
fd6af7b1e2
commit
feeff01fe1
@ -1804,6 +1804,756 @@ bool CLuaFunctionDefinitions::TakePlayerScreenShot( lua_State* pLuaVM, void* pUs
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ped get functions
|
||||
void* CLuaFunctionDefinitions::CreatePed( lua_State* pLuaVM, int iModelid, float fX, float fY, float fZ, float fRot, bool bSynced )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushNumber( iModelid );
|
||||
pLuaArguments.PushNumber( fX );
|
||||
pLuaArguments.PushNumber( fY );
|
||||
pLuaArguments.PushNumber( fZ );
|
||||
pLuaArguments.PushNumber( fRot );
|
||||
pLuaArguments.PushBoolean( bSynced );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "createPed", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetLightUserData();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
float CLuaFunctionDefinitions::GetPedArmor( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedArmor", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return static_cast< float >( pLuaArgument.GetNumber() );
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::IsPedChoking( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "isPedChoking", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::IsPedDead( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "isPedDead", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::IsPedDucked( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "isPedDucked", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
float CLuaFunctionDefinitions::GetPedStat( lua_State* pLuaVM, void* pUserData, int iStat )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( iStat );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedStat", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return static_cast< float >( pLuaArgument.GetNumber() );
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void* CLuaFunctionDefinitions::GetPedTarget( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedTarget", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetLightUserData();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int CLuaFunctionDefinitions::GetPedWeapon( lua_State* pLuaVM, void* pUserData, int iWeaponSlot )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( iWeaponSlot );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedWeapon", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return static_cast< int >( pLuaArgument.GetNumber() );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::GetPedClothes( lua_State* pLuaVM, void* pUserData, unsigned char ucType, string& strOutTexture, string& strOutModel )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( ucType );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedClothes", 2 ) )
|
||||
{
|
||||
strOutTexture = string( ( new CLuaArgument( pLuaVM, -2 ) )->GetString() );
|
||||
strOutModel = string( ( new CLuaArgument( pLuaVM, -1 ) )->GetString() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::DoesPedHaveJetPack( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "doesPedHaveJetPack", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::IsPedOnGround( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "isPedOnGround", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int CLuaFunctionDefinitions::GetPedFightingStyle( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedFightingStyle", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return static_cast< int >( pLuaArgument.GetNumber() );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CLuaFunctionDefinitions::GetPedMoveAnim( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedMoveAnim", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return static_cast< int >( pLuaArgument.GetNumber() );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
float CLuaFunctionDefinitions::GetPedGravity( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedGravity", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return static_cast< float >( pLuaArgument.GetNumber() );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void* CLuaFunctionDefinitions::GetPedContactElement( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedContactElement", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetLightUserData();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int CLuaFunctionDefinitions::GetPedWeaponSlot( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedWeaponSlot", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return static_cast< int >( pLuaArgument.GetNumber() );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::IsPedDoingGangDriveby( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "isPedDoingGangDriveby", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::IsPedOnFire( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "isPedOnFire", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::IsPedHeadless( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "isPedHeadless", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::IsPedFrozen( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "isPedFrozen", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void* CLuaFunctionDefinitions::GetPedOccupiedVehicle( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedOccupiedVehicle", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetLightUserData();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int CLuaFunctionDefinitions::GetPedOccupiedVehicleSeat( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getPedOccupiedVehicleSeat", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return static_cast< int >( pLuaArgument.GetNumber() );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::IsPedInVehicle( lua_State* pLuaVM, void* pUserData, void* pPed )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushUserData( pPed );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "isPedInVehicle", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ped set functions
|
||||
bool CLuaFunctionDefinitions::SetPedArmor( lua_State* pLuaVM, void* pUserData, float fArmor )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( fArmor );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedArmor", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::KillPed( lua_State* pLuaVM, void* pUserData, void* pKiller, unsigned char ucKillerWeapon, unsigned char ucBodyPart, bool bStealth )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushUserData( pKiller );
|
||||
pLuaArguments.PushNumber( ucKillerWeapon );
|
||||
pLuaArguments.PushNumber( ucBodyPart );
|
||||
pLuaArguments.PushBoolean( bStealth );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "killPed", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedStat( lua_State* pLuaVM, void* pUserData, unsigned short usStat, float fValue )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( usStat );
|
||||
pLuaArguments.PushNumber( fValue );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedStat", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::AddPedClothes( lua_State* pLuaVM, void* pUserData, const char* szTexture, const char* szModel, unsigned char ucType )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushString( szTexture );
|
||||
pLuaArguments.PushString( szModel );
|
||||
pLuaArguments.PushNumber( ucType );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "addPedClothes", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::RemovePedClothes( lua_State* pLuaVM, void* pUserData, unsigned char ucType, const char* szTexture, const char* szModel )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( ucType );
|
||||
pLuaArguments.PushString( szTexture );
|
||||
pLuaArguments.PushString( szModel );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "removePedClothes", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::GivePedJetPack( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "givePedJetPack", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::RemovePedJetPack( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "removePedJetPack", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedFightingStyle( lua_State* pLuaVM, void* pUserData, unsigned char ucStyle )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( ucStyle );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedFightingStyle", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedMoveAnim( lua_State* pLuaVM, void* pUserData, unsigned int iMoveAnim )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( iMoveAnim );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedMoveAnim", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedGravity( lua_State* pLuaVM, void* pUserData, float fGravity )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( fGravity );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedGravity", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedChoking( lua_State* pLuaVM, void* pUserData, bool bChoking )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushBoolean( bChoking );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedChoking", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedWeaponSlot( lua_State* pLuaVM, void* pUserData, unsigned char ucWeaponSlot )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( ucWeaponSlot );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedWeaponSlot", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::WarpPedIntoVehicle( lua_State* pLuaVM, void* pUserData, void* pVehicle, unsigned int uiSeat )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushUserData( pVehicle );
|
||||
pLuaArguments.PushNumber( uiSeat );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "warpPedIntoVehicle", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::RemovePedFromVehicle( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "removePedFromVehicle", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedDoingGangDriveby( lua_State* pLuaVM, void* pUserData, bool bGangDriveby )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushBoolean( bGangDriveby );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedDoingGangDriveby", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedAnimation( lua_State* pLuaVM, void* pUserData, const char * szBlockName, const char * szAnimName, int iTime, bool bLoop, bool bUpdatePosition, bool bInterruptable, bool bFreezeLastFrame )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushString( szBlockName );
|
||||
pLuaArguments.PushString( szAnimName );
|
||||
pLuaArguments.PushNumber( iTime );
|
||||
pLuaArguments.PushBoolean( bLoop );
|
||||
pLuaArguments.PushBoolean( bUpdatePosition );
|
||||
pLuaArguments.PushBoolean( bInterruptable );
|
||||
pLuaArguments.PushBoolean( bFreezeLastFrame );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedAnimation", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedAnimationProgress( lua_State* pLuaVM, void* pUserData, const char * szAnimName, float fProgress )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushString( szAnimName );
|
||||
pLuaArguments.PushNumber( fProgress );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedAnimationProgress", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedOnFire( lua_State* pLuaVM, void* pUserData, bool bIsOnFire )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushBoolean( bIsOnFire );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedOnFire", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedHeadless( lua_State* pLuaVM, void* pUserData, bool bIsHeadless )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushBoolean( bIsHeadless );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedHeadless", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetPedFrozen( lua_State* pLuaVM, void* pUserData, bool bIsFrozen )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushBoolean( bIsFrozen );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setPedFrozen", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::ReloadPedWeapon( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "reloadPedWeapon", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Vehicle create/destroy functions
|
||||
void* CLuaFunctionDefinitions::CreateVehicle( lua_State* pLuaVM, int model, float fX, float fY, float fZ, float fRX, float fRY, float fRZ, string numberplate, bool direction, int variant1, int variant2 )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
@ -156,57 +156,55 @@ public:
|
||||
static bool TakePlayerScreenShot ( lua_State* pLuaVM, void* pUserData, int iWidth, int iHeight, string sTag = "", int iQuality = 30, int iMaxBandwith = 5000 );
|
||||
|
||||
// Ped get functions
|
||||
// static int CreatePed ( lua_State* luaVM );
|
||||
// static int GetPedArmor ( lua_State* luaVM );
|
||||
// static int GetPedRotation ( lua_State* luaVM );
|
||||
// static int IsPedChoking ( lua_State* luaVM );
|
||||
// static int IsPedDead ( lua_State* luaVM );
|
||||
// static int IsPedDucked ( lua_State* luaVM );
|
||||
// static int GetPedStat ( lua_State* luaVM );
|
||||
// static int GetPedTarget ( lua_State* luaVM );
|
||||
// static int GetPedWeapon ( lua_State* luaVM );
|
||||
// static int GetPedClothes ( lua_State* luaVM );
|
||||
// static int DoesPedHaveJetPack ( lua_State* luaVM );
|
||||
// static int IsPedOnGround ( lua_State* luaVM );
|
||||
// static int GetPedFightingStyle ( lua_State* luaVM );
|
||||
// static int GetPedMoveAnim ( lua_State* luaVM );
|
||||
// static int GetPedGravity ( lua_State* luaVM );
|
||||
// static int GetPedContactElement ( lua_State* luaVM );
|
||||
// static int GetPedWeaponSlot ( lua_State* luaVM );
|
||||
// static int IsPedDoingGangDriveby ( lua_State* luaVM );
|
||||
// static int IsPedOnFire ( lua_State* luaVM );
|
||||
// static int IsPedHeadless ( lua_State* luaVM );
|
||||
// static int IsPedFrozen ( lua_State* luaVM );
|
||||
// static int GetPedOccupiedVehicle ( lua_State* luaVM );
|
||||
// static int GetPedOccupiedVehicleSeat ( lua_State* luaVM );
|
||||
// static int IsPedInVehicle ( lua_State* luaVM );
|
||||
// static int GetWeaponProperty ( lua_State* luaVM );
|
||||
// static int GetOriginalWeaponProperty ( lua_State* luaVM );
|
||||
static void* CreatePed ( lua_State* pLuaVM, int iModelid, float fX, float fY, float fZ, float fRot = 0.0, bool bSynced = true );
|
||||
static float GetPedArmor ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool IsPedChoking ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool IsPedDead ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool IsPedDucked ( lua_State* pLuaVM, void* pUserData );
|
||||
static float GetPedStat ( lua_State* pLuaVM, void* pUserData, int iStat );
|
||||
static void* GetPedTarget ( lua_State* pLuaVM, void* pUserData );
|
||||
static int GetPedWeapon ( lua_State* pLuaVM, void* pUserData, int iWeaponSlot = -1 );
|
||||
static bool GetPedClothes ( lua_State* pLuaVM, void* pUserData, unsigned char ucType, string& strOutTexture, string& strOutModel );
|
||||
static bool DoesPedHaveJetPack ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool IsPedOnGround ( lua_State* pLuaVM, void* pUserData );
|
||||
static int GetPedFightingStyle ( lua_State* pLuaVM, void* pUserData );
|
||||
static int GetPedMoveAnim ( lua_State* pLuaVM, void* pUserData );
|
||||
static float GetPedGravity ( lua_State* pLuaVM, void* pUserData );
|
||||
static void* GetPedContactElement ( lua_State* pLuaVM, void* pUserData );
|
||||
static int GetPedWeaponSlot ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool IsPedDoingGangDriveby ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool IsPedOnFire ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool IsPedHeadless ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool IsPedFrozen ( lua_State* pLuaVM, void* pUserData );
|
||||
static void* GetPedOccupiedVehicle ( lua_State* pLuaVM, void* pUserData );
|
||||
static int GetPedOccupiedVehicleSeat ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool IsPedInVehicle ( lua_State* pLuaVM, void* pUserData, void* pPed );
|
||||
// static int GetWeaponProperty ( lua_State* pLuaVM, void* pUserData );
|
||||
// static int GetOriginalWeaponProperty ( lua_State* pLuaVM, void* pUserData );
|
||||
|
||||
// Player set functions
|
||||
// static int SetPedArmor ( lua_State* luaVM );
|
||||
// static int KillPed ( lua_State* luaVM );
|
||||
// static int SetPedRotation ( lua_State* luaVM );
|
||||
// static int SetPedStat ( lua_State* luaVM );
|
||||
// static int AddPedClothes ( lua_State* luaVM );
|
||||
// static int RemovePedClothes ( lua_State* luaVM );
|
||||
// static int GivePedJetPack ( lua_State* luaVM );
|
||||
// static int RemovePedJetPack ( lua_State* luaVM );
|
||||
// static int SetPedFightingStyle ( lua_State* luaVM );
|
||||
// static int SetPedMoveAnim ( lua_State* luaVM );
|
||||
// static int SetPedGravity ( lua_State* luaVM );
|
||||
// static int SetPedChoking ( lua_State* luaVM );
|
||||
// static int WarpPedIntoVehicle ( lua_State* luaVM );
|
||||
// static int RemovePedFromVehicle ( lua_State* luaVM );
|
||||
// static int SetPedDoingGangDriveby ( lua_State* luaVM );
|
||||
// static int SetPedAnimation ( lua_State* luaVM );
|
||||
// static int SetPedAnimationProgress ( lua_State* luaVM );
|
||||
// static int SetPedWeaponSlot ( lua_State* luaVM );
|
||||
// static int SetPedOnFire ( lua_State* luaVM );
|
||||
// static int SetPedHeadless ( lua_State* luaVM );
|
||||
// static int SetPedFrozen ( lua_State* luaVM );
|
||||
// static int reloadPedWeapon ( lua_State* luaVM );
|
||||
// static int SetWeaponProperty ( lua_State* luaVM );
|
||||
// Ped set functions
|
||||
static bool SetPedArmor ( lua_State* pLuaVM, void* pUserData, float fArmor );
|
||||
static bool KillPed ( lua_State* pLuaVM, void* pUserData, void* pKiller = NULL, unsigned char ucKillerWeapon = 0xFF, unsigned char ucBodyPart = 0xFF, bool bStealth = false );
|
||||
static bool SetPedStat ( lua_State* pLuaVM, void* pUserData, unsigned short usStat, float fValue );
|
||||
static bool AddPedClothes ( lua_State* pLuaVM, void* pUserData, const char* szTexture, const char* szModel, unsigned char ucType );
|
||||
static bool RemovePedClothes ( lua_State* pLuaVM, void* pUserData, unsigned char ucType, const char* szTexture = NULL, const char* szModel = NULL );
|
||||
static bool GivePedJetPack ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool RemovePedJetPack ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool SetPedFightingStyle ( lua_State* pLuaVM, void* pUserData, unsigned char ucStyle );
|
||||
static bool SetPedMoveAnim ( lua_State* pLuaVM, void* pUserData, unsigned int iMoveAnim );
|
||||
static bool SetPedGravity ( lua_State* pLuaVM, void* pUserData, float fGravity );
|
||||
static bool SetPedChoking ( lua_State* pLuaVM, void* pUserData, bool bChoking );
|
||||
static bool SetPedWeaponSlot ( lua_State* pLuaVM, void* pUserData, unsigned char ucWeaponSlot );
|
||||
static bool WarpPedIntoVehicle ( lua_State* pLuaVM, void* pUserData, void* pVehicle, unsigned int uiSeat = 0 );
|
||||
static bool RemovePedFromVehicle ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool SetPedDoingGangDriveby ( lua_State* pLuaVM, void* pUserData, bool bGangDriveby );
|
||||
static bool SetPedAnimation ( lua_State* pLuaVM, void* pUserData, const char * szBlockName, const char * szAnimName, int iTime, bool bLoop, bool bUpdatePosition, bool bInterruptable, bool bFreezeLastFrame );
|
||||
static bool SetPedAnimationProgress ( lua_State* pLuaVM, void* pUserData, const char * szAnimName, float fProgress );
|
||||
static bool SetPedOnFire ( lua_State* pLuaVM, void* pUserData, bool bIsOnFire );
|
||||
static bool SetPedHeadless ( lua_State* pLuaVM, void* pUserData, bool bIsHeadless );
|
||||
static bool SetPedFrozen ( lua_State* pLuaVM, void* pUserData, bool bIsFrozen );
|
||||
static bool ReloadPedWeapon ( lua_State* pLuaVM, void* pUserData );
|
||||
// static bool SetWeaponProperty ( lua_State* pLuaVM, void* pUserData );
|
||||
|
||||
// Weapon give/take functions
|
||||
// static int GiveWeapon ( lua_State* luaVM );
|
||||
|
Loading…
Reference in New Issue
Block a user