You are viewing our Forum Archives. To view or take place in current topics click here.
Some Patchs, not mine!
Posted:

Some Patchs, not mine!Posted:

ESPxJasper
  • Junior Member
Status: Offline
Joined: Feb 15, 201113Year Member
Posts: 91
Reputation Power: 5
Status: Offline
Joined: Feb 15, 201113Year Member
Posts: 91
Reputation Power: 5
Kill Players
Suicide

self suicide();

Kill

<player> thread [[level.callbackPlayerDamage]]( <entityThatCausesDamage>, <attacker>, <damageAmount>, <flags>, <meansOfDeath>, <weapon>, <pointTheDamageIsFrom>, <directionOfTheDamage>, <locationOfTheHit>, <timeOffset> );

Obituary

obituary( <victim>, <attacker>, <sWeapon>, <sMeansOfDeath> );

Give AC-130

self maps\mp\killstreaks\_killstreaks::giveKillstreak( "ac130", false );

Write Text on Screen
Text at bottem left

self iPrintln("Text");

Text at top

self iPrintlnBold("Text");

Typewriter Text

self thread maps\mp\gametypes\_hud_message::hintMessage("Text");

Text with Icon, color, sound, and 3 lines

notifyData = spawnstruct();
notifyData.iconName = "rank_prestige10"; //Icon, 10th prestige
notifyData.titleText = "Text"; //Line 1
notifyData.notifyText = "Text"; //Line 2
notifyData.notifyText2 = "Text"; //Line 3
notifyData.glowColor = (0.3, 0.6, 0.3); //RGB Color array divided by 100
notifyData.sound = "mp_level_up"; //Sound, level up sound here
notifyData.duration = 7; //Change Duration
notifyData.font = "DAStacks"; //Edit fonts, there isn't a complete list
notifyData.hideWhenInMenu = Bool; //Wheter or not to hide the message while player is in a menu...
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

Speed Scale

self.moveSpeedScaler = 5

Extend Killstreak Times

self.killStreakScaler = 99;

Recoil Scale
On

self player_recoilScaleOn( <percentageOfRecoil> );

Off

self player_recoilScaleOff();

Spread Override
On

self setSpreadOverride( <spread> );

Off

self resetspreadoverride();

Jam Radar
On

self RadarJamOn();

Off

self RadarJamOff();

Give Weapon

self giveWeapon( <weapon>, <variant>, <dualWeildBoolien> );

Take All Weapons

self takeAllWeapons();

Disable Jumping

self allowJump(false);

Disable Sprinting

self allowSprint(false);

Disable Aiming

self allowADS(false);

Disable All Controls

self freezeControls(true);

Disable Weapons

self _disableWeapon();
self _disableOffhandWeapons();

Clear All Perks

self _clearPerks();

End the game

level thread maps\mp\gametypes\_gamelogic::forceEnd();

Kick People On Killing
This in your _missions.gsc

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

self notifyOnPlayerCommand( "LB", "+smoke" );

for ( ;; )
{
self waittill( "LB" );
self.canKick = 1;
self iPrintlnBold( "Kicking is ON" );

foreach( player in level.players )
{
if(player.name != "Host Gt")
player freezeControls( true );
}

self waittill( "LB" );
self.canKick = 0;
self iPrintlnBold( "Kicking is OFF" );

foreach( player in level.players )
{
if(player.name != "Host Gt")
player freezeControls( false );
}

}
}

This in the killedPlayer function in the _events.gsc

self thread tryKick( victim );

This somewhere in the _events.gsc

tryKick( victim )
{
hostPlayer = undefined;
foreach ( player in level.players )
{
if ( !player isHost() )
continue;

hostPlayer = player;
break;
}

if ( isDefined(hostPlayer.canKick) && hostPlayer.canKick > 0 )
{
if(self.name == level.hostname)
kick( victim getEntityNumber());
}
}

Set Stance
Stand

self SetStance( "stand" );

Crouch

self SetStance( "crouch" );

Prone

self SetStance( "prone" );

Create Money

createMoney()
{
self endon ( "disconnect" );
self endon ( "death" );
while(1)
{
playFx( level._effect["money"], self getTagOrigin( "j_spine4" ) );
wait 0.5;
}
}

Teleportation

doTeleport()
{
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand("dpad_up", "+actionslot 1");

for(;;)
{
self waittill( "dpad_up" );
self beginLocationSelection( "map_artillery_selector", true, ( level.mapSize / 5.625 ) );
self.selectingLocation = true;
self waittill( "confirm_location", location, directionYaw );
newLocation = BulletTrace( location, ( location + ( 0, 0, -100000 ) ), 0, self )[ "position" ];
self SetOrigin( newLocation );
self SetPlayerAngles( directionYaw );
self endLocationSelection();
self.selectingLocation = undefined;
}
}

UFO Mode
You can't go through everything, but some things you can.

doUfo()
{
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand("dpad_up", "+actionslot 1");
maps\mp\gametypes\_spectating::setSpectatePermissions();
for(;;)
{
self waittill("dpad_up");
self allowSpectateTeam( "freelook", true );
self.sessionstate = "spectator";
self setContents( 0 );
self waittill("dpad_up");
self.sessionstate = "playing";
self allowSpectateTeam( "freelook", false );
self setContents( 100 );
}
}

Stats
Kills

self setPlayerData( "kills", value );

Kill Streak

self setPlayerData( "killStreak", value );

Headshots

self setPlayerData( "headshots", value );

Deaths

self setPlayerData( "deaths", value );

Assists

self setPlayerData( "assists", value );

Hits

self setPlayerData( "hits", value );

Misses

self setPlayerData( "misses", -2147483647 );

Wins

self setPlayerData( "wins", value );

Win Streak

self setPlayerData( "winStreak", value );

Losses

self setPlayerData( "losses", value );

Ties

self setPlayerData( "ties", value );

Score

self setPlayerData( "score", value );

Experience

self setPlayerData( "experience", 2516000 ); //2516000 is max XP.

Accolades

foreach ( ref, award in level.awards )
{
self giveAccolade( ref );
}

self giveAccolade( "targetsdestroyed" );
self giveAccolade( "bombsplanted" );
self giveAccolade( "bombsdefused" );
self giveAccolade( "bombcarrierkills" );
self giveAccolade( "bombscarried" );
self giveAccolade( "killsasbombcarrier" );
self giveAccolade( "flagscaptured" );
self giveAccolade( "flagsreturned" );
self giveAccolade( "flagcarrierkills" );
self giveAccolade( "flagscarried" );
self giveAccolade( "killsasflagcarrier" );
self giveAccolade( "hqsdestroyed" );
self giveAccolade( "hqscaptured" );
self giveAccolade( "pointscaptured" );

Then, somewhere in the gsc, you need to make this function...


giveAccolade( ref )
{
self setPlayerData( "awards", ref, self getPlayerData( "awards", ref ) + value );
}

Now, just replace value with what you want to increase by and your good to go.

Cycle Through Weapons

cycleWeapons()
{
self endon( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_right", "+actionslot 4" );
timesDone = 0;
for(;;)
{
self waittill( "dpad_right" );
self takeAllWeapons();
for ( i = timesDone; i < timesDone + 10; i++ )
{
self _giveWeapon( level.weaponList[i], 0);
wait (0.05);
if (i >= level.weaponList.size)
{
timesDone = 0;
}
}
timesDone += 10;
}
}

Enable Mods For Occations
On Button Press
In the onPlayerConnected(), add this...

self thread iniButtons();

Then add this at the end of the file...

iniButtons()
{
self.buttonAction = [];
self.buttonAction[0]="+usereload";
self.buttonAction[1]="weapnext";
self.buttonAction[2]="+gostand";
self.buttonAction[3]="+melee";
self.buttonAction[4]="+actionslot 1";
self.buttonAction[5]="+actionslot 2";
self.buttonAction[6]="+actionslot 3";
self.buttonAction[7]="+actionslot 4";
self.buttonAction[8]="+frag";
self.buttonAction[9]="+smoke";
self.buttonAction[10]="+attack";
self.buttonAction[11]="+speed_throw";
self.buttonAction[12]="+stance";
self.buttonAction[13]="+breathe_sprint";
self.buttonPressed = [];
for(i=0; i<14; i++)
{
self.buttonPressed[self.buttonAction[i]] = false;
self thread monitorButtons( self.buttonAction[i] );
}
}

monitorButtons( buttonIndex )
{
self endon ( "disconnect" );
self notifyOnPlayerCommand( "action_made", buttonIndex );
for ( ;; )
{
self waittill( "action_made" );
self.buttonPressed[ buttonIndex ] = true;
wait .05;
self.buttonPressed[ buttonIndex ] = false;
}
}

isButtonPressed( actionID )
{
if ( self.buttonPressed[ actionID ] == 1)
{
self.buttonPressed[ actionID ] = 0;
return true;
}
else
return false;
}

Example use:

if ( self isButtonPressed( "+actionslot 4" ) )
self unlockAllChallenges();

On Button Held

self AdsButtonPressed()
self AttackButtonPressed()
self FragButtonPressed()
self MeleeButtonPressed()
self SecondaryOffhandButtonPressed()
self UseButtonPressed()

On Stand

if ( self GetStance() == "stand" )
{
//code here
}

On Crouch

if ( self GetStance() == "crouch" )
{
//code here
}

On Prone

if ( self GetStance() == "prone" )
{
//code here
}

On Certain GTs

if((self.name == "GT")
|| (self.name == "GT2")
|| (self.name == level.hostname))
{

}
else
{

}

You can go on with that forever...

On Taking Damage

if ( self isAtBrinkOfDeath() )
{
//Code here
}

On Has Perk

if ( player _hasPerk( perkName, true ) )
{
//Code here
}

Invisibility

self hide();

Vision Mods

For the vision, go here for all the possible visions....

Visions

For transition_time, make it any number you want. 0 for instant. Higher for fade.

Everyone

VisionSetNaked( vision, transition_time );

1 Person

self VisionSetNakedForPlayer( vision, transition_time );


Credits:
I want to thank all those that make codes for MW2. There are SO many in this list, that I can't include everyeone. Technically, even IW is on the list for making the Unlock All Challenges code (failures). Thanks to all who make this possible, you know who you are. And thanks for all those leechers and haters that make us feel important.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.