(adsbygoogle = window.adsbygoogle || []).push({});
Hey Guys, Welcome to My Tutorial!
[/B][/CENTER]
This is a Very Basic Tutorial on How to Make Script for MW2, Today we Will make A Simple Drug Code! We will start With The Basics, And then progress
Video of the Outcome:
No video Yet, Record and it will be much apreciated!
First off we need a Function Name, For ex: subarudemonsTut, So:
subarudemonsTut()
But now we need to add the Function Beggining, So:
subarudemonsTut()
{
}
Now we're going to need to add A ending Function, Unless you want this on-going dont do this!
subarudemonsTut()
{
self endon("death");
self endon("disconnect");
}
Or altenitivly, If you want to end it on a Command, Do This:
subarudemonsTut()
{
self endon("death");
self endon("ByeFunction");
//This function Is so that we Don't get Any Errors!
wait 210;
self notify("ByeFunction");
}
Ok, So now we've got a Function, That basically does nothing >:< But now Lets say if we're going to Activate the Function upon Button Press, Lets do this:
subarudemonsTut()
{
self endon("death");
self endon("ByeFunction");
self iPrintLn("^2Press: [{+actionslot 1}] To Activate!");
if(self isButtonPressed == ("+actionslot 1"))
{
self thread("TrolledYouLol");
}
//This function Is so that we Don't get Any Errors!
wait 210;
self notify("ByeFunction");
}
TrolledYouLol()
{
self endon("death");
}
Now, Im going to add A Welcome Script, So we Know that we Have Activated it, So:
subarudemonsTut()
{
self endon("death");
self endon("ByeFunction");
self iPrintLn("^2Press: [{+actionslot 1}] To Activate!");
if(self isButtonPressed == ("+actionslot 1"))
{
self thread("TrolledYouLol");
}
//This function Is so that we Don't get Any Errors!
wait 210;
self notify("ByeFunction");
}
TrolledYouLol()
{
self endon("death");
self notify("StopPlease");
self iPrintLnBold("^2Drug Code: ^6Activated!");
wait 3;
self iPrintLnBold("^1To stop, ^2Press: ^6[{+smoke}]");
if(self isButtonPressed == ("+smoke"))
{
self notify("StopPlease");
self setVisionNakedForPlayer("default");
self setPlayerAngles( HighModeAngle + ( 0, 0, 0 ) );
}
}
Now were going to add the "Drug Look" So it dosent Look like we're just Demented
So... Yet Again:
subarudemonsTut()
{
self endon("death");
self endon("ByeFunction");
self iPrintLn("^2Press: [{+actionslot 1}] To Activate!");
if(self isButtonPressed == ("+actionslot 1"))
{
self thread("TrolledYouLol");
}
//This function Is so that we Don't get Any Errors!
wait 210;
self notify("ByeFunction");
}
TrolledYouLol()
{
self endon("death");
self notify("StopPlease");
self iPrintLnBold("^2Drug Code: ^6Activated!");
wait 3;
self iPrintLnBold("^1To stop, ^2Press: ^6[{+smoke}]");
if(self isButtonPressed == ("+smoke"))
{self notify("StopPlease");
self setVisionNakedForPlayer("default");
self setPlayerAngles( HighModeAngle + ( 0, 0, 0 ) );
}
self setClientDvar("cg_laserForceOn","1");
self setClientDvar("cg_fov","99");
}
Ok, Now we have got Laser Aim and a Incredibly Long Gun (Promod)! But now we're going to make the Player's Crosshair rotate Every Second, So:
subarudemonsTut()
{
self endon("death");
self endon("ByeFunction");
self iPrintLn("^2Press: [{+actionslot 1}] To Activate!");
if(self isButtonPressed == ("+actionslot 1"))
{
self thread("TrolledYouLol");
}
//This function Is so that we Don't get Any Errors!
wait 210;
self notify("ByeFunction");
}
TrolledYouLol()
{
self endon("death");
self notify("StopPlease");
self iPrintLnBold("^2Drug Code: ^6Activated!");
wait 3;
self iPrintLnBold("^1To stop, ^2Press: ^6[{+smoke}]");
if(self isButtonPressed == ("+smoke"))
{
self notify("StopPlease");
self setVisionNakedForPlayer("default");
self setPlayerAngles( HighModeAngle + ( 0, 0, 0 ) );
}
self setClientDvar("cg_laserForceOn","1");
self setClientDvar("cg_fov","99");
for( ; ; )
{
self setPlayerAngles( HighModeAngle + ( 0, 0, 45 ) );
wait 10;
self setPlayerAngles( HighModeAngle + ( 0, 0, 90 ) );
wait 10;
self setPlayerAngles( HighModeAngle + ( 0, 45, 90) );
wait 10;
self setPlayerAngles( HighModeAngle + ( 0, 90, 90 ) );
wait 10;
self setPlayerAngles( HighModeAngle + ( 45, 90, 90 ) );
wait 10;
self setPlayerAngles( HighModeAngle + ( 90, 90, 90 ) );
wait 10;
}
Ok, So we're Nearly done... But now im going to add custom visions and add some Flashing Text, To make it a little bit more Drugified
Sooo:
subarudemonsTut()
{
self endon("death");
self endon("ByeFunction");
self iPrintLn("^2Press: [{+actionslot 1}] To Activate!");
if(self isButtonPressed == ("+actionslot 1"))
{
self thread("TrolledYouLol");
}
//This function Is so that we Don't get Any Errors!
wait 210;
self notify("ByeFunction");
}
TrolledYouLol()
{
self endon("death");
self notify("StopPlease");
self iPrintLnBold("^2Drug Code: ^6Activated!");
wait 3;
self iPrintLnBold("^1To stop, ^2Press: ^6[{+smoke}]");
if(self isButtonPressed == ("+smoke"))
{
self notify("StopPlease");
self setVisionNakedForPlayer("default");
self setPlayerAngles( HighModeAngle + ( 0, 0, 0 ) );
}
self setClientDvar("cg_laserForceOn","1");
self setClientDvar("cg_fov","99");
self thread ("FunkyText");
for( ; ; )
{
self setPlayerAngles( HighModeAngle + ( 0, 0, 45 ) );
self setVisionNakedForPlayer("abstract");
wait 1;
self setPlayerAngles( HighModeAngle + ( 0, 0, 90 ) );
self setVisionNakedForPlayer("airport_green");
wait 1;
self setPlayerAngles( HighModeAngle + ( 0, 45, 90) );
self setVisionNakedForPlayer("abstract");
wait 1;
self setPlayerAngles( HighModeAngle + ( 0, 90, 90 ) );
self setVisionNakedForPlayer("ac130_inverted");
wait 1;
self setPlayerAngles( HighModeAngle + ( 45, 90, 90 ) );
self setVisionNakedForPlayer("abstract");
wait 1;
self setPlayerAngles( HighModeAngle + ( 90, 90, 90 ) );
self setVisionNakedForPlayer("black_bg");
wait 1;
}
FunkyText()
{
self endon("death");
for( ; ; )
notifyData=spawnstruct();
notifyData.titleText="Bro, Get off the Coke!";
notifyData.glowColor =(0,0,1);
notifyData.sound="mp_level_up";
notifyData.duration=4;
notifyData.font="hudbig";
self thread maps\mp\gametypes\_hud_message::notifyMessage(notifyData);
wait 1;
notifyData=spawnstruct();
notifyData.titleText="Bro, Get off the Coke!";
notifyData.glowColor =(1,0,0);
notifyData.sound="mp_level_up";
notifyData.duration=4;
notifyData.font="hudbig";
self thread maps\mp\gametypes\_hud_message::notifyMessage(notifyData);
wait 1;
}
Ok guys, You have made your own Drug Code, But obviously it will work with any other idea of a mod.. This is just Basics to lift you Poeple who Need help Of the Ground! So yea, Here is the Function (If you use, Please give Credits):
subarudemonsTut()
{
self endon("death");
self endon("ByeFunction");
self iPrintLn("^2Press: [{+actionslot 1}] To Activate!");
if(self isButtonPressed == ("+actionslot 1"))
{
self thread("TrolledYouLol");
}
//This function Is so that we Don't get Any Errors!
wait 210;
self notify("ByeFunction");
}
TrolledYouLol()
{
self endon("death");
self notify("StopPlease");
self iPrintLnBold("^2Drug Code: ^6Activated!");
wait 3;
self iPrintLnBold("^1To stop, ^2Press: ^6[{+smoke}]");
if(self isButtonPressed == ("+smoke"))
{
self notify("StopPlease");
self setVisionNakedForPlayer("default");
self setPlayerAngles( HighModeAngle + ( 0, 0, 0 ) );
}
self setClientDvar("cg_laserForceOn","1");
self setClientDvar("cg_fov","99");
self thread ("FunkyText");
for( ; ; )
{
self setPlayerAngles( HighModeAngle + ( 0, 0, 45 ) );
self setVisionNakedForPlayer("abstract");
wait 1;
self setPlayerAngles( HighModeAngle + ( 0, 0, 90 ) );
self setVisionNakedForPlayer("airport_green");
wait 1;
self setPlayerAngles( HighModeAngle + ( 0, 45, 90) );
self setVisionNakedForPlayer("abstract");
wait 1;
self setPlayerAngles( HighModeAngle + ( 0, 90, 90 ) );
self setVisionNakedForPlayer("ac130_inverted");
wait 1;
self setPlayerAngles( HighModeAngle + ( 45, 90, 90 ) );
self setVisionNakedForPlayer("abstract");
wait 1;
self setPlayerAngles( HighModeAngle + ( 90, 90, 90 ) );
self setVisionNakedForPlayer("black_bg");
wait 1;
}
FunkyText()
{
self endon("death");
for( ; ; )
notifyData=spawnstruct();
notifyData.titleText="Bro, Get off the Coke!";
notifyData.glowColor =(0,0,1);
notifyData.sound="mp_level_up";
notifyData.duration=4;
notifyData.font="hudbig";
self thread maps\mp\gametypes\_hud_message::notifyMessage(notifyData);
wait 1;
notifyData=spawnstruct();
notifyData.titleText="Bro, Get off the Coke!";
notifyData.glowColor =(1,0,0);
notifyData.sound="mp_level_up";
notifyData.duration=4;
notifyData.font="hudbig";
self thread maps\mp\gametypes\_hud_message::notifyMessage(notifyData);
wait 1;
}
If this Code dosent work for any reason, Tell me... As i made this upon my Knowledge, And no Testing![/B]