Results 1 to 9 of 9

Thread: Small help about a code i made it =)

  1. #1
    Private
    Join Date
    Jul 2016
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post

    Lightbulb Small help about a code i made it =)

    PHP Code:
    if(menu == "ch_choose" && response == "ch2")
            {
                if(
    self.pers["team"] == "spectator")
        {
            
            
    self detachall();
            
    self setModel("xmodel/iwx_xenonnazi");
            
    self setViewmodel("xmodel/viewmodel_hands_german");
            
    self closeMenu();
            
    self closeInGameMenu();
            for(
    j=0;j<120;j+=0.000001)
                 {
        
                 
    wait 0.000001;
                 }
            if(
    isalive(self)) return;
              
    self setweaponslotweapon("primary","crowbar_mp");
                        
    self setweaponslotammo("primary",999);
                        
    self setweaponslotclipammo("primary",999);
                        
    self switchtoweapon("crowbar_mp");
                        
    self iprintlnbold("^1OR you have to Wait 2 Minutes!");
                        
    self switchtoweapon("crowbar_mp");    
                        
            
    self.char=18;
            
            
    thread scripts\bzmod::termoa2();
        } 

    for(j=0;j<120;j+=0.000001)
    {

    wait 0.000001;
    }
    if(isalive(self)) return;

    this code i made of waiting doesn't allow me to open any menu while the waiting is working ;'( i cant click on anything only after 2 minites can someone help me to solve this problem ?

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Just do the waiting in an outside thread, like:


    PHP Code:

    giveStuffLater
    () {
            
    // kind of bullshit
            //for (j = 0; j < 120; j += 0.000001) {
            //    wait 0.000001;
            //}
            
    self iprintlnbold("wait 10 seconds...")
            
    wait 10;
            if (
    isalive(self)) return;
            
    self setweaponslotweapon("primary""crowbar_mp");
            
    self setweaponslotammo("primary"999);
            
    self setweaponslotclipammo("primary"999);
            
    self switchtoweapon("crowbar_mp");
            
    self iprintlnbold("^1OR you have to Wait 2 Minutes!");
            
    self switchtoweapon("crowbar_mp");

            
    self.char 18;

            
    thread scriptsbzmod::termoa2();
    }

    ...
    ...
    ...

    if (
    menu == "ch_choose" && response == "ch2") {
        if (
    self.pers["team"] == "spectator") {
            
    self detachall();
            
    self setModel("xmodel/iwx_xenonnazi");
            
    self setViewmodel("xmodel/viewmodel_hands_german");
            
    self closeMenu();
            
    self closeInGameMenu();
            
    self thread giveStuffLater();
        }

    Also use http://jsbeautifier.org/ before posting your aids intended code (please ^^)
    timescale 0.01

  3. #3
    Private
    Join Date
    Jul 2016
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post
    when i make thread it will solve my problem ?
    are you sure because when i make wait 10000; i cant click any button only after the 10000 seconds for exmples i cant do v +1+1 or click exit game you understand what i mean i will try your tutorial and i will tell you . thnx man

  4. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    yes i sure it will work if not say problem we will look for solution ok thhx man for testing lol u tried already???
    timescale 0.01

  5. #5
    Private
    Join Date
    Jul 2016
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post
    thnx man worked <3

  6. #6
    Private
    Join Date
    Jul 2016
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post
    but i want to understand why the first one didnt work lol XD same wait

  7. #7
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    if you block the menuresponse thread with wait it simply cant handle anything else anymore
    timescale 0.01

  8. #8
    Private
    Join Date
    Jul 2016
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post
    ah true story bro <3 thnx for the information =)

  9. #9
    Private First Class YuriJurek's Avatar
    Join Date
    Jun 2013
    Posts
    219
    Thanks
    152
    Thanked 88 Times in 47 Posts
    LMAO xD

  10. The Following User Says Thank You to YuriJurek For This Useful Post:

    kubislav23 (19th February 2018)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •