HelpIf statment problem

Posts 1–3 of 3 · Page 1 of 1
If statment problem
Ok so im trying to make if mw3 (iw5mp.exe) isn't running a message box will show up saying you must run mw3! so yeah this is what i had done but doesn't seem to be working.

Code:
If Process.GetProcessesByName("iw5mp.exe").Length <> 0 Then
            MsgBox("Mw3 Must be running!", MsgBoxStyle.Exclamation)
        Else
            mw3.Hack("iw5mp")
            mw3.SetInt(&H1DB9F38, level(ComboBox1.SelectedIndex))
        End If
and yes i'm working on a new trainer
Quote Originally Posted by Goonman1 View Post
Ok so im trying to make if mw3 (iw5mp.exe) isn't running a message box will show up saying you must run mw3! so yeah this is what i had done but doesn't seem to be working.

Code:
If Process.GetProcessesByName("iw5mp.exe").Length <> 0 Then
            MsgBox("Mw3 Must be running!", MsgBoxStyle.Exclamation)
        Else
            mw3.Hack("iw5mp")
            mw3.SetInt(&H1DB9F38, level(ComboBox1.SelectedIndex))
        End If
and yes i'm working on a new trainer
When the user clicks something or just to let them know that the game has to be running first?

Code:
private void timer1_Tick(object sender, EventArgs e)    

        {
            System.Diagnostics.Process[] myprocesses = System.Diagnostics.Process.GetProcessesByName("iw5m.dat");
            if (myprocesses.Length != 0)
            {
                label4.Text = "Found IW5M!";
                label4.ForeColor = Color.Green;
            }

        }
Or if your using vb

Code:
Friend Sub timer1_Tick(ByVal sender As object, ByVal e As EventArgs)

			Dim myprocesses() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcessesByName("iw5m.dat")
			If myprocesses.Length <> 0 Then
				label4.Text = "Found IW5M!"
				label4.ForeColor = Color.Green
			End If

End Sub
I use this just to let them know that the game has to be running first. Just create a label and change the text to, Mw3 Must be running! Add your timer and edit the code to how ever you want it. Once they start the game the label text will change to Found IW5M!
Basically i want when the user clicks the button (if) mw3 isn't running it will appear with a msgbox saying "mw3 must be running to set!"

---------- Post added at 04:45 AM ---------- Previous post was at 03:34 AM ----------

Figured it out...

Code:
public Function iwmp3() As Boolean
  If Process.GetProcessesByName("iw5mp").Length >= 1 Then
    MsgBox("Iwmp3 Found!", MsgBoxStyle.Critical)
    Return True
  Else
    MsgBox("iwmp3 not found")
    Return False
  End If
    End Function
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us