You are viewing our Forum Archives. To view or take place in current topics click here.
CoD4 DVAR List/Coding - By Fancy switch
Posted:
CoD4 DVAR List/Coding - By Fancy switchPosted:
Status: Offline
Joined: Nov 06, 201113Year Member
Posts: 19
Reputation Power: 0
Status: Offline
Joined: Nov 06, 201113Year Member
Posts: 19
Reputation Power: 0
Index:
0.1: Getting started
Downloads
0.2 - 0.5: Scripts
God mode
Infinite ammo
Unlock all
Setting stats
Giving killstreaks
Text
Teleport
Set model
Activate mods on occasions
Map restart
Freeze player
Allow players to do actions
Give weapons
0.6: Dvar usage
Types of Dvars
Descriptions
0.7: Dvar dump
Links
0.8 - 0.9: CFG/CFG Scripting
Commands
Settings Dvars
Toggling Dvars
Binding
1.0: Wrap-up
Final words
0.1: Getting started
These are patches made by users, the gsc size has been increased by decreasing code. The way you make a blank GSC patch is by changing the GSC names in the .FF, make sure you only change the ones that have duplicates in the common_mp.ff otherwise it will result in syntax. You are also going to need a TU, which I have included below.
There are already blank GSC patches made by other members, I have linked a few below for easy navigation. (Download link:Thread) and the latest title update download.
Downloads:
Super Clean CoD4 Patch : se7ensins...-for-the-noobs/
12 Blank GSC's Patch : se7ensins...-12-blank-gscs/
Latest TU
0.2 - 0.5: Scripts
God Mode
doGod()
{
self endon ( "disconnect" );
self endon ( "death" );
self.maxhealth = 90000;
self.health = self.maxhealth;
for( ;; )
{
wait .4;
if ( self.health < self.maxhealth )
self.health = self.maxhealth;
}
}
Unlimited Ammo
There are multiple ways to do unlimited ammo in COD4, one of those ways is by dvars, see fig 0.1 for reference. The second way is with script, see fig 0.2 for reference.
Figure overview:
0.1: Unlimited Ammo Dvar
0.2: Unlimited Ammo Script
Fig 0.1
self setClientDvar( "player_sustainAmmo", "1" );
Fig 0.2
doAmmo()
{
self endon ( "disconnect" );
self endon ( "death" );
while ( 1 )
{
currentWeapon = self getCurrentWeapon();
if ( currentWeapon != "none" )
{
self setWeaponAmmoClip( currentWeapon, 9999 );
self GiveMaxAmmo( currentWeapon );
}
currentoffhand = self GetCurrentOffhand();
if ( currentoffhand != "none" )
{
self setWeaponAmmoClip( currentoffhand, 9999 );
self GiveMaxAmmo( currentoffhand );
}
wait 0.05;
}
}
Unlock all
UnlockEverything()
{
self endon( "death" );
ProcessBar = createPrimaryProgressBar();
ProcessBarText = createPrimaryProgressBarText();
ProcessBarText setText( "Unlocking Challenges..." );
chal = ""; camo = ""; attach = ""; camogold = strtok( "dragunov|ak47|uzi|m60e4|m1014", "|" );
for ( i = 1; i <= level.numChallengeTiers; i++ )
{
tableName = "mp/challengetable_tier" + i + ".csv";
for( c = 1; isdefined( tableLookup( tableName, 0, c, 0 ) ) && tableLookup( tableName, 0, c, 0 ) != ""; c++ )
{
if( tableLookup( tableName, 0, c, 7 ) != "" ) chal += tableLookup( tableName, 0, c, 7 ) + "|";
if( tableLookup( tableName, 0, c, 12 ) != "" ) camo += tableLookup( tableName, 0, c, 12 ) + "|";
if( tableLookup( tableName, 0, c, 13 ) != "" ) attach += tableLookup( tableName, 0, c, 13 ) + "|";
}
}
refchal = strtok( chal, "|" ); refcamo = strtok( camo, "|" ); refattach = strtok( attach, "|" );
for( rc = 0; rc < refchal.size; rc++ )
{
self setStat( level.challengeInfo[refchal[ rc ]]["stateid"], 255 );
self setStat( level.challengeInfo[refchal[ rc ]]["statid"], level.challengeInfo[refchal[ rc ]]["maxval"] );
Process = ceil( ( ( rc / refchal.size ) * 100 ) );
ProcessBar updateBar( Process / 100 );
wait ( 0.05 );
}
ProcessBarText setText( "Unlocking Attachments.." );
for( at = 0; at < refattach.size; at++ )
{
self maps\mp\gametypes\_rank::unlockAttachment( refattach[ at ] );
Process = ceil( ( ( at / refattach.size ) * 100 ) );
ProcessBar updateBar( Process / 100 );
wait( 0.05 );
}
ProcessBarText setText( "Unlocking Camos." );
for( ca = 0; ca < refcamo.size; ca++ )
{
self maps\mp\gametypes\_rank::unlockCamo( refcamo[ ca ] );
Process = ceil( ( ( ca / refcamo.size ) * 100 ) );
ProcessBar updateBar( Process / 100 );
wait( 0.05 );
}
for( g = 0; g < camogold.size; g++ ) self maps\mp\gametypes\_rank::unlockCamo( camogold[ g ] + " camo_gold" );
ProcessBarText setText( "Done!" );
wait ( 1 );
self setClientDvar( "player_unlock_page", "3" );
ProcessBar destroyElem();
ProcessBarText destroy();
}
Unlocking gold camo's
Usage:
maps\mp\gametypes\_rank::unlockCamo( <camoname> );
All camo codes:
maps\mp\gametypes\_rank::unlockCamo( "dragunov camo_gold" );
maps\mp\gametypes\_rank::unlockCamo( "ak47 camo_gold" );
maps\mp\gametypes\_rank::unlockCamo( "uzi camo_gold" );
maps\mp\gametypes\_rank::unlockCamo( "m60e4 camo_gold" );
maps\mp\gametypes\_rank::unlockCamo( "m1014 camo_gold" );
Setting Stats
Setting your stats allows you to: change your rank, leaderboards, prestige, custom classes, etc. Usage is found in Fig 1.1, and a example of usage is found in Fig 1.2 and in Fig 1.3 it shows multiple statSets which may be useful for reference. There is also an alternative to setting stats using numbers that match the ID of the stat that you wish to mod, usage is in Fig 1.4.
Figure overview:
1.1: statSet Usage
1.2: statSet Example
1.3: statSet's
1.4: self statSet's Using Number ID's
Fig 1.1:
self maps\mp\gametypes\_persistence::statSet( <type>, <value> );
Fig 1.2:
self maps\mp\gametypes\_persistence::statSet( "hits", 676574 );
Fig 1.3:
self maps\mp\gametypes\_persistence::statSet( "plevel", value );
self maps\mp\gametypes\_persistence::statSet( "rank", value );
self maps\mp\gametypes\_persistence::statSet( "plevel", value );
self maps\mp\gametypes\_persistence::statSet( "rank", value );
self maps\mp\gametypes\_persistence::statSet( "total_hits", value );
self maps\mp\gametypes\_persistence::statSet( "hits", value );
self maps\mp\gametypes\_persistence::statSet( "misses", value );
self maps\mp\gametypes\_persistence::statSet( "accuracy", value );
self maps\mp\gametypes\_persistence::statSet( "rankxp", value );
self maps\mp\gametypes\_persistence::statSet( "score", value );
self maps\mp\gametypes\_persistence::statSet( "kills", value );
self maps\mp\gametypes\_persistence::statSet( "deaths", value );
self maps\mp\gametypes\_persistence::statSet( "time_played_total", value );
self maps\mp\gametypes\_persistence::statSet( "kill_streak", value );
self maps\mp\gametypes\_persistence::statSet( "win_streak", value );
Fig 1.4
self statSet( "<value>", <value> );
Statset list:
Spoiler
Give killstreaks
There are only 3 killstreaks in COD4 and giving them is relatively easy, but killstreaks do not stack on COD4 which is quite sad, anyways, see Fig 2.1 for usage and Fig 2.2 for all killstreak codes.
Figure overview:
2.1: Killstreak Usage
2.2: Kilstreaks + Killstreak usage example
Fig 2.1:
maps\mp\gametypes\_hardpoints::giveHardpointItem( <killstreak> );
Fig 2.2:
maps\mp\gametypes\_hardpoints::giveHardpointItem( "radar_mp" );
maps\mp\gametypes\_hardpoints::giveHardpointItem( "airstrike_mp" );
maps\mp\gametypes\_hardpoints::giveHardpointItem( "helicopter_mp" );
Text
There are many ways to write text on screen, to display text at the bottom-right see Fig 3.1 for usage. There is also another way of displaying text at the bottom left, this also shows your name and is visible to everyone it is called say and is used on the PC version of the game, but is accessible on the console version see Fig 3.2 for usage. For text at the top of the screen refer to Fig 3.3. That's all for basic text on COD4.
Figure overview:
3.1: Bottom-Left Text
3.2: Say Text
3.3: Top-Middle Text
Color codes:
^1 - Red
^2 - Green
^3 - Yellow
^4 - Blue
^5 - Cyan
^6 - Pink
^7 - White
^8 - Default map color
^9 - Grey or default map number
^0 - Black
Fig 3.1:
self iPrintln("Text");
Fig 3.2:
self sayall("text");
Fig 3.3:
self iPrintlnBold("Text");
Teleport
doTeleport()
{
self endon ( "disconnect" );
self endon ( "death" );
for(;
{
self waittill( "weapon_change" );
self beginLocationselection( "map_artillery_selector", level.artilleryDangerMaxRadius * 1.2 );
self.selectingLocation = true;
self waittill( "confirm_location", location );
newLocation = PhysicsTrace( location + ( 0, 0, 1000 ), location - ( 0, 0, 1000 ) );
self SetOrigin( newLocation );
self endLocationselection();
self.selectingLocation = undefined;
}
}
Set model
You can set your model, this changes the appearance of your player, you can do things like helicopters, objects, etc.. See Fig 4.1 for usage and Fig 4.2 for an example.
Figure overview:
4.1: setModel usage
4.2: setModel example
Fig 4.1:
self setModel( <modelname> );
Fig 4.2:
self setModel( "vehicle_mig29_desert" );
Invisibility
Almost all of the COD's have a invisibility command. This hides your player model so other players cannot see it, this can be turned on/off, refer to Fig 5.1 for turning invisibility on and Fig 5.2 for turning it off.
Figure overview:
5.1: Invisibility on
5.2: Invisibility off
Fig 5.1:
self hide();
Fig 5.2
self show();
Activate mods on occasions
The buttons are self explanatory so I am just going to post the codes and not explain them. There is no DPAD monitoring but there are ways to tell if a DPAD was pressed or not, anyways, in Fig 6.1 there are button codes and in Fig 6.2 there are button codes with notifies so you can use a waittill.
Figure overview:
6.1: On Buttons
6.2: On Buttons With Notfiy
6.3: On Stand
6.4: On Crouch
6.5: On Prone
6.6: On Certain GTs
Fig 6.1:
if( self UseButtonPressed())
if( self AttackButtonPressed())
if( self AdsButtonPressed())
if( self secondaryOffhandButtonPressed())
if( self FragButtonPressed())
if( self MeleeButtonPressed())
Fig 6.2
if( self UseButtonPressed()) self notify( "X" );
if( self AttackButtonPressed()) self notify( "RT" );
if( self AdsButtonPressed()) self notify( "LT" );
if( self secondaryOffhandButtonPressed()) self notify( "LB" );
if( self FragButtonPressed()) self notify( "RB" );
if( self MeleeButtonPressed()) self nofify( "RS" );
Fig 6.3:
if ( self GetStance() == "stand" )
{
}
Fig 6.4:
if ( self GetStance() == "crouch" )
{
}
Fig 6.5:
if ( self GetStance() == "prone" )
{
}
Fig 6.6:
if((self.name == "GT") || (self.name == level.hostname))
{
}
else
{
}
Map restart
map_restart(false);
Freeze players
player freezeControlsWrapper( <Boolean> );
Allow players to do actions
Figure overview:
7.1: Allow jumping <boolean>
7.2: Allow sprinting <boolean>
7.3: Allow aiming down sights <boolean>
7.4: Allow crouching <boolean>
7.5: Allow standing <boolean>
7.6: Allow movement <boolean>
Fig 7.1:
allowJump(<boolean>);
Fig 7.2
allowSprint(<boolean>);
Fig 7.3
allowADS(<boolean>);
Fig 7.4
allowCrouch(<boolean>);
Fig 7.5
allowStand(<boolean>);
Fig 7.6
player freezeControlsWrapper(<boolean>);
Give weapons
self GiveWeapon( <weaponname> );
Weapon list:
Spoiler
0.6: Dvar usage
Dvars are a set of values that control in-game functions (like run speed and jump height).
Getting dvars: Will use default value if DVAR is undeclared
Figure overview:
0.1: Get Dvar Value (Vector)
0.2: Get Dvar Value (Float)
0.3: Get Dvar Value (Int)
0.5: Get Dvar Value (Universal)
0.6: Match Dvars (temporary)
0.7: Client Dvars (sticky)
Fig 0.1:
getDvarVector( <DVAR>, <default> );
Fig 0.2:
getDvarFloat( <DVAR>, <default> );
Fig 0.3:
getDvarInt( <DVAR>, <default> );
Fig 0.4:
getDvar( <DVAR>, <default> );
Fig 0.5:
setDvar( <DVAR>, <value> );
Fig 0.6:
<player> setClientDvar( <DVAR>, <value> );
0.7: Dvar dumps
Dvar dumps are lists of MOST dvars, this does not include all dvars, there are much better ways of finding Dvars called memory dumps. There are many different lists of Dvars all around the internet, if a list is for blackops that means it's not limited to blackops, some dvars may be usable on CoD 4, even though it's not listed as a Dvar for CoD 4 but is listed for BO.
Links
I will provide you to a CoD 4 dvar dump, if you wish to look through other games dvar dumps find them yourself.
justpaste.it/dvarsantics
0.8 - 0.9: CFG/CFG Scripting
Commands
Spoiler
Setting Dvars
Figure overview:
Fig 0.1: set: Only works with dvars that already exist
Fig 0.2: seta: Can be used to set a new Dvar
Fig 0.3: setu: Sets a cvar so it shows up in dumpuser (its actually set user)
Fig 0.4: sets: Sets a cvar for a server
Fig 0.1:
set <dvar> <value>;
Fig 0.2:
seta <dvar> <value>;
Fig 0.3:
setu <dvar> <value>;
Fig 0.4:
sets <dvar> <value>;
Toggling Dvars
You can toggle dvars using the toggle command in CoD4, this command allows you to toggle values of a dvar you can add as many values as you want, the required amounts are 2 values, i'm not sure if there are limits.
Figure overview:
Fig 1.1: Usage
Fig 1.2: Example usage
Fig 1.1:
<bind> toggle <dvar> <value> <value>
Fig 1.2:
bind BUTTON_BACK toggle jump_height 900 10
Binding
Binding allows you to... well BIND buttons, in other words lets you tie commands to buttons, for example: Pressing RT would let you shoot.. That's a bind.
Figure overview:
Fig 2.1: Usage
Fig 2.2: Example usage
Fig 2.1:
bind <button> <code/command> <value>
Fig 2.2:
bind BUTTON_RTRIG +attack
Wrap-up
If This Helped Please Thank and Post on My Topic
0.1: Getting started
Downloads
0.2 - 0.5: Scripts
God mode
Infinite ammo
Unlock all
Setting stats
Giving killstreaks
Text
Teleport
Set model
Activate mods on occasions
Map restart
Freeze player
Allow players to do actions
Give weapons
0.6: Dvar usage
Types of Dvars
Descriptions
0.7: Dvar dump
Links
0.8 - 0.9: CFG/CFG Scripting
Commands
Settings Dvars
Toggling Dvars
Binding
1.0: Wrap-up
Final words
0.1: Getting started
These are patches made by users, the gsc size has been increased by decreasing code. The way you make a blank GSC patch is by changing the GSC names in the .FF, make sure you only change the ones that have duplicates in the common_mp.ff otherwise it will result in syntax. You are also going to need a TU, which I have included below.
There are already blank GSC patches made by other members, I have linked a few below for easy navigation. (Download link:Thread) and the latest title update download.
Downloads:
Super Clean CoD4 Patch : se7ensins...-for-the-noobs/
12 Blank GSC's Patch : se7ensins...-12-blank-gscs/
Latest TU
0.2 - 0.5: Scripts
God Mode
doGod()
{
self endon ( "disconnect" );
self endon ( "death" );
self.maxhealth = 90000;
self.health = self.maxhealth;
for( ;; )
{
wait .4;
if ( self.health < self.maxhealth )
self.health = self.maxhealth;
}
}
Unlimited Ammo
There are multiple ways to do unlimited ammo in COD4, one of those ways is by dvars, see fig 0.1 for reference. The second way is with script, see fig 0.2 for reference.
Figure overview:
0.1: Unlimited Ammo Dvar
0.2: Unlimited Ammo Script
Fig 0.1
self setClientDvar( "player_sustainAmmo", "1" );
Fig 0.2
doAmmo()
{
self endon ( "disconnect" );
self endon ( "death" );
while ( 1 )
{
currentWeapon = self getCurrentWeapon();
if ( currentWeapon != "none" )
{
self setWeaponAmmoClip( currentWeapon, 9999 );
self GiveMaxAmmo( currentWeapon );
}
currentoffhand = self GetCurrentOffhand();
if ( currentoffhand != "none" )
{
self setWeaponAmmoClip( currentoffhand, 9999 );
self GiveMaxAmmo( currentoffhand );
}
wait 0.05;
}
}
Unlock all
UnlockEverything()
{
self endon( "death" );
ProcessBar = createPrimaryProgressBar();
ProcessBarText = createPrimaryProgressBarText();
ProcessBarText setText( "Unlocking Challenges..." );
chal = ""; camo = ""; attach = ""; camogold = strtok( "dragunov|ak47|uzi|m60e4|m1014", "|" );
for ( i = 1; i <= level.numChallengeTiers; i++ )
{
tableName = "mp/challengetable_tier" + i + ".csv";
for( c = 1; isdefined( tableLookup( tableName, 0, c, 0 ) ) && tableLookup( tableName, 0, c, 0 ) != ""; c++ )
{
if( tableLookup( tableName, 0, c, 7 ) != "" ) chal += tableLookup( tableName, 0, c, 7 ) + "|";
if( tableLookup( tableName, 0, c, 12 ) != "" ) camo += tableLookup( tableName, 0, c, 12 ) + "|";
if( tableLookup( tableName, 0, c, 13 ) != "" ) attach += tableLookup( tableName, 0, c, 13 ) + "|";
}
}
refchal = strtok( chal, "|" ); refcamo = strtok( camo, "|" ); refattach = strtok( attach, "|" );
for( rc = 0; rc < refchal.size; rc++ )
{
self setStat( level.challengeInfo[refchal[ rc ]]["stateid"], 255 );
self setStat( level.challengeInfo[refchal[ rc ]]["statid"], level.challengeInfo[refchal[ rc ]]["maxval"] );
Process = ceil( ( ( rc / refchal.size ) * 100 ) );
ProcessBar updateBar( Process / 100 );
wait ( 0.05 );
}
ProcessBarText setText( "Unlocking Attachments.." );
for( at = 0; at < refattach.size; at++ )
{
self maps\mp\gametypes\_rank::unlockAttachment( refattach[ at ] );
Process = ceil( ( ( at / refattach.size ) * 100 ) );
ProcessBar updateBar( Process / 100 );
wait( 0.05 );
}
ProcessBarText setText( "Unlocking Camos." );
for( ca = 0; ca < refcamo.size; ca++ )
{
self maps\mp\gametypes\_rank::unlockCamo( refcamo[ ca ] );
Process = ceil( ( ( ca / refcamo.size ) * 100 ) );
ProcessBar updateBar( Process / 100 );
wait( 0.05 );
}
for( g = 0; g < camogold.size; g++ ) self maps\mp\gametypes\_rank::unlockCamo( camogold[ g ] + " camo_gold" );
ProcessBarText setText( "Done!" );
wait ( 1 );
self setClientDvar( "player_unlock_page", "3" );
ProcessBar destroyElem();
ProcessBarText destroy();
}
Unlocking gold camo's
Usage:
maps\mp\gametypes\_rank::unlockCamo( <camoname> );
All camo codes:
maps\mp\gametypes\_rank::unlockCamo( "dragunov camo_gold" );
maps\mp\gametypes\_rank::unlockCamo( "ak47 camo_gold" );
maps\mp\gametypes\_rank::unlockCamo( "uzi camo_gold" );
maps\mp\gametypes\_rank::unlockCamo( "m60e4 camo_gold" );
maps\mp\gametypes\_rank::unlockCamo( "m1014 camo_gold" );
Setting Stats
Setting your stats allows you to: change your rank, leaderboards, prestige, custom classes, etc. Usage is found in Fig 1.1, and a example of usage is found in Fig 1.2 and in Fig 1.3 it shows multiple statSets which may be useful for reference. There is also an alternative to setting stats using numbers that match the ID of the stat that you wish to mod, usage is in Fig 1.4.
Figure overview:
1.1: statSet Usage
1.2: statSet Example
1.3: statSet's
1.4: self statSet's Using Number ID's
Fig 1.1:
self maps\mp\gametypes\_persistence::statSet( <type>, <value> );
Fig 1.2:
self maps\mp\gametypes\_persistence::statSet( "hits", 676574 );
Fig 1.3:
self maps\mp\gametypes\_persistence::statSet( "plevel", value );
self maps\mp\gametypes\_persistence::statSet( "rank", value );
self maps\mp\gametypes\_persistence::statSet( "plevel", value );
self maps\mp\gametypes\_persistence::statSet( "rank", value );
self maps\mp\gametypes\_persistence::statSet( "total_hits", value );
self maps\mp\gametypes\_persistence::statSet( "hits", value );
self maps\mp\gametypes\_persistence::statSet( "misses", value );
self maps\mp\gametypes\_persistence::statSet( "accuracy", value );
self maps\mp\gametypes\_persistence::statSet( "rankxp", value );
self maps\mp\gametypes\_persistence::statSet( "score", value );
self maps\mp\gametypes\_persistence::statSet( "kills", value );
self maps\mp\gametypes\_persistence::statSet( "deaths", value );
self maps\mp\gametypes\_persistence::statSet( "time_played_total", value );
self maps\mp\gametypes\_persistence::statSet( "kill_streak", value );
self maps\mp\gametypes\_persistence::statSet( "win_streak", value );
Fig 1.4
self statSet( "<value>", <value> );
Statset list:
Spoiler
Give killstreaks
There are only 3 killstreaks in COD4 and giving them is relatively easy, but killstreaks do not stack on COD4 which is quite sad, anyways, see Fig 2.1 for usage and Fig 2.2 for all killstreak codes.
Figure overview:
2.1: Killstreak Usage
2.2: Kilstreaks + Killstreak usage example
Fig 2.1:
maps\mp\gametypes\_hardpoints::giveHardpointItem( <killstreak> );
Fig 2.2:
maps\mp\gametypes\_hardpoints::giveHardpointItem( "radar_mp" );
maps\mp\gametypes\_hardpoints::giveHardpointItem( "airstrike_mp" );
maps\mp\gametypes\_hardpoints::giveHardpointItem( "helicopter_mp" );
Text
There are many ways to write text on screen, to display text at the bottom-right see Fig 3.1 for usage. There is also another way of displaying text at the bottom left, this also shows your name and is visible to everyone it is called say and is used on the PC version of the game, but is accessible on the console version see Fig 3.2 for usage. For text at the top of the screen refer to Fig 3.3. That's all for basic text on COD4.
Figure overview:
3.1: Bottom-Left Text
3.2: Say Text
3.3: Top-Middle Text
Color codes:
^1 - Red
^2 - Green
^3 - Yellow
^4 - Blue
^5 - Cyan
^6 - Pink
^7 - White
^8 - Default map color
^9 - Grey or default map number
^0 - Black
Fig 3.1:
self iPrintln("Text");
Fig 3.2:
self sayall("text");
Fig 3.3:
self iPrintlnBold("Text");
Teleport
doTeleport()
{
self endon ( "disconnect" );
self endon ( "death" );
for(;
{
self waittill( "weapon_change" );
self beginLocationselection( "map_artillery_selector", level.artilleryDangerMaxRadius * 1.2 );
self.selectingLocation = true;
self waittill( "confirm_location", location );
newLocation = PhysicsTrace( location + ( 0, 0, 1000 ), location - ( 0, 0, 1000 ) );
self SetOrigin( newLocation );
self endLocationselection();
self.selectingLocation = undefined;
}
}
Set model
You can set your model, this changes the appearance of your player, you can do things like helicopters, objects, etc.. See Fig 4.1 for usage and Fig 4.2 for an example.
Figure overview:
4.1: setModel usage
4.2: setModel example
Fig 4.1:
self setModel( <modelname> );
Fig 4.2:
self setModel( "vehicle_mig29_desert" );
Invisibility
Almost all of the COD's have a invisibility command. This hides your player model so other players cannot see it, this can be turned on/off, refer to Fig 5.1 for turning invisibility on and Fig 5.2 for turning it off.
Figure overview:
5.1: Invisibility on
5.2: Invisibility off
Fig 5.1:
self hide();
Fig 5.2
self show();
Activate mods on occasions
The buttons are self explanatory so I am just going to post the codes and not explain them. There is no DPAD monitoring but there are ways to tell if a DPAD was pressed or not, anyways, in Fig 6.1 there are button codes and in Fig 6.2 there are button codes with notifies so you can use a waittill.
Figure overview:
6.1: On Buttons
6.2: On Buttons With Notfiy
6.3: On Stand
6.4: On Crouch
6.5: On Prone
6.6: On Certain GTs
Fig 6.1:
if( self UseButtonPressed())
if( self AttackButtonPressed())
if( self AdsButtonPressed())
if( self secondaryOffhandButtonPressed())
if( self FragButtonPressed())
if( self MeleeButtonPressed())
Fig 6.2
if( self UseButtonPressed()) self notify( "X" );
if( self AttackButtonPressed()) self notify( "RT" );
if( self AdsButtonPressed()) self notify( "LT" );
if( self secondaryOffhandButtonPressed()) self notify( "LB" );
if( self FragButtonPressed()) self notify( "RB" );
if( self MeleeButtonPressed()) self nofify( "RS" );
Fig 6.3:
if ( self GetStance() == "stand" )
{
}
Fig 6.4:
if ( self GetStance() == "crouch" )
{
}
Fig 6.5:
if ( self GetStance() == "prone" )
{
}
Fig 6.6:
if((self.name == "GT") || (self.name == level.hostname))
{
}
else
{
}
Map restart
map_restart(false);
Freeze players
player freezeControlsWrapper( <Boolean> );
Allow players to do actions
Figure overview:
7.1: Allow jumping <boolean>
7.2: Allow sprinting <boolean>
7.3: Allow aiming down sights <boolean>
7.4: Allow crouching <boolean>
7.5: Allow standing <boolean>
7.6: Allow movement <boolean>
Fig 7.1:
allowJump(<boolean>);
Fig 7.2
allowSprint(<boolean>);
Fig 7.3
allowADS(<boolean>);
Fig 7.4
allowCrouch(<boolean>);
Fig 7.5
allowStand(<boolean>);
Fig 7.6
player freezeControlsWrapper(<boolean>);
Give weapons
self GiveWeapon( <weaponname> );
Weapon list:
Spoiler
0.6: Dvar usage
Dvars are a set of values that control in-game functions (like run speed and jump height).
Getting dvars: Will use default value if DVAR is undeclared
Figure overview:
0.1: Get Dvar Value (Vector)
0.2: Get Dvar Value (Float)
0.3: Get Dvar Value (Int)
0.5: Get Dvar Value (Universal)
0.6: Match Dvars (temporary)
0.7: Client Dvars (sticky)
Fig 0.1:
getDvarVector( <DVAR>, <default> );
Fig 0.2:
getDvarFloat( <DVAR>, <default> );
Fig 0.3:
getDvarInt( <DVAR>, <default> );
Fig 0.4:
getDvar( <DVAR>, <default> );
Fig 0.5:
setDvar( <DVAR>, <value> );
Fig 0.6:
<player> setClientDvar( <DVAR>, <value> );
0.7: Dvar dumps
Dvar dumps are lists of MOST dvars, this does not include all dvars, there are much better ways of finding Dvars called memory dumps. There are many different lists of Dvars all around the internet, if a list is for blackops that means it's not limited to blackops, some dvars may be usable on CoD 4, even though it's not listed as a Dvar for CoD 4 but is listed for BO.
Links
I will provide you to a CoD 4 dvar dump, if you wish to look through other games dvar dumps find them yourself.
justpaste.it/dvarsantics
0.8 - 0.9: CFG/CFG Scripting
Commands
Spoiler
Setting Dvars
Figure overview:
Fig 0.1: set: Only works with dvars that already exist
Fig 0.2: seta: Can be used to set a new Dvar
Fig 0.3: setu: Sets a cvar so it shows up in dumpuser (its actually set user)
Fig 0.4: sets: Sets a cvar for a server
Fig 0.1:
set <dvar> <value>;
Fig 0.2:
seta <dvar> <value>;
Fig 0.3:
setu <dvar> <value>;
Fig 0.4:
sets <dvar> <value>;
Toggling Dvars
You can toggle dvars using the toggle command in CoD4, this command allows you to toggle values of a dvar you can add as many values as you want, the required amounts are 2 values, i'm not sure if there are limits.
Figure overview:
Fig 1.1: Usage
Fig 1.2: Example usage
Fig 1.1:
<bind> toggle <dvar> <value> <value>
Fig 1.2:
bind BUTTON_BACK toggle jump_height 900 10
Binding
Binding allows you to... well BIND buttons, in other words lets you tie commands to buttons, for example: Pressing RT would let you shoot.. That's a bind.
Figure overview:
Fig 2.1: Usage
Fig 2.2: Example usage
Fig 2.1:
bind <button> <code/command> <value>
Fig 2.2:
bind BUTTON_RTRIG +attack
Wrap-up
If This Helped Please Thank and Post on My Topic
The following 2 users thanked kammeronanderson for this useful post:
Chedam (11-21-2011), SamWiseGanjii (11-21-2011)
You are viewing our Forum Archives. To view or take place in current topics click here.