Results 1 to 5 of 5
  1. #1
    apezwijn's Avatar
    Join Date
    Feb 2007
    Gender
    male
    Location
    The Netherlands
    Posts
    1,525
    Reputation
    22
    Thanks
    682

    [Help] Using dim's from Public Functions

    Hey guys, I never really used this method, but by using this method I think my projects won't be messy anymore.

    So ok, I have this public function:
    Code:
    Public Function GeneralDims()
            Dim dGame As Long
            Dim MobDeadState As Long
            Dim MobId As Long
            Dim cHP As Long
            Dim cMP As Long
            dGame = ReadDLL("Game.dll")
            MobDeadState = "&H" + Hex(dGame + &Hoffset)
            MobId = "&H" + Hex(dGame + &Hoffset)
            cHP = "&H" + Hex(dGame + &Hoffset)
            cMP = "&H" + Hex(dGame + &Hoffset)
            Return dGame & MobDeadState & MobId & cHP
        End Function
    I just screwed around with the return, i'm not that good at creating functions:P

    So what I want is, not having to dim and set a value to the var. all over again.

    I want to use it like this:
    Code:
    Private Sub TimerTarget_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerTarget.Tick
            GeneralDims()
            If MobDeadState = 1 Then
    'do somthing
    end if
        End Sub
    But now it just errors me that the var is not declared.

    Could somebody help me?
    Thanks,
    Apez.

    If want to be credited, say so, you will be credited.

  2. #2
    Pixie's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    Pixie wird wieder steigen.
    Posts
    1,884
    Reputation
    22
    Thanks
    229
    My Mood
    Fine
    I am an idiot, so I must ask this
    What does this do first of all??

  3. #3
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    ever thought of moving your dims outside the function? o__O

    Code:
    Dim dGame As Long
    Dim MobDeadState As Long
    Dim MobId As Long
    Dim cHP As Long
    Dim cMP As Long
    Public Function GeneralDims()
            dGame = ReadDLL("Game.dll")
            MobDeadState = "&H" + Hex(dGame + &Hoffset)
            MobId = "&H" + Hex(dGame + &Hoffset)
            cHP = "&H" + Hex(dGame + &Hoffset)
            cMP = "&H" + Hex(dGame + &Hoffset)
            Return dGame & MobDeadState & MobId & cHP
    End Function
    Ah we-a blaze the fyah, make it bun dem!

  4. #4
    Iamazn1's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    407
    Reputation
    12
    Thanks
    50
    Arnt you like a godly coder?
    On topic:
    dont you need a Dim Var as ..... to get it to work?
    When you get an error saying "blank is not declared.", it means its well, not declared.

  5. #5
    apezwijn's Avatar
    Join Date
    Feb 2007
    Gender
    male
    Location
    The Netherlands
    Posts
    1,525
    Reputation
    22
    Thanks
    682
    Quote Originally Posted by Iamazn1 View Post
    Arnt you like a godly coder?
    On topic:
    dont you need a Dim Var as ..... to get it to work?
    When you get an error saying "blank is not declared.", it means its well, not declared.
    lol, ya I already fixed it by putting them in global.
    Ty all.

    Close.

Similar Threads

  1. [Help Request] need help whit heal tool from admin menu
    By Black666Devil666 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 4
    Last Post: 06-11-2011, 07:35 AM
  2. Help using haks pls
    By mpghisawesome in forum General Hacking
    Replies: 0
    Last Post: 03-06-2009, 06:48 PM
  3. Help using hacks
    By rigedw00t in forum Operation 7 General
    Replies: 0
    Last Post: 02-07-2009, 07:18 PM
  4. I hate people who use screen names from tv shows
    By warlock78 in forum Flaming & Rage
    Replies: 27
    Last Post: 12-28-2008, 07:03 AM
  5. Help ! I get kicked from punkbuster
    By DarkTiger in forum WarRock - International Hacks
    Replies: 3
    Last Post: 09-22-2007, 04:16 AM

Tags for this Thread