Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Исходник Noclip Standoff 2

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
10 Окт 2024
Сообщения
77
Реакции
0
Noclip на standoff 2 Вот код


Noclip:
Expand Collapse Copy
namespace Noclip {

inline bool enabled = false;
inline float speed = 20.0f;
inline Vec3 flyPos = {0, 0, 0};
inline bool posInitialized = false;


typedef Vec3 (*GetRight_t)(void* transform);
typedef Vec3 (*GetForward_t)(void* transform);
typedef void (*SetPosition_t)(void* transform, Vec3 pos);
typedef float (*GetDeltaTime_t)();

inline GetRight_t get_right = nullptr;
inline GetForward_t get_forward = nullptr;
inline SetPosition_t set_position = nullptr;
inline GetDeltaTime_t get_deltaTime = nullptr;

inline uintptr_t g_base = 0;

inline bool IsValidPtr(void* ptr) {
    return ptr != nullptr && (uintptr_t)ptr > 0x1000;
}

inline void Apply(void* movementController, void* cmd) {
    if (!enabled) return;
    if (!IsValidPtr(movementController)) return;
    if (!get_deltaTime || !get_forward || !get_right || !set_position) return;
  
    void* playerController = *(void**)((uintptr_t)movementController + nullptr404(0x50));
    if (!IsValidPtr(playerController)) return;
  
    void* playerTransform = Functions::GetTransform ? Functions::GetTransform(playerController) : nullptr;
    if (!IsValidPtr(playerTransform)) return;
  

    void* camera = Functions::GetCamera ? Functions::GetCamera() : nullptr;
    if (!IsValidPtr(camera)) return;
  
    void* cameraTransform = Functions::GetTransform ? Functions::GetTransform(camera) : nullptr;
    if (!IsValidPtr(cameraTransform)) return;
  
        if (!posInitialized && Functions::GetPosition) {
        flyPos = Functions::GetPosition(playerTransform);
        posInitialized = true;
    }
  

    float moveX = 0.0f;
    float moveY = 0.0f;
    if (IsValidPtr(cmd)) {
        moveX = *(float*)((uintptr_t)cmd + nullptr404(0x10));
        moveY = *(float*)((uintptr_t)cmd + nullptr404(0x14));
    }
  
    float deltaTime = get_deltaTime();
  

    Vec3 forward = get_forward(cameraTransform);
    Vec3 right = get_right(cameraTransform);
  

    Vec3 transfer;
    transfer.x = (forward.x * moveY + right.x * moveX) * deltaTime * speed;
    transfer.y = (forward.y * moveY + right.y * moveX) * deltaTime * speed;
    transfer.z = (forward.z * moveY + right.z * moveX) * deltaTime * speed;
  

    flyPos.x += transfer.x;
    flyPos.y += transfer.y;
    flyPos.z += transfer.z;

    set_position(playerTransform, flyPos);
}

inline void Reset() {
    posInitialized = false;
    flyPos = {0, 0, 0};
}

inline void Init(uintptr_t base) {
    g_base = base;
    get_right = (GetRight_t)(base + nullptr404(0x2C47C04));
    get_forward = (GetForward_t)(base + nullptr404(0x2C47CFC));
    set_position = (SetPosition_t)(base + nullptr404(0x2C4781C));
    get_deltaTime = (GetDeltaTime_t)(base + nullptr404(0x2C3A278));
}

}
 
Noclip на standoff 2 Вот код


Noclip:
Expand Collapse Copy
namespace Noclip {

inline bool enabled = false;
inline float speed = 20.0f;
inline Vec3 flyPos = {0, 0, 0};
inline bool posInitialized = false;


typedef Vec3 (*GetRight_t)(void* transform);
typedef Vec3 (*GetForward_t)(void* transform);
typedef void (*SetPosition_t)(void* transform, Vec3 pos);
typedef float (*GetDeltaTime_t)();

inline GetRight_t get_right = nullptr;
inline GetForward_t get_forward = nullptr;
inline SetPosition_t set_position = nullptr;
inline GetDeltaTime_t get_deltaTime = nullptr;

inline uintptr_t g_base = 0;

inline bool IsValidPtr(void* ptr) {
    return ptr != nullptr && (uintptr_t)ptr > 0x1000;
}

inline void Apply(void* movementController, void* cmd) {
    if (!enabled) return;
    if (!IsValidPtr(movementController)) return;
    if (!get_deltaTime || !get_forward || !get_right || !set_position) return;
 
    void* playerController = *(void**)((uintptr_t)movementController + nullptr404(0x50));
    if (!IsValidPtr(playerController)) return;
 
    void* playerTransform = Functions::GetTransform ? Functions::GetTransform(playerController) : nullptr;
    if (!IsValidPtr(playerTransform)) return;
 

    void* camera = Functions::GetCamera ? Functions::GetCamera() : nullptr;
    if (!IsValidPtr(camera)) return;
 
    void* cameraTransform = Functions::GetTransform ? Functions::GetTransform(camera) : nullptr;
    if (!IsValidPtr(cameraTransform)) return;
 
        if (!posInitialized && Functions::GetPosition) {
        flyPos = Functions::GetPosition(playerTransform);
        posInitialized = true;
    }
 

    float moveX = 0.0f;
    float moveY = 0.0f;
    if (IsValidPtr(cmd)) {
        moveX = *(float*)((uintptr_t)cmd + nullptr404(0x10));
        moveY = *(float*)((uintptr_t)cmd + nullptr404(0x14));
    }
 
    float deltaTime = get_deltaTime();
 

    Vec3 forward = get_forward(cameraTransform);
    Vec3 right = get_right(cameraTransform);
 

    Vec3 transfer;
    transfer.x = (forward.x * moveY + right.x * moveX) * deltaTime * speed;
    transfer.y = (forward.y * moveY + right.y * moveX) * deltaTime * speed;
    transfer.z = (forward.z * moveY + right.z * moveX) * deltaTime * speed;
 

    flyPos.x += transfer.x;
    flyPos.y += transfer.y;
    flyPos.z += transfer.z;

    set_position(playerTransform, flyPos);
}

inline void Reset() {
    posInitialized = false;
    flyPos = {0, 0, 0};
}

inline void Init(uintptr_t base) {
    g_base = base;
    get_right = (GetRight_t)(base + nullptr404(0x2C47C04));
    get_forward = (GetForward_t)(base + nullptr404(0x2C47CFC));
    set_position = (SetPosition_t)(base + nullptr404(0x2C4781C));
    get_deltaTime = (GetDeltaTime_t)(base + nullptr404(0x2C3A278));
}

}
стэнгдофчик
1775296542541.png
 
Назад
Сверху Снизу