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, 08:48 PM #20
Karoolus
I'm the W@W Menu Guy !
Originally posted by x. View Post
This type of thing was all done for MW2 ages ago, I'm sure if you search the section it will be there somewhere..


why would i do that ?
writing it is the fun part.. why would i take that away ? :p

The following user thanked Karoolus for this useful post:

x_DaftVader_x
08-17-2011, 09:33 PM #21
.Andy
[move]I do it for teh Nonz :carling:[/move]
Originally posted by FeelBadBro View Post
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.


Some nice codes bro !!
08-17-2011, 10:45 PM #22
Correy
I'm the Original
Originally posted by The
Some nice codes bro !!


thanks Winky Winky.
08-17-2011, 10:47 PM #23
Karoolus
I'm the W@W Menu Guy !
Originally posted by FeelBadBro View Post
thats great, btw.. i'm FeelBadBro now Winky Winky:love:


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;
}
}


Originally posted by x. View Post
This type of thing was all done for MW2 ages ago, I'm sure if you search the section it will be there somewhere..


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

The following user thanked Karoolus for this useful post:

08-17-2011, 10:49 PM #24
Correy
I'm the Original
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


it's gorgeous :love:

The following user thanked Correy for this useful post:

Karoolus
08-17-2011, 10:53 PM #25
Karoolus
I'm the W@W Menu Guy !
Originally posted by FeelBadBro View Post
it's gorgeous :love:


it's useless Happy

it's waaaaaay to big to put in a patch :p
i just felt like writing it Happy
08-17-2011, 10:53 PM #26
Correy
I'm the Original
Originally posted by Karoolus View Post
it's useless Happy

it's waaaaaay to big to put in a patch :p
i just felt like writing it Happy


yeah, thats what i do when i'm bored.. took up GFX so not as much modding now.
but erm, i might make a menu out of this Winky Winky

The following user thanked Correy for this useful post:

Karoolus
08-17-2011, 10:55 PM #27
Karoolus
I'm the W@W Menu Guy !
Originally posted by FeelBadBro View Post
yeah, thats what i do when i'm bored.. took up GFX so not as much modding now.
but erm, i might make a menu out of this Winky Winky


menu out of what? :p
08-17-2011, 10:59 PM #28
Correy
I'm the Original
Originally posted by Karoolus View Post
menu out of what? :p


your coding, think i'll be able to make a menu out of it Winky Winky

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo