mirror of
https://github.com/ChronosX88/mta-mono.git
synced 2024-12-23 01:11:48 +00:00
Lua RadarArea functions (CLuaFunctionDefinitions)
This commit is contained in:
parent
fe7ed1950e
commit
95fa6d5d25
@ -3259,7 +3259,7 @@ bool CLuaFunctionDefinitions::GetVehicleHeadLightColor( lua_State* pLuaVM, void*
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getVehicleHeadLightColor", 1 ) )
|
||||
if( pLuaArguments.Call( pLuaVM, "getVehicleHeadLightColor", 3 ) )
|
||||
{
|
||||
ucRed = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -3 ) )->GetNumber() );
|
||||
ucGreen = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -2 ) )->GetNumber() );
|
||||
@ -3357,7 +3357,7 @@ bool CLuaFunctionDefinitions::SetVehicleTurnVelocity( lua_State* pLuaVM, void* p
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetVehicleColor( lua_State* pLuaVM, void* pUserData, unsigned char& ucRed, unsigned char& ucGreen, unsigned char& ucBlue, unsigned char& ucRed2, unsigned char& ucGreen2, unsigned char& ucBlue2, unsigned char& ucRed3, unsigned char& ucGreen3, unsigned char& ucBlue3, unsigned char& ucRed4, unsigned char& ucGreen4, unsigned char& ucBlue4 )
|
||||
bool CLuaFunctionDefinitions::SetVehicleColor( lua_State* pLuaVM, void* pUserData, unsigned char ucRed, unsigned char ucGreen, unsigned char ucBlue, unsigned char ucRed2, unsigned char ucGreen2, unsigned char ucBlue2, unsigned char ucRed3, unsigned char ucGreen3, unsigned char ucBlue3, unsigned char ucRed4, unsigned char ucGreen4, unsigned char ucBlue4 )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
@ -4184,7 +4184,7 @@ bool CLuaFunctionDefinitions::GetMarkerColor( lua_State* pLuaVM, void* pUserData
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getMarkerColor", 1 ) )
|
||||
if( pLuaArguments.Call( pLuaVM, "getMarkerColor", 3 ) )
|
||||
{
|
||||
ucRed = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -3 ) )->GetNumber() );
|
||||
ucGreen = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -2 ) )->GetNumber() );
|
||||
@ -4202,7 +4202,7 @@ int CLuaFunctionDefinitions::GetMarkerTarget( lua_State* pLuaVM, void* pUserData
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getMarkerTarget", 1 ) )
|
||||
if( pLuaArguments.Call( pLuaVM, "getMarkerTarget", 3 ) )
|
||||
{
|
||||
fX = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -3 ) )->GetNumber() );
|
||||
fY = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -2 ) )->GetNumber() );
|
||||
@ -4418,7 +4418,7 @@ bool CLuaFunctionDefinitions::GetBlipColor( lua_State* pLuaVM, void* pUserData,
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getBlipColor", 1 ) )
|
||||
if( pLuaArguments.Call( pLuaVM, "getBlipColor", 4 ) )
|
||||
{
|
||||
ucRed = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -4 ) )->GetNumber() );
|
||||
ucGreen = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -3 ) )->GetNumber() );
|
||||
@ -4655,3 +4655,159 @@ bool CLuaFunctionDefinitions::StopObject( lua_State* pLuaVM, void* pUserData )
|
||||
return false;
|
||||
}
|
||||
|
||||
// Radar area create/destroy funcs
|
||||
void* CLuaFunctionDefinitions::CreateRadarArea( lua_State* pLuaVM, float fX, float fY, float fZ, float fSizeX, float fSizeY, unsigned char ucRed, unsigned char ucGreen, unsigned char ucBlue, unsigned char ucAlpha, void* pVisibleTo )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushNumber( fX );
|
||||
pLuaArguments.PushNumber( fY );
|
||||
pLuaArguments.PushNumber( fZ );
|
||||
|
||||
pLuaArguments.PushNumber( fSizeX );
|
||||
pLuaArguments.PushNumber( fSizeY );
|
||||
|
||||
pLuaArguments.PushNumber( ucRed );
|
||||
pLuaArguments.PushNumber( ucGreen );
|
||||
pLuaArguments.PushNumber( ucBlue );
|
||||
pLuaArguments.PushNumber( ucAlpha );
|
||||
|
||||
if( pVisibleTo )
|
||||
{
|
||||
pLuaArguments.PushUserData( pVisibleTo );
|
||||
}
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "createRadarArea", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetLightUserData();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Radar area get funcs
|
||||
bool CLuaFunctionDefinitions::GetRadarAreaSize( lua_State* pLuaVM, void* pUserData, float& fSizeX, float& fSizeY )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getRadarAreaSize", 2 ) )
|
||||
{
|
||||
fSizeX = static_cast< float >( ( new CLuaArgument( pLuaVM, -2 ) )->GetNumber() );
|
||||
fSizeY = static_cast< float >( ( new CLuaArgument( pLuaVM, -1 ) )->GetNumber() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::GetRadarAreaColor( lua_State* pLuaVM, void* pUserData, unsigned char& ucRed, unsigned char& ucGreen, unsigned char& ucBlue, unsigned char& ucAlpha )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "getRadarAreaColor", 4 ) )
|
||||
{
|
||||
ucRed = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -4 ) )->GetNumber() );
|
||||
ucGreen = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -3 ) )->GetNumber() );
|
||||
ucBlue = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -2 ) )->GetNumber() );
|
||||
ucAlpha = static_cast< unsigned char >( ( new CLuaArgument( pLuaVM, -1 ) )->GetNumber() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::IsRadarAreaFlashing( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "isRadarAreaFlashing", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::IsInsideRadarArea( lua_State* pLuaVM, void* pUserData )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "isInsideRadarArea", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Radar area set funcs
|
||||
bool CLuaFunctionDefinitions::SetRadarAreaSize( lua_State* pLuaVM, void* pUserData, float fSizeX, float fSizeY )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( fSizeX );
|
||||
pLuaArguments.PushNumber( fSizeY );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setRadarAreaSize", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetRadarAreaColor( lua_State* pLuaVM, void* pUserData, unsigned char ucRed, unsigned char ucGreen, unsigned char ucBlue, unsigned char ucAlpha )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushNumber( ucRed );
|
||||
pLuaArguments.PushNumber( ucGreen );
|
||||
pLuaArguments.PushNumber( ucBlue );
|
||||
pLuaArguments.PushNumber( ucAlpha );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setRadarAreaColor", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CLuaFunctionDefinitions::SetRadarAreaFlashing( lua_State* pLuaVM, void* pUserData, bool bFlashing )
|
||||
{
|
||||
CLuaArguments pLuaArguments;
|
||||
|
||||
pLuaArguments.PushUserData( pUserData );
|
||||
pLuaArguments.PushBoolean( bFlashing );
|
||||
|
||||
if( pLuaArguments.Call( pLuaVM, "setRadarAreaFlashing", 1 ) )
|
||||
{
|
||||
CLuaArgument pLuaArgument( pLuaVM, -1 );
|
||||
|
||||
return pLuaArgument.GetBoolean();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ public:
|
||||
static bool FixVehicle ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool BlowVehicle ( lua_State* pLuaVM, void* pUserData, bool bExplode );
|
||||
static bool SetVehicleTurnVelocity ( lua_State* pLuaVM, void* pUserData, float fX, float fY, float fZ );
|
||||
static bool SetVehicleColor ( lua_State* pLuaVM, void* pUserData, unsigned char& ucRed, unsigned char& ucGreen, unsigned char& ucBlue, unsigned char& ucRed2, unsigned char& ucGreen2, unsigned char& ucBlue2, unsigned char& ucRed3, unsigned char& ucGreen3, unsigned char& ucBlue3, unsigned char& ucRed4, unsigned char& ucGreen4, unsigned char& ucBlue4 );
|
||||
static bool SetVehicleColor ( lua_State* pLuaVM, void* pUserData, unsigned char ucRed, unsigned char ucGreen, unsigned char ucBlue, unsigned char ucRed2, unsigned char ucGreen2, unsigned char ucBlue2, unsigned char ucRed3, unsigned char ucGreen3, unsigned char ucBlue3, unsigned char ucRed4, unsigned char ucGreen4, unsigned char ucBlue4 );
|
||||
static bool SetVehicleLandingGearDown ( lua_State* pLuaVM, void* pUserData, bool bLandingGearDown );
|
||||
static bool SetVehicleLocked ( lua_State* pLuaVM, void* pUserData, bool bLocked );
|
||||
static bool SetVehicleDoorsUndamageable ( lua_State* pLuaVM, void* pUserData, bool bDoorsUndamageable );
|
||||
@ -357,18 +357,18 @@ public:
|
||||
static bool StopObject ( lua_State* pLuaVM, void* pUserData );
|
||||
|
||||
// Radar area create/destroy funcs
|
||||
// static int CreateRadarArea ( lua_State* luaVM );
|
||||
static void* CreateRadarArea ( lua_State* pLuaVM, float fX, float fY, float fZ, float fSizeX = 0.0f, float fSizeY = 0.0f, unsigned char ucRed = 255, unsigned char ucGreen = 0, unsigned char ucBlue = 0, unsigned char ucAlpha = 255, void* pVisibleTo = NULL );
|
||||
|
||||
// Radar area get funcs
|
||||
// static int GetRadarAreaSize ( lua_State* luaVM );
|
||||
// static int GetRadarAreaColor ( lua_State* luaVM );
|
||||
// static int IsRadarAreaFlashing ( lua_State* luaVM );
|
||||
// static int IsInsideRadarArea ( lua_State* luaVM );
|
||||
static bool GetRadarAreaSize ( lua_State* pLuaVM, void* pUserData, float& fSizeX, float& fSizeY );
|
||||
static bool GetRadarAreaColor ( lua_State* pLuaVM, void* pUserData, unsigned char& ucRed, unsigned char& ucGreen, unsigned char& ucBlue, unsigned char& ucAlpha );
|
||||
static bool IsRadarAreaFlashing ( lua_State* pLuaVM, void* pUserData );
|
||||
static bool IsInsideRadarArea ( lua_State* pLuaVM, void* pUserData );
|
||||
|
||||
// Radar area set funcs
|
||||
// static int SetRadarAreaSize ( lua_State* luaVM );
|
||||
// static int SetRadarAreaColor ( lua_State* luaVM );
|
||||
// static int SetRadarAreaFlashing ( lua_State* luaVM );
|
||||
static bool SetRadarAreaSize ( lua_State* pLuaVM, void* pUserData, float fSizeX, float fSizeY );
|
||||
static bool SetRadarAreaColor ( lua_State* pLuaVM, void* pUserData, unsigned char ucRed, unsigned char ucGreen, unsigned char ucBlue, unsigned char ucAlpha );
|
||||
static bool SetRadarAreaFlashing ( lua_State* pLuaVM, void* pUserData, bool bFlashing );
|
||||
|
||||
// Explosion funcs
|
||||
// static int CreateExplosion ( lua_State* luaVM );
|
||||
|
Loading…
Reference in New Issue
Block a user