Click here to Skip to main content
15,070,233 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I get this error:
Cannot implicitly convert type 'int' to 'bool' (Look at "if(hotKey & 0x8000) != 0)"

And some small errors with the brackets.
I don't know how to fix it...

Here is the code snippet:
C#
private void processtimer_Tick(object sender, EventArgs e)
{
    if (GameFound)
    {
        int playerBase = Mem.ReadMultiLevelPointer(MainPlayer.baseAddress, 4, MainPlayer.multiLevel);

        xPosLabel.Text = "xPos: " + Mem.ReadFloat(playerBase + MainPlayer.offsets.xpos);
        yPosLabel.Text = "yPos: " + Mem.ReadFloat(playerBase + MainPlayer.offsets.ypos);
        zPosLabel.Text = "zPos: " + Mem.ReadFloat(playerBase + MainPlayer.offsets.zpos);

        int hotKey = ProcessMemoryReaderApi.GetKeyState(02); //Right Mouse
        if(hotKey & 0x8000) != 0)
        {
            FocusingOnEnemy = true;
            Aimbot();
        }
        else
        {
            FocusingOnEnemy = false;
            FocusTarget = -1;
        }
    }

    try
    {
        if (MyProcess != null)
        {
            if(MyProcess[0].HasExited)
                GameFound = false;
        }


    }

    catch(Exception ex)
    {
        MessageBox.Show("There was an error. " + ex.Message);
    }
}
Posted
Updated 23-Feb-13 0:19am
v2

1 solution

You missed a bracket out:
C#
if(hotKey & 0x8000) != 0)
{
Should be
C#
if((hotKey & 0x8000) != 0)
{
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900