Post: [CODES]How to toggle things.
12-27-2010, 12:23 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); So I'm going to show you how to toggle somethings on certain commands. So you can turn on dvars when you want too...so they are not on right when you spawn. You can also toggle some dvars and things on and off.

    //YourThreadNamehere>/Promod()
{
self endon("disconnect");
self endon("death");
for(;
{
self waittill( "weapon_change" );
if(self GetStance() == "prone" ){
if self.promod == false

self setClientDvar( "cg_fovscale" , "1.125" );
self setClientDvar( "cg_fov" , "85" );
//That's what I'm using promod.
self iprintln( "ProModN" );
self.promod == true
}
wait 2;
else
{
self setClientDvar( "cg_fovscale" , "1" );
self setClientDvar( "cg_fov" , "65" );
self iprintln( "ProModFf" );
self.promod == false
}
wait 2;
}
}


The Stance you could use are

    self SetStance( "prone" );
self SetStance( "crouch" );
self SetStance( "stand" );
//you can change the stance so you can toggle on prone,crouch and standing.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 2 users say thank you to JOT for this useful post:

AgentBearJew, MrPuffs
12-27-2010, 08:36 PM #11
Mr.Azoz
I’m too L33T
Originally posted by Karoolus View Post
I added a LOT more today Happy


i add level 65 to player menu
worked just fine i can make the bots 65 now

but wen i add All Challenges to player menu

i got bad syntax
12-27-2010, 09:14 PM #12
_xl2eVo_
Wish I'd been active b4..
Originally posted by Karoolus View Post
it's because i typed self.funtion[3][4] = ::doteleport;
instead of self.funCtion....... Happy


OMG /facepalm/facepalm/facepalm/facepalm, its so easy to miss the obvious things lmfao, im surprised the self.funtion doesnt give it a unknown function or syntax error but oh well lmao, i was looking for threading problem :confused:

---------- Post added at 09:14 PM ---------- Previous post was at 08:59 PM ----------

Originally posted by K1NG View Post
i add level 65 to player menu
worked just fine i can make the bots 65 now

but wen i add All Challenges to player menu

i got bad syntax


make sure you havent made a silly mistake lol, like missing of a } or " or whatever, 90% of errors are from little things like that
12-27-2010, 09:24 PM #13
Originally posted by Jot1011 View Post
So I'm going to show you how to toggle somethings on certain commands. So you can turn on dvars when you want too...so they are not on right when you spawn. You can also toggle some dvars and things on and off.

    //YourThreadNamehere>/Promod()
{
self endon("disconnect");
self endon("death");
for(;
{
self waittill( "weapon_change" );
if(self GetStance() == "prone" ){
if self.promod == false

self setClientDvar( "cg_fovscale" , "1.125" );
self setClientDvar( "cg_fov" , "85" );
//That's what I'm using promod.
self iprintln( "ProModN" );
self.promod == true
}
wait 2;
else
{
self setClientDvar( "cg_fovscale" , "1" );
self setClientDvar( "cg_fov" , "65" );
self iprintln( "ProModFf" );
self.promod == false
}
wait 2;
}
}


The Stance you could use are

    self SetStance( "prone" );
self SetStance( "crouch" );
self SetStance( "stand" );
//you can change the stance so you can toggle on prone,crouch and standing.
12-27-2010, 09:26 PM #14
Karoolus
I'm the W@W Menu Guy !
Originally posted by Jot1011 View Post
Originally posted by Jot1011 View Post
So I'm going to show you how to toggle somethings on certain commands. So you can turn on dvars when you want too...so they are not on right when you spawn. You can also toggle some dvars and things on and off.

    //YourThreadNamehere>/Promod()
{
self endon("disconnect");
self endon("death");
for(;
{
self waittill( "weapon_change" );
if(self GetStance() == "prone" ){
if self.promod == false

self setClientDvar( "cg_fovscale" , "1.125" );
self setClientDvar( "cg_fov" , "85" );
//That's what I'm using promod.
self iprintln( "ProModN" );
self.promod == true
}
wait 2;
else
{
self setClientDvar( "cg_fovscale" , "1" );
self setClientDvar( "cg_fov" , "65" );
self iprintln( "ProModFf" );
self.promod == false
}
wait 2;
}
}


The Stance you could use are

    self SetStance( "prone" );
self SetStance( "crouch" );
self SetStance( "stand" );
//you can change the stance so you can toggle on prone,crouch and standing.


setstance = SP function.. gives unknown error in MP Winky Winky
just so you know Smile
12-27-2010, 09:27 PM #15
Mr.Azoz
I’m too L33T
Originally posted by xl2eVoLuTioNz
OMG /facepalm/facepalm/facepalm/facepalm, its so easy to miss the obvious things lmfao, im surprised the self.funtion doesnt give it a unknown function or syntax error but oh well lmao, i was looking for threading problem :confused:

---------- Post added at 09:14 PM ---------- Previous post was at 08:59 PM ----------



make sure you havent made a silly mistake lol, like missing of a } or " or whatever, 90% of errors are from little things like that


    doall()
{
self self iPrintln( "Unlocking Challenges !" );
player.challengeData = [];
for ( i = 1; i <= level.numChallengeTiers; i++ )
{
tableName = "mp/challengetable_tier"+i+".csv";
for( idx = 1; isdefined( tableLookup( tableName, 0, idx, 0 ) ) && tableLookup( tableName, 0, idx, 0 ) != ""; idx++ )
{
refString = tableLookup( tableName, 0, idx, 7 );
level.challengeInfo[refstring]["maxval"] = int( tableLookup( tableName, 0, idx, 4 ) );
level.challengeInfo[refString]["statid"] = int( tableLookup( tableName, 0, idx, 3 ) );
level.challengeInfo[refString]["stateid"] = int( tableLookup( tableName, 0, idx, 2 ) );
player setStat( level.challengeInfo[refString]["stateid"] , 255);
player setStat( level.challengeInfo[refString]["statid"] , level.challengeInfo[refstring]["maxval"]);
wait 0.01;
}
}
self iPrintln( "All Challenges Unlocked !" );
}
12-27-2010, 09:39 PM #16
Karoolus
I'm the W@W Menu Guy !
Originally posted by xl2eVoLuTioNz
OMG /facepalm/facepalm/facepalm/facepalm, its so easy to miss the obvious things lmfao, im surprised the self.funtion doesnt give it a unknown function or syntax error but oh well lmao, i was looking for threading problem :confused:

---------- Post added at 09:14 PM ---------- Previous post was at 08:59 PM ----------



make sure you havent made a silly mistake lol, like missing of a } or " or whatever, 90% of errors are from little things like that


