Post: Some cool little Cod4 dvars and functions (Useful for gamemodes)
02-09-2012, 08:49 PM #1
DlBSY993
There's 0nly 1..
(adsbygoogle = window.adsbygoogle || []).push({}); ..........................................
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked DlBSY993 for this useful post:

Taylor
02-09-2012, 08:55 PM #2
Taylor
Former Black Knight.
Originally posted by DlBSY993 View Post
I was looking through the patch and noticed some cool little things people may not have known about .. So here.


Choose Third person Angle.

Well you know spectator mode on cod4 ? you can swivel the camera 360' degrees around the player model. Here's a Dvar which you can use to set the angle of that camera.

"cg_thirdPersonAngle", 356 <<This is the Degree of the angle you would like around the player.


Choose who you can hear

"cg_deadChatWithDead", "0",
"cg_deadChatWithTeam", "1",
"cg_deadHearTeamLiving", "1",
"cg_deadHearAllLiving", "0",
"cg_everyoneHearsEveryone", "0"

Headshot sound Happy

self playSound( "bullet_impact_headshot_2" );

Some Nice functions

self giveWeapon( "Vaders_Dildo_mp" );
self giveMaxAmmo( "xYARDSALEx's_Buttplug_mp" ); :shh:
self switchToWeapon( "beretta_mp" );
self GiveWeapon( grenadeTypePrimary );
self SetWeaponAmmoClip( grenadeTypePrimary, 0 );
self SwitchToOffhand( grenadeTypePrimary );

These may be useful ^^^

I also found away to set Last stand time...

Call this :

self thread lastStandTimer( 10 ); << Time off Struggling your balls of in last stand

These are the scripts that powers the last Stand in Cod4 Happy have fun messing around with them :P That will stop nubs using it Happy


lastStandTimer( delay )
{
self endon( "death" );
self endon( "disconnect" );
self endon( "game_ended" );

self thread lastStandWaittillDeath();

self.lastStand = true;
self setLowerMessage( &"PLATFORM_COWARDS_WAY_OUT" );

self thread lastStandAllowSuicide();
self thread lastStandKeepOverlay();

wait delay;

self thread LastStandBleedOut();
}

LastStandBleedOut()
{
self.useLastStandParams = true;
self ensureLastStandParamsValidity();
self suicide();
}

lastStandAllowSuicide()
{
self endon( "death" );
self endon( "disconnect" );
self endon( "game_ended" );

while(1)
{
if ( self useButtonPressed() )
{
pressStartTime = gettime();
while ( self useButtonPressed() )
{
wait .05;
if ( gettime() - pressStartTime > 700 )
break;
}
if ( gettime() - pressStartTime > 700 )
break;
}
wait .05;
}

self thread LastStandBleedOut();
}

lastStandKeepOverlay()
{
self endon( "death" );
self endon( "disconnect" );
self endon( "game_ended" );

// keep the health overlay going by making code think the player is getting damaged
while(1)
{
self.health = 2;
wait .05;
self.health = 1;
wait .5;
}
}

lastStandWaittillDeath()
{
self endon( "disconnect" );

self waittill( "death" );

self clearLowerMessage();
self.lastStand = undefined;
}

mayDoLastStand( sWeapon, sMeansOfDeath, sHitLoc )
{
if ( sMeansOfDeath != "MOD_PISTOL_BULLET" && sMeansOfDeath != "MOD_RIFLE_BULLET" && sMeansOfDeath != "MOD_FALLING" )
return false;

if ( isHeadShot( sWeapon, sHitLoc, sMeansOfDeath ) )
return false;

return true;
}

ensureLastStandParamsValidity()
{
// attacker may have become undefined if the player that killed me has disconnected
if ( !isDefined( self.lastStandParams.attacker ) )
self.lastStandParams.attacker = self;
}


Credits to Infinity Ward :carling:


self thread lastStandTimer( 999999999999999999999999999999999999999999999999999999999999999999999999 ); :fyea:
02-09-2012, 08:59 PM #3
DlBSY993
There's 0nly 1..
Originally posted by xYARDSALEx View Post
self thread lastStandTimer( 999999999999999999999999999999999999999999999999999999999999999999999999 ); :fyea:


That should do the job Winky Winky
02-09-2012, 09:07 PM #4
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by DlBSY993 View Post
I was looking through the patch and noticed some cool little things people may not have known about .. So here.


Choose Third person Angle.

Well you know spectator mode on cod4 ? you can swivel the camera 360' degrees around the player model. Here's a Dvar which you can use to set the angle of that camera.

"cg_thirdPersonAngle", 356 <<This is the Degree of the angle you would like around the player.


Choose who you can hear

