Here's the ScriptHookV code of custom time control mod for GTA V:
```cpp
#include "script.h"
#include "keyboard.h"
#include <cmath>

#define VK_KEY_T 0x54 // Виртуальный код клавиши T
#define VK_KEY_W 0x57
#define VK_KEY_A 0x41
#define VK_KEY_S 0x53
#define VK_KEY_D 0x44

using namespace GAMEPLAY;

class TimeControl {
private:
    bool m_bTimeSlowed = false;
    float m_fSlowFactor = 0.001f;
    float m_fBasePlayerSpeed = 300.0f; // Base speed during slow motion
    float m_fSprintMultiplied = 600.0f; // Speed multiplier when holding Shift

public:
    void Tick() {
        // Toggle slow motion with T key
        if (IsKeyJustUp(VK_KEY_T)) {
            m_bTimeSlowed = !m_bTimeSlowed;

            if (m_bTimeSlowed) {
                UI::_SET_NOTIFICATION_TEXT_ENTRY((char*)"STRING");
                UI::_ADD_TEXT_COMPONENT_STRING((char*)"Slow motion activated");
                UI::_DRAW_NOTIFICATION(false, false);
            }
            else {
                SET_TIME_SCALE(1.0f);
                // Reset player velocity when exiting slow motion
                Ped playerPed = PLAYER::PLAYER_PED_ID();
                ENTITY::SET_ENTITY_VELOCITY(playerPed, 0.0f, 0.0f, 0.0f);

                UI::_SET_NOTIFICATION_TEXT_ENTRY((char*)"STRING");
                UI::_ADD_TEXT_COMPONENT_STRING((char*)"Slow motion deactivated");
                UI::_DRAW_NOTIFICATION(false, false);
            }
        }

        if (m_bTimeSlowed) {
            // Slow down time
            SET_TIME_SCALE(m_fSlowFactor);

            // Handle player movement during slow motion
            HandlePlayerMovement();
        }
    }

private:
    void HandlePlayerMovement() {
        Ped playerPed = PLAYER::PLAYER_PED_ID();

        // Get camera direction to determine movement orientation
        Vector3 camRot = CAM::GET_GAMEPLAY_CAM_ROT(0);
        float heading = camRot.z * (3.14159265359f / 180.0f); // Convert to radians

        // Calculate forward and right vectors based on camera heading
        Vector3 forwardVec;
        forwardVec.x = -sin(heading);
        forwardVec.y = cos(heading);
        forwardVec.z = 0.0f;

        Vector3 rightVec;
        rightVec.x = cos(heading);
        rightVec.y = sin(heading);
        rightVec.z = 0.0f;

        // Initialize movement vector
        Vector3 moveVec = { 0.0f, 0.0f, 0.0f };

        // Flag to track if any movement key is pressed
        bool anyKeyPressed = false;

        // Check WASD inputs and build movement vector
        if (IsKeyDown(VK_KEY_W)) {
            moveVec.x += forwardVec.x;
            moveVec.y += forwardVec.y;
            anyKeyPressed = true;
        }
        if (IsKeyDown(VK_KEY_S)) {
            moveVec.x -= forwardVec.x;
            moveVec.y -= forwardVec.y;
            anyKeyPressed = true;
        }
        if (IsKeyDown(VK_KEY_A)) {
            moveVec.x -= rightVec.x;
            moveVec.y -= rightVec.y;
            anyKeyPressed = true;
        }
        if (IsKeyDown(VK_KEY_D)) {
            moveVec.x += rightVec.x;
            moveVec.y += rightVec.y;
            anyKeyPressed = true;
        }

        // If no keys are pressed, explicitly set velocity to zero
        if (!anyKeyPressed) {
            ENTITY::SET_ENTITY_VELOCITY(playerPed, 0.0f, 0.0f, 0.0f);
            return;
        }

        // Normalize and scale the movement vector if there's any input
        float length = sqrt(moveVec.x * moveVec.x + moveVec.y * moveVec.y);
        if (length > 0.0f) {
            float currentSpeed = m_fBasePlayerSpeed;

            // Apply sprint multiplier if Shift is held down
            if (IsKeyDown(VK_SHIFT)) {
                currentSpeed = m_fSprintMultiplied;
            }

            moveVec.x = moveVec.x * currentSpeed;
            moveVec.y = moveVec.y * currentSpeed;

            // Apply the velocity
            ENTITY::SET_ENTITY_VELOCITY(playerPed, moveVec.x, moveVec.y, 0.0f);
        }
    }
};

TimeControl timeControl;

void main()
{
    while (true) {
        timeControl.Tick();
        WAIT(0);
    }
}

void ScriptMain()
{
    main();
}
```
I want you to implement the ability to move a player by mouse in Z-axis also.