Post: Tutorial: How to Make a Function! (Basic)
03-02-2013, 11:34 PM #1
(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 Winky Winky

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 Winky Winky 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 Winky Winky 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]

The following 5 users groaned at SUBARUDEMON for this awful post:

ϟ c0rruption ϟ, 247Yamato, blackhawk2299, Midnight, Restxrt Modz
03-03-2013, 12:29 AM #2
Master Ro
I make food
Originally posted by SUBARUDEMON View Post
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 Winky Winky

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 Winky Winky 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 Winky Winky 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]


This is very poorly written, and by the way you are writing it, doesn't sound like you really have knowledge on this yourself.

    
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");
}


That will give you a syntax as well...I don't know about the other info since I stopped at that point in the thread

The following 9 users say thank you to Master Ro for this useful post:

-Google-, backstop12, blackhawk2299, Guzman, IIxJ4TxII, KCxFTW, ProGoHard, TheHolyMart, Tony Stark
03-03-2013, 01:00 AM #3
Originally posted by ro
This is very poorly written, and by the way you are writing it, doesn't sound like you really have knowledge on this yourself.

    
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");
}


That will give you a syntax as well...I don't know about the other info since I stopped at that point in the thread


i noticed that aswell, but didnt say anything just groaned it, and nice sig man.. lol.
03-03-2013, 03:01 AM #4
KCxFTW
Who’s Jim Erased?
.............self thread("TrolledYouLol");...............................oh my god.

The following user thanked KCxFTW for this useful post:

Master Ro
03-03-2013, 04:09 AM #5
backstop12
Do a barrel roll!
Originally posted by KCxFTW View Post
.............self thread("TrolledYouLol");...............................oh my god.


ppl now days Happy

The following user thanked backstop12 for this useful post:

KCxFTW
03-03-2013, 03:41 PM #6
Taylor
Former Black Knight.
Originally posted by SUBARUDEMON View Post
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 Winky Winky

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 Winky Winky 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 Winky Winky 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]


I opened the first two spoilers and was like okay :ca: then I clicked on the 5th one and I was like :dumb:. Do you honestly know the syntax errors and let alone unknown functions that you have just in that alone?

The following user thanked Taylor for this useful post:

Devastation
03-03-2013, 03:59 PM #7
*xActionMods*
I’m too L33T
come on guys, at least he tried to give people a tut.

The following user thanked *xActionMods* for this useful post:

-Google-
03-03-2013, 06:47 PM #8
backstop12
Do a barrel roll!
Originally posted by xActionMods
come on guys, at least he tried to give people a tut.


Yh, A tut full of errors :impatient:

The following user thanked backstop12 for this useful post:

Taylor

The following user groaned backstop12 for this awful post:

*xActionMods*
03-04-2013, 08:30 AM #9
Originally posted by SUBARUDEMON View Post
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 Winky Winky

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 Winky Winky 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 Winky Winky 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]

there has been a lot of tutorials on how to make functions you didn't need to make another one especially if its not all right and you get erros
03-04-2013, 08:31 AM #10
Originally posted by SUBARUDEMON View Post
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 Winky Winky

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 Winky Winky 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 Winky Winky 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]

there has been a lot of tutorials on how to make functions you didn't need to make another one especially if its not all right and you get errors

Copyright © 2025, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo