Results 1 to 5 of 5
  1. #1
    SkruffysDB's Avatar
    Join Date
    Jul 2014
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    37

    Toggle addAction delayed?

    So I'm only going to post some of this so I don't completely give out my menu but the toggle makes it so it adds an action that says ON if its on and OFF if its off. Whenever I first toggle it, it doesn't turn to the ON status but when I refresh the menu and turn it from ON to OFF it works without closing menu and reopening.

    I am reopening the menu everytime the toggle is selected so it should work.

    Code:
    main_menu = {
            if(isNil "command_vgod_tog") then {
                player addAction ["<t color='#FF0000'>Vehicle God [OFF]</t>", {[]spawn vgod}];
            } else {
                if!(command_vgod_tog) then {
                    player addAction ["<t color='#FF0000'>Vehicle God [OFF]</t>", {[]spawn vgod}];
                } else {
                    player addAction ["<t color='#40FF00'>Vehicle God [ON]</t>", {[]spawn vgod}];
                };
            };
    };
    
        vgod = {
            if(isNil "command_vgod_tog") then {
                command_vgod_tog = TRUE;
            } else {
                if!(command_vgod_tog) then {
                    command_vgod_tog = TRUE;
                } else {
                    command_vgod_tog = FALSE;
                };
            };
            
            if (command_vgod_tog) then {
                titleText["Vehicle God Mode enabled!", "PLAIN"];
                while {command_vgod_tog} do {
                    waitUntil {vehicle player != player};
                    vehiclegod_vehicle = vehicle player;
                    vehiclegod_vehicle removeAllEventHandlers "handleDamage";
                    vehiclegod_vehicle addEventHandler["handleDamage", {false}];
                    vehiclegod_vehicle allowDamage false;
                    vehiclegod_vehicle setDamage 0;
                    vehiclegod_vehicle setFuel 1;
                };
            } else {
                titleText["Vehicle God Mode disabled!", "PLAIN"];
                waitUntil {vehicle player == player};
                vehiclegod_vehicle removeAllEventHandlers "handleDamage";
                vehiclegod_vehicle addEventHandler["handleDamage", {true}];
                vehiclegod_vehicle allowDamage true;
            };
            []spawn main_menu;
        };
    PS: By the way, my other toggles work perfectly fine and I'm using the same technique. It just won't work for some reason.
    Last edited by SkruffysDB; 11-17-2014 at 03:36 PM. Reason: fix

  2. #2
    Jme's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Location
    Balls Deep
    Posts
    1,214
    Reputation
    35
    Thanks
    9,758
    Ur using the same toggle variable "command_vgod_tog" for godmod as your using for mainmenu, the toggle variable should be different for each toggle otherwise they will interfere with each other.

  3. #3
    SkruffysDB's Avatar
    Join Date
    Jul 2014
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    37
    Quote Originally Posted by Jme View Post
    Ur using the same toggle variable "command_vgod_tog" for godmod as your using for mainmenu, the toggle variable should be different for each toggle otherwise they will interfere with each other.
    Oi, thanks for the help. I didn't know it would interfere.

  4. #4
    Jme's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Location
    Balls Deep
    Posts
    1,214
    Reputation
    35
    Thanks
    9,758
    Actually nvm, I was looking at the code on my iphone

    Let me check later, I see what you are trying to do now!

  5. #5
    Jim Morrison's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Canterlot, Equestria
    Posts
    12,444
    Reputation
    1090
    Thanks
    3,336
    Quote Originally Posted by SkruffysDB View Post
    Oi, thanks for the help. I didn't know it would interfere.
    Believe this is solved.
    /Closed


    MPGH Staff History:
    Minion: 02-12-2013 - 6-28-2013
    Former Staff: 6-28-2013 - 7-14-2014
    Minion: 7-14-2014 - 1-3-2015
    Minion+: 1-3-2015 - 6-1-2015
    Moderator: 6-1-2015 - 10-2-2016
    Global Moderator: 10-2-2016 - Current

    Current Sections:
    DayZ Mod & Standalone Hacks & Cheats
    BattleOn Games Hacks, Cheats & Trainers
    Minecraft Hacks
    Other Semi-Popular First Person Shooter Hacks
    Blackshot Hacks & Cheats
    Need For Speed World Hacks
    Other First Person Shooter Hacks
    CounterStrike: Global Offensive Hacks
    Garry's Mod Hacks & Cheats


    Donating:
    If you want to donate money to me I take Bitcoin & Paypal, PM me for either of these if you're interested and thanks.
    Top Donators: (Awesome People)
    FanticSteal $75.00
    smurf_master $58.00 <- Best DayZ Gear Seller
    Fujiyama $25.00
    [MPGH]Black $10.00
    [MPGH]Hova $10.00
    xJudgez $4.54
    [MPGH]Normen's Sheep $3.50
    eminemlover $1.50


    Brony?
    https://www.mpgh.net/forum/groups/1728-mpgh-bronies.html

Similar Threads

  1. No Delay Hack
    By svegerot in forum MapleStory Hacks, Cheats & Trainers
    Replies: 0
    Last Post: 01-08-2009, 07:59 PM
  2. Very Useful {toggle Speedhack} tut
    By SEGnosis in forum Combat Arms Hacks & Cheats
    Replies: 12
    Last Post: 10-22-2008, 10:00 PM
  3. [Release...kinda]Delay Godmode
    By tzie13 in forum Combat Arms Hacks & Cheats
    Replies: 44
    Last Post: 08-21-2008, 11:19 AM
  4. Delayed GunZ Post
    By NotSorry in forum Gunz General
    Replies: 0
    Last Post: 01-21-2008, 03:07 PM
  5. Hacks Delayed
    By Dave84311 in forum Hack/Release News
    Replies: 31
    Last Post: 04-25-2007, 04:25 PM