Ejemplo n.º 1
0
CVehicle* CClientTask::GetParameterVehicle ( const char* szKey )
{
    // Grab the parameter, is it userdata?
    CLuaArgument* pArgument = GetParameter ( szKey );
    if ( pArgument && pArgument->GetType () == LUA_TLIGHTUSERDATA )
    {
        // Grab the player and verify it
        CClientVehicle* pVehicle = reinterpret_cast < CClientVehicle* > ( pArgument->GetLightUserData () );
        if ( VERIFY_VEHICLE ( pVehicle ) )
        {
            // Return the game vehicle
            return pVehicle->GetGameVehicle ();
        }
    }

    // Non-existing
    return NULL;
}
Ejemplo n.º 2
0
CPed* CClientTask::GetParameterPed ( const char* szKey )
{
    // Grab the parameter, is it userdata?
    CLuaArgument* pArgument = GetParameter ( szKey );
    if ( pArgument && pArgument->GetType () == LUA_TLIGHTUSERDATA )
    {
        // Grab the player and verify it
        CClientPlayer* pPlayer = reinterpret_cast < CClientPlayer* > ( pArgument->GetLightUserData () );
        if ( VERIFY_PLAYER ( pPlayer ) )
        {
            // Return his game player
            return pPlayer->GetGamePlayer ();
        }
    }

    // Non-existing
    return NULL;
}