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, 12:41 AM #2
Default Avatar
Newelly
Guest
Originally posted by Correy 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.


could do with asking you something on msn Cool Man (aka Tustin)

//i need to learn gsc statements :FU: nice work anyways deserve my thanks :bro:
08-17-2011, 05:11 AM #3
Correy
I'm the Original
Originally posted by Newelly View Post
could do with asking you something on msn Cool Man (aka Tustin)

//i need to learn gsc statements :FU: nice work anyways deserve my thanks :bro:


releasing my two new menu's, maybe a few more scripts then i'm done :fa:

The following user thanked Correy for this useful post:

08-17-2011, 05:27 AM #4
this looks Sweet Man! You Deserve my thanks Awesome face
08-17-2011, 05:27 AM #5
Correy
I'm the Original
Originally posted by trizyyboi View Post
i always get confused with rank


what you mean, with rank ?
08-17-2011, 05:53 AM #6
Karoolus
I'm the W@W Menu Guy !
all the toggles with the for loop will go to the highest value if you press the button only once..

if( anybuttonpressed())
{
for loop here ? it'll execute all the values by pressing the button once.
}

use a waittill & a notify to change the values

---------- Post added at 07:53 AM ---------- Previous post was at 07:34 AM ----------

something like this could work as well:

    Toggle_Dvar()
{
BG = createIcon( "black", 650, 30 );
BG.hidewheninmenu = true;
BG setPoint( "TOP", undefined, 0, 10 );
BG.alpha = .2;
BG.sort = 0;
input = self createFontString( "objective", 1.6, self);
input.hidewheninmenu = true;
input setPoint( "TOP", undefined, 0, 10 );
input.sort = 0.5;
i = 0;
dvars = StrTok("...............................","|"); //add dvars you want to toggle here
changed = true;
while(1)
{
value = GetDvar(dvars[i]); //start the toggle from the current value
if(self AttackButtonPressed()) //dvar value++
{
value++;
changed = true;
wait .2;
}
if(self AdsButtonPressed()) //dvar value--
{
value--;
changed = true;
wait .2;
}
if(self UseButtonPressed()) //set the dvar
{
SetDvar(dvars[i],value);
changed = true;
wait .2;
}
if(self FragButtonPressed()) //change dvar
{
i++;
changed = true;
wait .2;
}
if(changed) //change fontstring when value or dvar updated
{
input SetText("" + dvars[i] + ": " + value + "");
changed = false;
}
wait .05;
}
}


^^
08-17-2011, 01:09 PM #7
Correy
I'm the Original
Originally posted by Karoolus View Post
all the toggles with the for loop will go to the highest value if you press the button only once..

if( anybuttonpressed())
{
for loop here ? it'll execute all the values by pressing the button once.
}

use a waittill & a notify to change the values

---------- Post added at 07:53 AM ---------- Previous post was at 07:34 AM ----------

something like this could work as well:

    Toggle_Dvar()
{
BG = createIcon( "black", 650, 30 );
BG.hidewheninmenu = true;
BG setPoint( "TOP", undefined, 0, 10 );
BG.alpha = .2;
BG.sort = 0;
input = self createFontString( "objective", 1.6, self);
input.hidewheninmenu = true;
input setPoint( "TOP", undefined, 0, 10 );
input.sort = 0.5;
i = 0;
dvars = StrTok("...............................","|"); //add dvars you want to toggle here
changed = true;
while(1)
{
value = GetDvar(dvars[i]); //start the toggle from the current value
if(self AttackButtonPressed()) //dvar value++
{
value++;
changed = true;
wait .2;
}
if(self AdsButtonPressed()) //dvar value--
{
value--;
changed = true;
wait .2;
}
if(self UseButtonPressed()) //set the dvar
{
SetDvar(dvars[i],value);
changed = true;
wait .2;
}
if(self FragButtonPressed()) //change dvar
{
i++;
changed = true;
wait .2;
}
if(changed) //change fontstring when value or dvar updated
{
input SetText("" + dvars[i] + ": " + value + "");
changed = false;
}
wait .05;
}
}


^^


add a simple for statement and it's sorted Winky Winky
08-17-2011, 01:15 PM #8
Default Avatar
Newelly
Guest
Originally posted by FeelBadBro View Post
releasing my two new menu's, maybe a few more scripts then i'm done :fa:


i see your finally up - come on aim/msn...

yeah thanks for learning me teh statements Winky Winky im going to be working on them...

:love:
nuff love for you and blackstorm
08-17-2011, 02:53 PM #9
Karoolus
I'm the W@W Menu Guy !
Originally posted by FeelBadBro View Post
add a simple for statement and it's sorted Winky Winky


?
add a for statement where ?
08-17-2011, 03:06 PM #10
You can just put the button command INSIDE the for loop, then it will count once every time you press the button and then wait until you press it again..

Same effect as Karoolus's version but different method..

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo