Results 1 to 2 of 2
  1. #1
    myamazingcat's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    5
    My Mood
    Amused

    running multiple threads at once?

    EDITED:

    hey,
    im trying to create my own gamemode, and one of the problems I have is trying to delete my crates in one thread from a completely different one. When I use the "waitill" command, it stalls up some other threads I need to run. So are there any other ways to delete crates from other threads besides "waitill"?

    and the same HUD elements from other threads? Like if i create a progress bar in one thread, then I try and make a conditional statement in another thread to delete the progress bar, I get an "uninitialized variable 'progress bar'" error. Any way around that without using "waittill"
    Last edited by myamazingcat; 06-13-2011 at 09:27 PM. Reason: changes

  2. #2
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,330
    My Mood
    Breezy
    Use the entity. prefix on any variables to access the thingy from any thread.

    Example:
    Code:
    doSpawn()
    {
        self thread doCrap1(); //When this is run, self.someThing is initialized
        self thread doCrap2(); //By the time it runs this, it should be able to access self.someThing since it's a 'global variable'
    }
    
    doCrap1()
    {
        self.someThing = 1;
    }
    
    doCrap2()
    {
        self iPrintLnBold(self.someThing);
    }
    /marked as solved

    If you need to ask anymore questions or need something to be cleared let me know otherwise, tell me to close the thread.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]