"cg_deadChatWithDead", "0",
"cg_deadChatWithTeam", "1",
"cg_deadHearTeamLiving", "1",
"cg_deadHearAllLiving", "0",
"cg_everyoneHearsEveryone", "0"

Headshot sound Happy

self playSound( "bullet_impact_headshot_2" );

Some Nice functions

self giveWeapon( "Vaders_Dildo_mp" );
self giveMaxAmmo( "xYARDSALEx's_Buttplug_mp" ); :shh:
self switchToWeapon( "beretta_mp" );
self GiveWeapon( grenadeTypePrimary );
self SetWeaponAmmoClip( grenadeTypePrimary, 0 );
self SwitchToOffhand( grenadeTypePrimary );

These may be useful ^^^

I also found away to set Last stand time...

Call this :

self thread lastStandTimer( 10 ); << Time off Struggling your balls of in last stand

These are the scripts that powers the last Stand in Cod4 Happy have fun messing around with them :P That will stop nubs using it Happy


lastStandTimer( delay )
{
self endon( "death" );
self endon( "disconnect" );
self endon( "game_ended" );

self thread lastStandWaittillDeath();

self.lastStand = true;
self setLowerMessage( &"PLATFORM_COWARDS_WAY_OUT" );

self thread lastStandAllowSuicide();
self thread lastStandKeepOverlay();

wait delay;

self thread LastStandBleedOut();
}

LastStandBleedOut()
{
self.useLastStandParams = true;
self ensureLastStandParamsValidity();
self suicide();
}

lastStandAllowSuicide()
{
self endon( "death" );
self endon( "disconnect" );
self endon( "game_ended" );

while(1)
{
if ( self useButtonPressed() )
{
pressStartTime = gettime();
while ( self useButtonPressed() )
{
wait .05;
if ( gettime() - pressStartTime > 700 )
break;
}
if ( gettime() - pressStartTime > 700 )
break;
}
wait .05;
}

self thread LastStandBleedOut();
}

lastStandKeepOverlay()
{
self endon( "death" );
self endon( "disconnect" );
self endon( "game_ended" );

// keep the health overlay going by making code think the player is getting damaged
while(1)
{
self.health = 2;
wait .05;
self.health = 1;
wait .5;
}
}

lastStandWaittillDeath()
{
self endon( "disconnect" );

self waittill( "death" );

self clearLowerMessage();
self.lastStand = undefined;
}

mayDoLastStand( sWeapon, sMeansOfDeath, sHitLoc )
{
if ( sMeansOfDeath != "MOD_PISTOL_BULLET" && sMeansOfDeath != "MOD_RIFLE_BULLET" && sMeansOfDeath != "MOD_FALLING" )
return false;

if ( isHeadShot( sWeapon, sHitLoc, sMeansOfDeath ) )
return false;

return true;
}

ensureLastStandParamsValidity()
{
// attacker may have become undefined if the player that killed me has disconnected
if ( !isDefined( self.lastStandParams.attacker ) )
self.lastStandParams.attacker = self;
}


Also none off these have been tested but they all look like they should work, considering they're in the patch lol
Credits to Infinity Ward :carling:


I see you found some new weapons to :carling:.

The following 3 users say thank you to IVI40A3Fusionz for this useful post:

DlBSY993, Taylor, Vampytwistッ
02-09-2012, 09:11 PM #5
DlBSY993
There's 0nly 1..
Originally posted by IVI40A3Fusionz View Post
I see you found some new weapons to :carling:.


It would appear so... :carling:
02-09-2012, 09:38 PM #6
Taylor
Former Black Knight.
Originally posted by DlBSY993 View Post
It would appear so... :carling:


Hmmmm, Why Did You Import My Butt Plug Into Cod4?? And Why The Hell Were You Snooping In My Room?!?!?!?!

The following user thanked Taylor for this useful post:

Karoolus
02-09-2012, 09:59 PM #7
DlBSY993
There's 0nly 1..
Originally posted by xYARDSALEx View Post
Hmmmm, Why Did You Import My Butt Plug Into Cod4?? And Why The Hell Were You Snooping In My Room?!?!?!?!


Weapon damage was truly outstanding .. it had to be done.
02-09-2012, 10:04 PM #8
Taylor
Former Black Knight.
Originally posted by DlBSY993 View Post
Weapon damage was truly outstanding .. it had to be done.


Is It Over 9,000? cuz if it is it definatly must have been done
02-09-2012, 10:50 PM #9
DlBSY993
There's 0nly 1..
Originally posted by xYARDSALEx View Post
Is It Over 9,000? cuz if it is it definatly must have been done


8.999 .........
02-09-2012, 10:54 PM #10
Taylor
Former Black Knight.
Originally posted by DlBSY993 View Post
8.999 .........


8,999 :derp:

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo