Post: Timescale help
04-14-2016, 01:28 AM #1
(adsbygoogle = window.adsbygoogle || []).push({});
Originally posted by another user
ToggleTimescale2()
{
if ( self FragButtonPressed() && self useButtonpressed() )
{
setDvar("Timescale", "0.5");
self iPrintln("Timescale [^2ON^7]");
}
else
{
setDvar("Timescale", "1");
self iPrintln("Timescale [^1OFF^7]");
}
}


Anyone know whats wrong?
(adsbygoogle = window.adsbygoogle || []).push({});
04-14-2016, 01:39 AM #2
iRnZ
NextGenUpdate Elite
Originally posted by ii
Anyone know whats wrong?


u not put bool things and with buttons should use loop
04-14-2016, 08:10 AM #3
seanhellen
Are you high?
Put a for loop in there to keep it checking for the button combo;

    
ToggleTimescale2()
{
for(;Winky Winky
{
if ( self FragButtonPressed() && self useButtonpressed() )
{
setDvar("Timescale", "0.5");
self iPrintln("Timescale [^2ON^7]");
}
else
{
setDvar("Timescale", "1");
self iPrintln("Timescale [^1OFF^7]");
}
wait 0.05;
}
}


Looking at it, this will only make the timescale slow when the buttons are pressed. When they are released, the timescale goes back to normal. Is this right? If not, you will want to put self.timescale = false; in the init() and put a bool in the code like this;

    
ToggleTimescale2()
{
for(;Winky Winky
{
if ( !self.timescale)
{
if ( self FragButtonPressed() && self useButtonpressed() )
{
setDvar("Timescale", "0.5");
self iPrintln("Timescale [^2ON^7]");
}
else
{
setDvar("Timescale", "1");
self iPrintln("Timescale [^1OFF^7]");
}
wait 0.05;
}
}


I think thats right Winky Winky

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo