Post: [Scripts] - A Few Shortened Toggle Codes.
08-17-2011, 12:37 AM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({}); these are very compressed, using the for statement.. they toggle not just certian numbers but ever number which it's range too. e.g. jump height from 60 - 999

Toggle Jump Height :
    
if(self fragButtonPressed())
{
for(j=60;j<=999;j++)
{
setDvar("jump_height", j);
self iPrintln("Jump Height : ", j);
wait .05;
}
else if(self SecondaryOffhandButtonPressed())
{
for(j=60;j>=998;j--)
{
setDvar("jump_height", j);
self iPrintln("Jump Height : ", j);
wait .05;
}
}


Toggle Sprint Speed :
    
if(self fragButtonPressed())
{
for(s=60;s<=999;s++)
{
setDvar("g_speed", s);
self iPrintln("Sprint Speed : ", s);
wait .05;
}
}
else if (self SecondaryOffhandButtonPressed())
{
for(s=60;s>=999;s--)
{
setDvar("g_speed", s);
self iPrintln("Sprint Speed : ", s);
wait .05;
}
}


Toggle Gravity :
    
if(self fragButtonPressed())
{
for(g=800;i<=0;i--)
{
setDvar("g_gravity", g);
self iPrintln("Gravity : ", g);
wait .05;
}
}
else if (SecondaryOffhandButtonPressed())
{
for(g=800;i>=0;i++)
{
setDvar("g_gravity", g);
self iPrintln("Gravity : ", g);
wait .05;
}
}


Toggle Prestige Rank:
    
if(self fragButtonPressed())
{
for(p=0;p<=11;p++)
{
self maps\mp\gametypes\_persistence::statSet( "plevel", p);
self iPrintln("Prestige : ", p);
wait .05;
}
else if (self SecondaryOffhandButtonPressed())
{
for(p=0;p>=11;p--)
{
self maps\mp\gametypes\_persistence::statSet( "plevel", p);
self iPrintln("Prestige : ",p);
wait .05;
}
}


also, here's another toggle all say's code using the strTok:
    
Toggle Sounds()
{
self endon("disconnect");
self endon("death");
Sounds=""mp_cmd_followme mp_cmd_movein mp_cmd_fallback mp_cmd_suppressfire mp_cmd_attackrightflank mp_cmd_holdposition mp_cmd_regroup mp_stm_enemyspotted mp_stm_iminposition mp_stm_areasecure mp_stm_watchsix mp_stm_sniper mp_stm_needreinforcements mp_stm_yessir mp_rsp_nosir mp_rsp_onmyway mp_rsp_sorry mp_rsp_greatshot mp_rsp_comeon;
s=strTok(Sounds," ");
i=0;
for(;Winky Winky
{
self doQuickMessage( s[i], 0.5 );
self iprintln("Played Sound: "+s[i]);
i++;
if(i>=s.size)i=0;
wait 1;
}
}


yes, i coded these my self. thanks to blackstorm with pointing my in the right direction of GSC for statements.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 4 users say thank you to Correy for this useful post:

.Andy, Nolzado, x-Roniie-x.
08-17-2011, 11:01 PM #29
Karoolus
I'm the W@W Menu Guy !
Originally posted by FeelBadBro View Post
your coding, think i'll be able to make a menu out of it Winky Winky


do with it what you want :p
have fun Winky Winky
time for me to go to bed, i have to be at work in 6hrs :(
08-18-2011, 05:46 AM #30
Originally posted by Karoolus View Post
look at this Winky Winky




    Add_Dvar( name, increment, min, max)
{
i = level.dvar.size;
level.dvar[i]["name"] = name;
level.dvar[i]["increment"] = increment;
level.dvar[i]["min"] = min;
level.dvar[i]["max"] = max;
}

Choose_Dvar()
{
level.dvar = [];
self Add_Dvar("jump_height",8,1,999);
self Add_Dvar("g_gravity",100,0,1000);
self Add_Dvar("timescale",0.1,0.1,4.5);
self Add_Dvar("g_speed",30,1,500);
cur = 0;
for(;Winky Winky
{
if(self FragButtonPressed())
{
count = 0;
while(self FragButtonPressed())
{
count++;
if(count == 6)
{
self notify("stop_dvar_monitor");
self notify("done");
wait .2;
self thread Toggle_Dvar(level.dvar[cur]["name"],level.dvar[cur]["increment"],level.dvar[cur]["min"],level.dvar[cur]["max"]);
}
wait .25;
}
cur++;
if(cur >= level.dvar.size)
{
cur = 0;
}
}
wait .05;
}
}

Toggle_Dvar( name, increment, min, max )
{
self endon("stop_dvar_monitor");
self endon("death");
BG = createIcon( "black", 650, 30 );
BG.hidewheninmenu = true;
BG setPoint( "TOP", undefined, 0, 10 );
BG.alpha = .2;
BG.sort = 0;
input = createFontString( "objective", 1.6, self);
input.hidewheninmenu = true;
input setPoint( "TOP", undefined, 0, 10 );
input.sort = 0.5;
cur = GetDvarInt( name );
self.setting_dvar = true;
input SetText("^9Dvar: ^3" + name + "^9 | Value: ^3" + cur);
self thread On_Death_Destroy(BG,input);
self thread MonitorChoice(increment);
self disableweapons();
while(self.setting_dvar)
{
self waittill("change_value");
cur = cur + self.increment;
if(cur > max)
{
cur = min;
}
if(cur < min)
{
cur = max;
}
SetDvar( name, cur);
//input SetText(cur);
input SetText("^9Dvar: ^3" + name + "^9 | Value: ^3" + cur);
}
self enableweapons();
SetDvar(name, cur);
self notify("stop_dvar_monitor");
}

On_Death_Destroy(hud1,hud2)
{
self waittill_any("death","done");
hud1 Destroy();
hud2 Destroy();
}

MonitorChoice(increment)
{
self endon("stop_dvar_monitor");
self endon("death");
for(;Winky Winky
{
if(self UseButtonPressed())
{
self.setting_dvar = false;
self notify("done");
wait .5;
}
if(self AttackButtonPressed())
{
self.increment = increment;
self notify("change_value");
wait .2;
}
if(self AdsButtonPressed())
{
self.increment = 0-increment;
self notify("change_value");
wait .2;
}
wait .05;
}
}




look at the script i wrote.. CTRL+F wouldn't be half the pleasure i got from writing this Happy
& i know it's WAAAAAAY too long to use in a patch, but i just like to code things.. :p


Very true... I think you could do the same thing with less code though..
08-18-2011, 05:49 AM #31
x10GkxDaZz
Save Point
yh but where do i put these codes im confused i dont no hacking very well and karoolus ur a FCKING smart guy i tell u that
08-18-2011, 06:09 AM #32
Karoolus
I'm the W@W Menu Guy !
Originally posted by x. View Post
Very true... I think you could do the same thing with less code though..


probably :p
i'll try to shorten it as much as possible tonight Winky Winky

it does work though, it's easy to add dvars (including increment, min value & max value) etc
+ i enjoyed making it Happy

how about you make it shorter Winky Winky
08-18-2011, 08:38 AM #33
looks good Happy
08-18-2011, 05:25 PM #34
Originally posted by Karoolus View Post
probably :p
i'll try to shorten it as much as possible tonight Winky Winky

it does work though, it's easy to add dvars (including increment, min value & max value) etc
+ i enjoyed making it Happy

how about you make it shorter Winky Winky
mmm, not my thing really... I have other things on my mind Cool Man (aka Tustin)
08-18-2011, 09:40 PM #35
Karoolus
I'm the W@W Menu Guy !
Originally posted by x. View Post
mmm, not my thing really... I have other things on my mind Cool Man (aka Tustin)


oh please do enlighten me Winky Winky
08-20-2011, 04:29 PM #36
Correy
I'm the Original
Originally posted by x. View Post
mmm, not my thing really... I have other things on my mind Cool Man (aka Tustin)


aren't you re-making your menu Winky Winky ?
08-20-2011, 04:46 PM #37
Originally posted by FeelBadBro View Post
aren't you re-making your menu Winky Winky ?

I've re written my patch and added some new stuff...

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo