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-21-2011, 12:28 AM #38
Correy
I'm the Original
Originally posted by x. View Post
I've re written my patch and added some new stuff...


any tips of what that may be Winky Winky?

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo