Post: How to hide inprints?
12-02-2016, 01:09 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I'd normally just delete the inprint information, but I want to keep it in for force host. (The force host inprints go on and off like 5 times so I need to see if it's on or not.)

Is there a way to hide inprints or a way to stop force host from spazzing out when turning it on and off?

Thank you Smile
12-02-2016, 01:17 AM #2
daVinciUser
Save Point
yeah, just delete the iprintln's
12-02-2016, 02:28 AM #3
But how do I stop force host from going "on,off,on,off" when I turn it on?
12-02-2016, 02:29 AM #4
Originally posted by daVinciUser View Post
yeah, just delete the iprintln's


But how do I stop force host from going "on,off,on,off" when I turn it on? Is there a way to make it wait a few seconds in between toggling it on and off?
12-07-2016, 07:37 AM #5
Kronos
Former Staff
Originally posted by MrDankiee View Post
I'd normally just delete the inprint information, but I want to keep it in for force host. (The force host inprints go on and off like 5 times so I need to see if it's on or not.)

Is there a way to hide inprints or a way to stop force host from spazzing out when turning it on and off?

Thank you Smile

Status on your issue?
12-07-2016, 12:09 PM #6
anthonything
Space Ninja
Originally posted by Saint
Status on your issue?


anthonything says useful for this awful post

The following user groaned anthonything for this awful post:

Nothingbutbread
12-07-2016, 12:12 PM #7
Kronos
Former Staff
Originally posted by anthonything View Post
anthonything says useful for this awful post


whaat
12-08-2016, 04:30 PM #8
Originally posted by MrDankiee View Post
I'd normally just delete the inprint information, but I want to keep it in for force host. (The force host inprints go on and off like 5 times so I need to see if it's on or not.)

Is there a way to hide inprints or a way to stop force host from spazzing out when turning it on and off?

Thank you Smile


The problem you're haveing is with your toggle function that is being used. My way of fixing this is add an unique endon statement to the begging of the function and a notify statement into each "state" of your toggle. It will prevent it from rapidly switching states. There are other ways to do this as well.
Example of what your code may look like. This has the issues you're having.
    
Toggle()
{
if (self.forcehost == false)
{
self Enableforcehost();
self iprintln("^5Forcehost ^2Enabled");
self.forcehost = true;
}
if (self.forcehost == true)
{
self Disableforcehost();
self iprintln("^5Forcehost ^1Disabled");
self.forcehost = false;
}
}

Here is an example of the endons and notifys statements put in. Problem fixed.
    
FixedToggle()
{
self endon("Toggled_Force_host_:>");
if (self.forcehost == false)
{
self Enableforcehost();
self iprintln("^5Forcehost ^2Enabled");
self.forcehost = true;
self notify("Toggled_Force_host_:>");
}
if (self.forcehost == true)
{
self Disableforcehost();
self iprintln("^5Forcehost ^1Disabled");
self.forcehost = false;
self notify("Toggled_Force_host_:>");
}
}

The following user thanked Nothingbutbread for this useful post:

MrDankiee

The following user groaned Nothingbutbread for this awful post:

anthonything
12-08-2016, 04:46 PM #9
anthonything
Space Ninja
Originally posted by Nothingbutbread View Post
The problem you're haveing is with your toggle function that is being used. My way of fixing this is add an unique endon statement to the begging of the function and a notify statement into each "state" of your toggle. It will prevent it from rapidly switching states. There are other ways to do this as well.
Example of what your code may look like. This has the issues you're having.
    
Toggle()
{
if (self.forcehost == false)
{
self Enableforcehost();
self iprintln("^5Forcehost ^2Enabled");
self.forcehost = true;
}
if (self.forcehost == true)
{
self Disableforcehost();
self iprintln("^5Forcehost ^1Disabled");
self.forcehost = false;
}
}

Here is an example of the endons and notifys statements put in. Problem fixed.
    
FixedToggle()
{
self endon("Toggled_Force_host_:>");
if (self.forcehost == false)
{
self Enableforcehost();
self iprintln("^5Forcehost ^2Enabled");
self.forcehost = true;
self notify("Toggled_Force_host_:>");
}
if (self.forcehost == true)
{
self Disableforcehost();
self iprintln("^5Forcehost ^1Disabled");
self.forcehost = false;
self notify("Toggled_Force_host_:>");
}
}


Is there a reason you groaned me?
12-08-2016, 04:49 PM #10
anthonything
Space Ninja
Originally posted by Nothingbutbread View Post
The problem you're haveing is with your toggle function that is being used. My way of fixing this is add an unique endon statement to the begging of the function and a notify statement into each "state" of your toggle. It will prevent it from rapidly switching states. There are other ways to do this as well.
Example of what your code may look like. This has the issues you're having.
    
Toggle()
{
if (self.forcehost == false)
{
self Enableforcehost();
self iprintln("^5Forcehost ^2Enabled");
self.forcehost = true;
}
if (self.forcehost == true)
{
self Disableforcehost();
self iprintln("^5Forcehost ^1Disabled");
self.forcehost = false;
}
}

Here is an example of the endons and notifys statements put in. Problem fixed.
    
FixedToggle()
{
self endon("Toggled_Force_host_:>");
if (self.forcehost == false)
{
self Enableforcehost();
self iprintln("^5Forcehost ^2Enabled");
self.forcehost = true;
self notify("Toggled_Force_host_:>");
}
if (self.forcehost == true)
{
self Disableforcehost();
self iprintln("^5Forcehost ^1Disabled");
self.forcehost = false;
self notify("Toggled_Force_host_:>");
}
}


Erm. That doesnt work. Good job Not Happy or Sad

OP: Your problem was using the '==' when the var was undefined. Solution below.

    
Toggle_forcehost()
{
self.forcehost = !isdefined(self.forcehost) || !self.forcehost;
if(self.forcehost)
{
self iprintln("Force host enabled");
}
else
{
self iprintln("Force host Disabled");
}
}


And Bread, notifies are stupid to begin with because the endon is never going to be reached... All of these operations will happen within the same frame so the code execution is never canceled.... Instead, make sure your menu only calls it once.
Last edited by anthonything ; 12-08-2016 at 04:54 PM. Reason: He is cluuuueeeleesssss

The following user thanked anthonything for this useful post:

MrDankiee

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo