-1

Hello people came here because I have a problem in a code that I'm changing.

I'm using Visual Studio 2015

the code is giving this issue

Uninitialized local variable 'OnSpeed' used

Uninitialized local variable 'OnBM2' used

Uninitialized local variable 'OnCombo' used

Uninitialized local variable 'OnNSD' used

 #include <windows.h>
 #include "MyCheat.h"

 void Start()
{
   bool OnSpeed, OnBM2, OnCombo, OnNSD;
   char * CAPTION = "My Sample DLL";

   while (true)
  {
     //================================ CHANGE NATION      ===================================================
    if (GetKeyState(VK_F11) < 0) { CHANGE_NATION(); }
    //==================================================================================================

    //================================ MOVEMENT SPEED ==================================================
    if (GetKeyState(VK_F12) < 0)
    {
        if (!OnSpeed) {
            OnSpeed = true;
            MessageBoxA(NULL, "Movement Speed ON", CAPTION, MB_OK);
        }
        else {
            OnSpeed = false;
            MOVE_SPEED(450.0);
            MessageBoxA(NULL, "Movement Speed OFF", CAPTION, MB_OK);
        }
    }
    //==================================================================================================

    //THIS BM2, COMBO AND NSD IS ONLY WORK IN WIN 7 32BIT AND 64BIT

    //================================ NO COOLDOWN BM2 =================================================
    if (GetKeyState(VK_F10) < 0)
    {
        if (!OnBM2) {
            OnBM2 = true;
            MessageBoxA(NULL, "No Cooldown BM2 ON", CAPTION, MB_OK);
        }
        else {
            OnBM2 = false;
            MessageBoxA(NULL, "No Cooldown BM2 OFF", CAPTION, MB_OK);
        }
    }
    //==================================================================================================

    //================================ PERFECT COMBO ===================================================
    if (GetKeyState(VK_F9) < 0)
    {
        if (!OnCombo) {
            OnCombo = true;
            MessageBoxA(NULL, "PERFECT COMBO ON", CAPTION, MB_OK);
        }
        else {
            OnCombo = false;
            MessageBoxA(NULL, "PERFECT COMBO OFF", CAPTION, MB_OK);
        }
    }
    //==================================================================================================

    //================================ NO SKILL DELAY ==================================================
    if (GetKeyState(VK_F8) < 0)
    {
        if (!OnNSD) {
            OnNSD = true;
            MessageBoxA(NULL, "No Skill Delay ON", CAPTION, MB_OK);
        }
        else {
            OnNSD = false;
            MessageBoxA(NULL, "No Skill Delay OFF", CAPTION, MB_OK);
        }
    }
    //==================================================================================================

    //================================ FREEZING VALUE ==================================================
    if (OnSpeed) MOVE_SPEED(600.0);
    if (OnBM2) NOCD_BM2();
    if (OnCombo) NOCD_COMBO();
    if (OnNSD) NSD();
    //==================================================================================================

    Sleep(1);
}

}

Community
  • 1
  • 1
RodrigoR
  • 3
  • 2

1 Answers1

1

The message could not be clearer.

In C++, you have to initialize local variables in order to use them. They do not have a default value.

You have to assign a value to OnSpeed, OnBM2, OnCombo, OnNSD first.

Eutherpy
  • 4,471
  • 7
  • 40
  • 64