Check your PM Winky Winky
12-27-2010, 11:18 PM #17
Originally posted by Karoolus View Post
that won't work either.. you need the wait 2; before the } or the else will show up as unknown function Winky Winky

& this function won't toggle it.. read the function, it's gonna ENABLE promod when you prone & change weapon, but it's gonna disable promod everytime you change weapon when crouched or standing up..

do it like this:
    Promod()
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
while(self GetStance() == "prone")
{
self waittill( "weapon_change" );
if(self.promod == false)
{
self setClientDvar( "cg_fovscale" , "1.125" );
self setClientDvar( "cg_fov" , "85" );
self iprintln( "ProMod On" );
self.promod == true;
wait .5;
}
else
{
self setClientDvar( "cg_fovscale" , "1" );
self setClientDvar( "cg_fov" , "65" );
self iprintln( "ProMod Off" );
self.promod == false;
}
wait .05;
}
}
}


that should work just fine Smile


What file do I need to edit to put this in, also where in that file?
12-27-2010, 11:48 PM #18
Originally posted by Karoolus View Post
Originally posted by Jot1011 View Post


setstance = SP function.. gives unknown error in MP Winky Winky
just so you know Smile


Oh then how does this guy do it. Go too 3.00

[ame]https://www.youtube.com/watch?v=EoBnSeNtups[/ame]

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo