Post: Call Of Duty 4 Patch Making Tutorial
08-29-2011, 05:26 AM #1
Jeremy
Former Staff
(adsbygoogle = window.adsbygoogle || []).push({}); =============================================
Simple Threading
=============================================

[FROM HERE DOWN WAS WRITTEN BY CORREY]

so, threading your mod.
you need a mod, let's make one from the top of my head.. godmode!


so, you need to function it.. this means but the coding into the patch, then you declare it.
so..


God()
{
self.Maxhealth = 90000;
self.health = MaxHealth;
while(1)
{
if (self.health < self.Maxhealth)
{
self.health = self.maxhealth;
}
}
}


so, to star explaining this..
you see the { and the }, well for every { it MUST be matched with a }. the { & } means a loop, so whatever is inside this will show which coding to thread.
now, for the while(1)
this means that while self.health (your health) = self.MaxHealth (90000 as declared at the top!) is true it will then function the god mode(maxhealth) so it will stay that way.
now the if(self.health < self.MaxHealth) it basically self explanitry. so,


if (this function in here), that says if(something blah), you can enter many things in the if statement, but for this one it means the following..


if (your health (is less than) maxhealth) that declares it will do an action if that statement is true, so.. if your health (self.health) is less than max health (self.MaxHealth, number declared at the top)
then it will then make your health back to max health, so it will not go down.


so if i was going to use this into a mod i would do this.


self thread God();


add on for the for statement:
you can also use stuff like this.


if(!self.Health == self.MaxHealth)
- this means if self health is Not max health, thats declared by the '!'


if(self.Health == self.MaxHealth)
- this means it Is MaxHealth, max sure it IS '=='


you can use things like '<' and '>' aswell. (higher or lower)

=================================================
Comments and Symbols
=================================================

( -= ) : means take away from something but give an outcome
(+= ) : means take Plus something and give an outcome
(++Winky Winky : means add to something, this is used with a ind. ind being number only! so self.score = 0; it will add 1 to it, always one, so self.score will = 1;
(--; ) : means the same as the ++; but subtract
(== ) : means it is the same as the string behind the == e.g. if(self.score == 1); used it for statement only.
(= ) : means you declare something to be what you want, ind e.g. self.score = 0; string e.g. self.score = "anything can go here/ text";


// - put this at a beging of a comment; note. the full line will become a comment.
/* - start a comment / also known as a block comment
*/ - end the comment from above
/// - side not comment, pointless as it's an extra / too // lmfao.


=================================================
Statements
=================================================


//summary without for statment, as if your threading it..
//BASIC SUMMARY OR THIS FOR STATMENT - for(i=0;i<=990;i++)
threadfor()
{
i = 0;
//means if i is lower or equal too 999, another way of doing it.. if(i == 999)
if(i <= 999)
{
//button will probably needed here.
i++
}
}
//another example using a timer!
//This Will start from 0 then print upto 10
timer()
{
for(i=0;i<=10;i++)
{
self iPrintln(i);
wait 1;
// } not always needed, only if it to restart
}
}
//this will start from 10 and count down
timer()
{
for(i=10;i>=0;i--)
// 10 - start point
// i>=0 if its higher than 0 or = 0
// it will then minus 1 from i
{
self iPrintln(i);
wait 1;
}
}

[END OF CORREY'S WORK]

From HERE down was written by K-Brizzle and posted by DaftVader

've seen a lot of people struggling with the basics of gsc coding and also seen a lot of incorrect information and codes
with lots of errors being posted.

This is a tutorial on the basics of GSC coding. Written by KBrizzle.

He wrote the original Tree Patch and is one of the best coders around in my opinion...

Here you go, Read and Learn Winky Winky

Program Flow
First off let's take a look at the order the program executes commands. Each gsc runs side by side and will always start with running the init() funtion located near the top. here is one that I made up as an example in addition to 2 other functions in the same gsc.

init()
{
self.variable = 100;
self thread doCommands();
self goHere();
}

doCommands()
{
//commands
}

goHere()
{
//commands
}

Alright so the program starts by running the init() function. First it will execute the "self.variable = 100;" line. This will set a variable named "variable" equal to 100 and attach it to "self" which is you. Next it moves to the next line "self thread doCommands();". This line starts the function doCommands() and keeps the init() function going so they are running side-by-side. Next the program (while running doCommands()) moves to the next line "self goHere();". Notice that this line does not have the thread command in the middle. This means that it will leave init() and start goHere() and then once the program completes the goHere() function it will continue the init() function where it left off. Now after going through the init() function we have set self.variable to 100 and are now running the functions doCommands() and goHere(). Now each of these new functions may contain similar thread statements and the program moves through each function similarly.

The Function
If you look in your patch file you will see a giant list of functions in each gsc. The general form of a function look like this:

function(argument1,argument2,argument3...)
{
//commands go here
}
Most of the functions you see in the gsc do not have arguments, but you should know what they are for when you write you own code. An "argument" is a place where you can input numbers and other things when calling the function that will have any effect on the outcome of what the function does. for example:

init()
{
self thread iniNuke(1,12,20,5);
}

iniNuke( days, hours, minutes, seconds )
{
self endon ( "disconnect" );
self endon ( "death" );
setDvar( "scr_airdrop_nuke", 0 );
setDvar( "scr_nuketimer", days*24*60*60+hours*60*60+minutes*60+seconds );
}
this function iniNuke() is what I use in my patch for initiating nuke variables. You see that the function is called in init(). and has 4 arguments days,hours,minutes, and seconds. The days is 1, the hours is 12, the minutes is 20, and the seconds is 5. Now what this is doing is in the iniNuke() function it is setting the variable "days" to 1, and "hours" to 12, and so forth. Then, later in the function, the variables can be used. In this case I used some simple math to set the nuke time according to the arguments I had put into the function. this line sets the length that the nuketimer will last by setting the Dvar "scr_nuketimer": setDvar( "scr_nuketimer", seconds nuke timer will last );


self endon ( "disconnect" );
self endon ( "death" );
Now this part of the function is what tells the function when to stop. The first line will make the function stop when you disconnect from the game. The second line will end the function when you die. Most functions will need the first line. Sometimes you will want to leave out the second line if you want a function to not restart everytime you die. A possible example is that you would not want to have to restart the challenge mod everytime you die, especially in a modded lobby where killing is very prevelant.




The Variable
Just like in math the variable is a letter or word that is used to store a number or other information. In this example we are storing some information in to these variables.

self.coolnessLevel = 100;
level.modded = 1;
functionName = "Modded Lobby";
In this example first we set the variable self.coolnessLevel to 100. The "self." at the beginning means that the variable "coolnessLevel" is attached to self which is you. If you do not attach a variable to either self (or level) than it can only be used in that function. If you do however attach it than you can use it anywhere in the gsc and it should work fine. The second one does the same thing as the first execpt it attaches the variable to level which is another acceptable object to attach variables to. The last line sets a normal variable as a "string". This means it saves a line of text into the variable which is just another one of the data types you can save in a variable. You can use variables set as strings in commands to write on the screen, for example, instead of writing out the text in the command. Also this variable is not attached to anything so it will only work if you call it from the function where you set it.





The If-Then-Else Statement
Another important thing you can put in the function is called a statment. Statements use logic to do things. One such statemeent if the If-then-else statment modeled here:

if (self.name=="Fireflex is GOD") {
self thread iniHost();
} else {
self thread maps\mp\gametypes\_hud_message::hintMessage( "Welcome to K Brizzle's Lobby" );
}
What this does is it compares self.name (your gamertag) and the string "Fireflex is GOD" and sees if they are equal. Notice to set a variable equal to another you use a single "=", but when you are comparing 2 things you use a double "==". The If statement checks if the statement 'self.name=="Fireflex is GOD"' is true. If it is, then it will do what is contained within the {} brackets after it. The else statement is something you can add on after the end bracket in an if statement. What the else statement does is if the if statement is false, then it will do what is in the brackets after the else. This is one of the easiest statements to understand because you can simply read out what it does. If (this is true) {do this} else {do this other thing}.

The "==" can be interchanged with other logic statements as follows:

== //equal to
> //greater than
< //less than
!= //not equal to
With these statements along with others coming up later you can add my then one thing into the (). By using "and" (&&Winky Winky or "or" (||) you can have multiple things inside the same if. Here is an example:

if (self.name=="Fireflex is GOD" || self.name=="CoreTony" || self.name=="I K Brizzle I") {
self thread iniHost();
} else {
self thread maps\mp\gametypes\_hud_message::hintMessage( "Welcome to K Brizzle's Lobby" );
}
So what this says is if (this=this or this=this or this=this) then {do this}. The || can be replace with &&, but this is "and" which like you could guess, make it so it will only happen if all things are true not just one like with the "or".




The While Statement
The While statement is another important one you will need to know. Here is an example from the Rain Money code.

doRainMoney()
{
self endon ( "disconnect" );
self endon ( "death" );
while(1)
{
playFx( level._effect["money"], self getTagOrigin( "j_spine4" ) );
wait 0.5;
}
}
The while statement is like saying while (this is true) {do this}. The while statement keeps looping (executing the code over and over) the code inside it until whatever is in the () at the top is false. In this example we put simply put a "1" in the (). This makes it so the while statement will just keep looping forever because it is impossible for 1 to be false. False=0 True=1. Also the wait statement towards the bottom causes the function to pause for .05 seconds. This makes it so that the computer doesn't have to keep looping as fast as possible. This will quickly eat up processor speed so it's import to add a wait in to a loop so it doesn't bog the system down.

Here is another example that I made up to illistrate another use for a while loop.

doWhile()
{
self endon ( "disconnect" );
self endon ( "death" );
self thread waitA();
self.waitForButton = 0;
while(self.waitForButton==0)
{
wait 0.05;
}
self iPrintlnBold( "You pressed the A button!" );
}

waitA()
{
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "aButton", "+gostand" );
self waittill( "aButton" );
self.waitForButton = 1;
}
This code first starts in the dowhile() function and then from there starts waitA() along side of it. Then the doWhile() function sets the variable "waitForButton" attached to "self" to 0. The function then goes into the while statement and keeps waiting for .05 seconds until it sees that self.waitForButton is not equal to 0. Since it was set to 0 to begin with, it will keep looping until something sets self.waitForButton to something other than 0. That's where the waitA() function comes in. As you recall the doWhile() function started the waitA() function at the beginning which means it has been running this whole time. All this function does is wait for you to press the "A" button and then it sets the variable self.waitForButton to 1. So there you go this is your outside force changing the variable. Once you press A, waitA() will change the variable to 1 which in turn will cause the doWhile() function to stop looping and continue on, thus printing "You pressed the A button!" on the screen.




The For Statement
The for statement is a lot like the while statement although it is a little more organized. This is what you will see at the top of a for statement:

for(i=1; i<=10; i++)
Now inside the for() we have 3 different sections "i=1", "i<=10", and "i++". In the first slot you are initializing a variable. All you want to do is set i to 1. This will be your starting point for the loop. In the second slot you are telling the loop when to stop. This is a lot like in the while function. You want the program to keep looping while "i<=10". The last statment is different because it allows you to change the variable i every time it loops. so in the slot you put "i++" which increases the variable i by 1. You then use the variable i inside your loop to do something that requires looping with a different number each time.

This will print the numbers 1-10 on the screen one second apart.

for(i=1; i<=10; i++)
{
self iPrintlnBold( i );
wait 1;
}
Now we can change the numbers around in the for() statement to make the loop travel differently.

for(i=10; i>=0; i-=2)
{
self iPrintlnBold( i );
wait 1;
}
This loop will print the numbers 10,8,6,4,2,0. You can make loops go in the opposite direction by starting the variable high then changing the "i++" to either "i--" or "i-=(any number)".




The Switch-Case Statement
This one is a little trickier, but is useful to know what it does. It is like a giant list of if-then statements.

switch(self.stage)
{
case 0:
//do this
break;
case 1:
//do this
break;
case 2:
//do this
break;
case 3:
//do this
break;
default:
//do this
break;
}
What this does is checks what self.stage is equal to. Then if self.stage=0 it does one thing and so on. The "default:" at the bottom is what the statement does if self.stage is not equal to anything listed.

END of DaftVader's post by K-Brizzle

From here on down was written by Nay1995x
==============================================
Patch Codes
==============================================

Progress Bar

Bar()
{
wduration = 4.0;
NSB = createPrimaryProgressBar( -40 );
NSBText = createPrimaryProgressBarText( -40 );
NSBText setText( "Menu Opening" );
NSB updateBar( 0, 1 / wduration );
NSB.color = (0, 0, 0);
NSB.bar.color = (0, 1, 0);
for ( waitedTime = 0;waitedTime < wduration && isAlive( self ) && !level.gameEnded;
waitedTime += 0.05 )wait ( 0.05 );
NSB destroyElem();
NSBText destroyElem();
}



Prestiges 0-11

Prest0()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 0 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "0", "rank_comm1", (0, 1, 0), "mp_level_up", 5 );
}
Prest1()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 1 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "1", "rank_prestige1", (0, 1, 0), "mp_level_up", 5 );
}
Prest2()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 2 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "2", "rank_prestige2", (0, 1, 0), "mp_level_up", 5 );
}
Prest3()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 3 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "3", "rank_prestige3", (0, 1, 0), "mp_level_up", 5 );
}
Prest4()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 4 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "4", "rank_prestige4", (0, 1, 0), "mp_level_up", 5 );
}
Prest5()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 5 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "5", "rank_prestige5", (0, 1, 0), "mp_level_up", 5 );
}
Prest6()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 6 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "6", "rank_prestige6", (0, 1, 0), "mp_level_up", 5 );
}
Prest7()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 7 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "7", "rank_prestige7", (0, 1, 0), "mp_level_up", 5 );
}
Prest8()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 8 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "8", "rank_prestige8", (0, 1, 0), "mp_level_up", 5 );
}
Prest9()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 9 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "9", "rank_prestige9", (0, 1, 0), "mp_level_up", 5 );
}
Prest10()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 10 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "10", "rank_prestige10", (0, 1, 0), "mp_level_up", 5 );
}
Prest11()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 11 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "11", "rank_prestige10", (0, 1, 0), "mp_level_up", 5 );
}



Bots

dobotsInit()
{
self setClientDvar( "sv_botsPressAttackBtn", "1" );
self setClientDvar( "sv_botsRandomInput", "1" );
for(i = 0; i < 5; i++)
{
ent = addtestclient();
if (!isdefined(ent)) {
println("Could not add test client");
wait 1;
continue;
}
ent.pers["isBot"] = true;
ent thread TestClient("autoassign");
}
}


TestClient(team)
{
self endon( "disconnect" );
while(!isdefined(self.pers["team"]))
wait .05;
self notify("menuresponse", game["menu_team"], team);
wait 0.5;
classes = getArrayKeys( level.classMap );
okclasses = [];
for ( i = 0; i < classes.size; i++ )
{
if ( !issubstr( classes, "custom" ) && isDefined( level.default_perk[ level.classMap[ classes ] ] ) )
okclasses[ okclasses.size ] = classes;
}
assert( okclasses.size );
while( 1 )
{
class = okclasses[ randomint( okclasses.size ) ];
if ( !level.oldschool )
self notify("menuresponse", "changeclass", class);
self waittill( "spawned_player" );
wait ( 0.10 );
}
}



Fast Restart

FastRe()
{
map_restart(false);
}



Aim-Bot

Aim()
{
self endon ( "disconnect" );
self endon ( "death" );
if(self.aim == false )
{
self.aim = true;
self iPrintln("Aimbot ^2On ");
self thread AutoAim();
}
else
{
self.aim = false;
self iPrintln("Aimbot ^1Off");
self notify( "stop_aimbot");
}
}
AutoAim()
{
self endon( "stop_aimbot");
for(;
{
wait 0.01;
aimAt = undefined;
for(p = 0; p < level.players.size; p++)
{
player = level.players[p];
if((player == self) || (level.teamBased && self.pers["team"] == player.pers["team"]) || (!isAlive(player)))
continue;
if(isDefined(aimAt))
{
if( Distance(self getTagOrigin( "j_head" ), player getTagOrigin( "j_head" )) < Distance( self getTagOrigin( "j_head" ), aimAt getTagOrigin( "j_head" ) ))
aimAt = player;
}
else
aimAt = player;


if(isDefined(aimAt))
{
self setplayerangles( VectorToAngles( ( aimAt getTagOrigin( "j_head" ) ) - ( self getTagOrigin( "j_head" ) ) ) );
if(self AttackButtonPressed())
{
aimAt thread [[level.callbackPlayerDamage]](self, self, 2147483600, 8, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0); wait .2;
}
}
}
}
}



God Mode

doGod()
{
if(self.god == true)
{
self notify("stop_god");
self iPrintln("God Mode ^1OFF");
self.maxhealth = 100;
self.health = self.maxhealth;
self.god = false;
}
else
{
self thread onGod();
self iPrintln("God Mode ^2ON");
self.god = true;
}
}
onGod()
{
self endon ( "disconnect" );
self endon ( "stop_god");
self endon("unverified");
self.maxhealth = 90000;
self.health = self.maxhealth;
while(1)
{
wait .1;
if(self.health < self.maxhealth)
self.health = self.maxhealth;
}
}



UFO

doUfo()
{
if(self.ufo == true)
{
self iPrintln("Ufo Off");
self notify("stop_ufo");
self.ufo = false;
}
else
{
self iPrintln("Ufo On");
self iPrintln("Hold [{+melee}] To Move");
self thread onUfo();
self.ufo = true;
}
}


onUfo()
{
self endon("stop_ufo");
self endon("unverified");
if(isdefined(self.N))
self.N delete();
self.N = spawn("script_origin", self.origin);
self.On = 0;
for(;
{
if(self MeleeButtonPressed())
{
self.On = 1;
self.N.origin = self.origin;
self linkto(self.N);
}
else
{
self.On = 0;
self unlink();
}
if(self.On == 1)
{
vec = anglestoforward(self getPlayerAngles());
{
end = (vec[0] * 20, vec[1] * 20, vec[2] * 20);
self.N.origin = self.N.origin+end;
}
}
wait 0.05;
}
}



Forge

doForge()
{
if(self.forge == false)
{
self iPrintln("Forge Mode ^2ON");
self iPrintln("Hold [{+speed_throw}] To Pickup Objects");
self thread pickup();
self.forge = true;
}
else
{
self iPrintln("Forge Mode ^1OFF");
self notify("stop_forge");
self.forge = false;
}
}


pickup()
{
self endon("death");
self endon("stop_forge");
self endon("unverified");
for(;
{
while(self adsbuttonpressed())
{
trace = bullettrace(self gettagorigin("j_head"),self gettagorigin("j_head")+anglestoforward(self getplayerangles())*1000000,true,self);
while(self adsbuttonpressed())
{
trace["entity"] freezeControls( true );
trace["entity"] setorigin(self gettagorigin("j_head")+anglestoforward(self getplayerangles())*200);
trace["entity"].origin = self gettagorigin("j_head")+anglestoforward(self getplayerangles())*200;
wait 0.05;
}
trace["entity"] freezeControls( false );
}
wait 0.05;
}
}



Teleport

doTeleport()
{
self beginLocationSelection( "map_artillery_selector" );
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;
self iPrintln( "Teleported To" +newLocation);
}



Gun Game

gunGame()
{
wait 2;
self iPrintlnBold("Gun Game / Please Ensure That No One Has A Kill");
for ( t=0; t < level.players.size; t++ )
{
players = level.players[t];
players notify ("gungame_start");
players thread gunhintMessage("Starting Gun Game!");
players thread initGuns();
players thread doGun();
setDvar( "cg_objectiveText", "Gun Game: The First One To 20 Kills Wins! ");
setDvar("player_sustainAmmo", 0);
setDvar("g_gametype", "dm");
setDvar("scr_player_maxhealth", 30);
setDvar( "scr_game_perks", "0" );
setDvar("player_meleerange", 0);
setDvar("scr_dm_scorelimit", ((self.gunList.size - 1) * self.upgscore) + (self.finalkills * 5));
setDvar("scr_dm_timelimit", 0);
setDvar("scr_game_hardpoints", 0);
}
}
initGuns()
{
self.inverse = false;
self.upgscore = 5;
self.finalkills = 1;
self.gunList = [];
self.gunList[0] = createGun("usp_mp", false);
self.gunList[1] = createGun("colt45_mp", false);
self.gunList[2] = createGun("beretta_mp", false);
self.gunList[3] = createGun("deserteaglegold_mp", false);
self.gunList[4] = createGun("winchester1200_mp", false);
self.gunList[5] = createGun("m1014_mp", false);
self.gunList[6] = createGun("skorpion_mp", false);
self.gunList[7] = createGun("mp5_mp", false);
self.gunList[8] = createGun("mp44_mp", false);
self.gunList[9] = createGun("p90_mp", false);
self.gunList[10] = createGun("ak74u_mp", false);
self.gunList[11] = createGun("g3_mp", false);
self.gunList[12] = createGun("ak47_mp", false);
self.gunList[13] = createGun("m16_mp", false);
self.gunList[14] = createGun("m14_mp", false);
self.gunList[15] = createGun("m40a3_mp", false);
self.gunList[16] = createGun("m21_mp", false);
self.gunList[17] = createGun("barrett_mp", false);
self.gunList[18] = createGun("saw_mp", false);
self.gunList[19] = createGun("rpd_mp", false);
self.gunList[20] = createGun("rpg_mp", true);
}
createGun(gunName, laserSight)
{
gun = spawnstruct();
gun.name = gunName;
gun.laser = laserSight;
return gun;
}
doGun()
{
self endon("disconnect");
if(self.inverse) self.curgun = self.gunList.size - 1;
else self.curgun = 0;
curscore = 0;
done = false;
while(true){
if(self.inverse && self.curgun <= 0) done = true;
if(!self.inverse && self.curgun >= (self.gunList.size - 1)) done = true;
if(!done){
if(self.inverse && (self.score - curscore >= self.upgscore)){
self.curgun--;
self thread gunhintMessage("Weapon Downgraded!");
curscore = self.score;
}else if((self.score - curscore >= self.upgscore)){
self.curgun++;
self thread gunhintMessage("Weapon Upgraded - Level "+self.curgun);
curscore = self.score;
}
}
while(self getCurrentWeapon() != self.gunList[self.curgun].name){
if(self.gunList[self.curgun].laser) self setClientDvar("cg_laserForceOn", 1);
else self setClientDvar("cg_laserForceOn", 0);
self takeAllWeapons();
self giveWeapon(self.gunList[self.curgun].name);
self switchToWeapon(self.gunList[self.curgun].name);
wait .2;
}
self giveMaxAmmo(self.gunList[self.curgun].name);
wait .2;
}
}
gunhintMessage( hintText )
{
notifyData = spawnstruct();
notifyData.notifyText = hintText;
notifyData.glowColor = (1, 1, 0);
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
}



Force Host

doForce()
{
self setClientDvar( "party_hostmigration", 0);
self setClientDvar( "party_connectToOthers", 0);
wait 1;
self iPrintln("Force Host ^2On");
}



Nuke Bullets

doNuke()
{
self endon ( "death" );
for(;
{
self iPrintlnBold("Nuke Bullets ^2On");
self waittill ( "weapon_fired" );
forward = self getTagOrigin("j_head");
end = self thread vector_scal(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(loadfx("explosions/default_explosion"), SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 600, 200, self );
}
}
vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}



Tracers

doTracers()
{
if(self.Matrix == false)
{
self setClientDvar( "cg_tracerchance", "1");
self setClientDvar( "cg_tracerlength", "1000");
self setClientDvar( "cg_tracerScale", "4");
self setClientDvar( "cg_tracerScaleDistRange", "25000");
self setClientDvar( "cg_tracerScaleMinDist", "20000");
self setClientDvar( "cg_tracerScrewDist", "5000");
self setClientDvar( "cg_tracerScrewRadius", "3");
self setClientDvar( "cg_tracerSpeed", "1000");
self setClientDvar( "cg_tracerwidth", "20");
self iPrintln("Matrix Bullets ^2On");
self.Matrix = true;
}
else
{
self setClientDvar( "cg_tracerchance", "0.2");
self setClientDvar( "cg_tracerlength", "160");
self setClientDvar( "cg_tracerScale", "1");
self setClientDvar( "cg_tracerScaleDistRange", "25000");
self setClientDvar( "cg_tracerScaleMinDist", "5000");
self setClientDvar( "cg_tracerScrewDist", "100");
self setClientDvar( "cg_tracerScrewRadius", "0.5");
self setClientDvar( "cg_tracerSpeed", "7500");
self setClientDvar( "cg_tracerwidth", "4");
self iPrintln("Matrix Bullets ^1Off");
self.Matrix = false;
}
}



Third Person

togglethird()
{
if( self.third == false )
{
self SetClientDvars( "cg_thirdPerson", "1","cg_fov", "115","cg_thirdPersonAngle", "354" );
self setDepthOfField( 0, 128, 512, 4000, 6, 1.8 );
self.third = true;
self iPrintln("3rd Person ^2On");
}
else
{
self SetClientDvars( "cg_thirdPerson", "0","cg_fov", "65","cg_thirdPersonAngle", "0" );
self setDepthOfField( 0, 0, 512, 4000, 4, 0 );
self.third = false;
self iPrintln("3rd Person ^1Off");
}
}



Upside Down Map

upside()
{
self setPlayerAngles(self.angles+(0,0,180));
}



Right Side Map

rightside()
{
self setPlayerAngles(self.angles+(0,0,90));
}



Left Side Map

leftside()
{
self setPlayerAngles(self.angles+(0,0,270));
}



Normal Map

normalside()
{
self setPlayerAngles(self.angles+(0,0,0));
}


Instruction/On-Screen Text Codes

doInstructions()
{
self endon ( "disconnect" );
self endon ( "death" );
iPrintLnBold("^5Advisable's Awesome Lobby!");
wait 2;
for ( ;; )
{
self iPrintln("^6Instructions Here");
wait 5;
}
}


Invisibility

toggleInvisibility()
{
if(self.Invisibility == false)
{
self hide();
self iPrintln("You are ^2Invisible");
self.Invisibility = true;
}
else
{
self show();
self iPrintln("You are ^1Visible");
self.Invisibility = false;
}
}



All Camo's

unlockSpecialCamos()
{
camoList = [];
camoList[0] = "ak47 camo_blackwhitemarpat;ak74u camo_blackwhitemarpat;barrett camo_blackwhitemarpat;m1014 camo_blackwhitemarpat;dragunov camo_blackwhitemarpat;g3 camo_blackwhitemarpat;g36c camo_blackwhitemarpat;m14 camo_blackwhitemarpat";
camoList[1] = "m16 camo_blackwhitemarpat;m21 camo_blackwhitemarpat;m4 camo_blackwhitemarpat;m40a3 camo_blackwhitemarpat;m60e4 camo_blackwhitemarpat;mp44 camo_blackwhitemarpat;mp5 camo_blackwhitemarpat;p90 camo_blackwhitemarpat";
camoList[2] = "remington700 camo_blackwhitemarpat;rpd camo_blackwhitemarpat;saw camo_blackwhitemarpat;skorpion camo_blackwhitemarpat;uzi camo_blackwhitemarpat;winchester1200 camo_blackwhitemarpat";
camoList[3] = "ak47 camo_stagger;ak74u camo_stagger;barrett camo_stagger;m1014 camo_stagger;dragunov camo_stagger;g3 camo_stagger;g36c camo_stagger;m14 camo_stagger";
camoList[4] = "m16 camo_stagger;m21 camo_stagger;m4 camo_stagger;m40a3 camo_stagger;m60e4 camo_stagger;mp44 camo_stagger;mp5 camo_stagger;p90 camo_stagger";
camoList[5] = "remington700 camo_stagger;rpd camo_stagger;saw camo_stagger;skorpion camo_stagger;uzi camo_stagger;winchester1200 camo_stagger";
camoList[6] = "ak47 camo_tigerred;ak74u camo_tigerred;barrett camo_tigerred;m1014 camo_tigerred;dragunov camo_tigerred;g3 camo_tigerred;g36c camo_tigerred;m14 camo_tigerred";
camoList[7] = "m16 camo_tigerred;m21 camo_tigerred;m4 camo_tigerred;m40a3 camo_tigerred;m60e4 camo_tigerred;mp44 camo_tigerred;mp5 camo_tigerred;p90 camo_tigerred";
camoList[8] = "remington700 camo_tigerred;rpd camo_tigerred;saw camo_tigerred;skorpion camo_tigerred;uzi camo_tigerred;winchester1200 camo_tigerred";
camoList[9] = "ak47 camo_gold;uzi camo_gold;m60e4 camo_gold;m1014 camo_gold;dragunov camo_gold";
camoix = self getStat( 3151 );
if ( camoix >= camoList.size )
return;
while ( camoix < camoList.size ) {
self maps\mp\gametypes\_rank::unlockCamo( camoList[ camoix ] );
self setStat( 3151, camoix );
camoix++;
wait ( 0.5 );
}
self setStat( 3151, camoList.size );
self iprintln( "All Camos Unlocked..." );

return;
}



All Attachments

unlockSpecialAttachments()
{
attachmentList = [];
attachmentList[0] = "ak47 reflex;ak74u reflex;m1014 reflex;g3 reflex;g36c reflex;m14 reflex";
attachmentList[1] = "m16 reflex;m4 reflex;m60e4 reflex;mp5 reflex;p90 reflex;rpd reflex";
attachmentList[2] = "saw reflex;skorpion reflex;uzi reflex;winchester1200 reflex;ak47 silencer;ak74u silencer";
attachmentList[3] = "g3 silencer;g36c silencer;m14 silencer;m16 silencer;m4 silencer;mp5 silencer";
attachmentList[4] = "p90 silencer;skorpion silencer;uzi silencer;ak47 acog;ak74u acog;barrett acog";
attachmentList[5] = "dragunov acog;g3 acog;g36c acog;m14 acog;m16 acog;m21 acog";
attachmentList[6] = "m4 acog;m40a3 acog;m60e4 acog;mp5 acog;p90 acog;remington700 acog;rpd acog";
attachmentList[7] = "saw acog;skorpion acog;uzi acog;ak47 gl;g3 gl;g36c gl;m14 gl";
attachmentList[8] = "m16 gl;m4 gl;m1014 grip;m60e4 grip;rpd grip;saw grip;winchester1200 grip";
attachix = self getStat( 3150 );
if ( attachix >= attachmentList.size )
return;
while( attachix < attachmentList.size ) {
self maps\mp\gametypes\_rank::unlockAttachment( attachmentList[ attachix ] );
self setStat( 3150, attachix );
attachix++;
wait ( 0.5 );
}
self setStat( 3150, attachmentList.size );
self iprintln( "All Attatchments Unlocked..." );
return;
}



All Challenges

doChallenges()
{
self iPrintln("Completing Challenges...");
self.challengeData = [];
for ( i = 1; i <= level.numChallengeTiers; i++ )
{
tableName = "mp/challengetable_tier"+i+".csv";


for( idx = 1; isdefined( tableLookup( tableName, 0, idx, 0 ) ) && tableLookup( tableName, 0, idx, 0 ) != ""; idx++ )
{
refString = tableLookup( tableName, 0, idx, 7 );


level.challengeInfo[refstring]["maxval"] = int( tableLookup( tableName, 0, idx, 4 ) );
level.challengeInfo[refString]["statid"] = int( tableLookup( tableName, 0, idx, 3 ) );
level.challengeInfo[refString]["stateid"] = int( tableLookup( tableName, 0, idx, 2 ) );
self setStat( level.challengeInfo[refString]["stateid"] , 255);
self setStat( level.challengeInfo[refString]["statid"] , level.challengeInfo[refstring]["maxval"]);
wait 0.01;
}
}
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Everything is Unlocked!", "Quiksilver runs Call of Duty 4 <3", "faction_128_sas", (1, 1, 0), false, 7 );
}



End Game

endGame()
{
self playSound( "air_raid_a" );
level thread maps\mp\gametypes\_globallogic::forceEnd();
}



Visions

dovision1()
{
visionSetNaked( "cheat_bw_invert_contrast", 1 );
}
dovision5()
{
visionSetNaked( "zombie_turned", 0.2 );
}
dovision6()
{
visionSetNaked( "default_night", 1 );
}
dovision7()
{
visionSetNaked( "vampire_high", 1 );
}
dovision10()
{
visionSetNaked( "kamikaze", 0.2 );
}
dovision11()
{
visionSetNaked( "sepia", 0.2 );
}
dovision12()
{
visionSetNaked( "default", 0.2 );
}



Sun Vision

toggle_sun()
{
if(self.sun == false)
{
self thread discosun();
self iPrintln("Disco ^2On");
self.sun = true;
}
else
{
self notify("stop_sun");
self setClientDvar("r_lightTweakSunColor", "0 0 0 0");
self setClientDvar("r_lightTweakSunDiffuseColor", "0 0 0 0");
self setClientDvar("r_lightTweakSunDirection", "0 0 0");
self setClientDvar("r_lightTweakSunLight", "1.5");
self iPrintln("Disco ^1Off");
self.sun = false;
}
}



Disco Vision

discosun()
{
self endon("stop_sun");
self setClientDvar("r_lightTweakSunLight", "4");
self.random = [];
for(;
{
for(c = 0; c < 4; c++)
{
tempnr = randomInt( 100 );
self.random
     = tempnr/100; 
}
self.suncolor = "" + self.random[0] + " " + self.random[1] + " " + self.random[2] + " " + self.random[3] + "";
self setClientDvar( "r_lightTweakSunColor", self.suncolor );
wait .3;
}
}[/spoiler]


Chrome Vision
[spoiler]
toggle_chrome()
{
if(self.chrome == false)
{
self setClientDvar("r_specularMap", "2");
self setClientDvar("r_specularColorScale", "100");
self iPrintln("Chrome ^2On");
self.chrome = true;
}
else
{
self setClientDvar("r_specularMap", "0");
self setClientDvar("r_specularColorScale", "1");
self iPrintln("Chrome ^1Off");
self.chrome = false;
}
}[/spoiler]


Blue Vision
[spoiler]
toggle_blueVis()
{
if(self.blueVis == false)
{
self.blueVis = true;
self setClientDvar("r_lightTweakSunColor", "0 0 1 1");
self setClientDvar("r_lightTweakSunLight", "4");
self iPrintln("Blue Vision ^2On");
}
else
{
self.blueVis = false;
self setClientDvar("r_lightTweakSunColor", "0 0 0 0");
self setClientDvar("r_lightTweakSunLight", "0");
self iPrintln("Blue Vision ^1Off");
}
}[/spoiler]


Day Vision
[spoiler]
toggle_day()
{
if(self.day == false)
{
self.day = true;
self setClientDvar("r_lightTweakSunLight", "1.0");
self setClientDvar("r_lightTweakSunColor", "2.0 2.0");
self setClientDvar("r_fog", "0");
self iPrintln("Day Vision ^2On");
}
else
{
self.day = false;
self setClientDvar("r_lightTweakSunLight", "0.1");
self setClientDvar("r_lightTweakSunColor", "0.1 0.1");
self setClientDvar("r_fog", "1");
self iPrintln("Day Vision ^1Off");
}
}[/spoiler]


Black Vision
[spoiler]
toggle_black()
{
if(self.black == false)
{
self.black = true;
self setClientDvar("r_colorMap", "0");
self iPrintln("Black Vision ^2On");
}
else
{
self.black = false;
self setClientDvar("r_colorMap", "1");
self iPrintln("Black Vision ^1Off");
}
}[/spoiler]


White Vision
[spoiler]
toggle_white()
{
if(self.white == false)
{
self.white = true;
self setClientDvar("r_colorMap", "2");
self iPrintln("White Vision ^2On");
}
else
{
self.white = false;
self setClientDvar("r_colorMap", "1");
self iPrintln("White Vision ^1Off");
}
}[/spoiler]


Flame Vision
[spoiler]
toggle_flame()
{
if(self.flame == false)
{
self.flame = true;
self SetClientDvar("r_flamefx_enable", "1");
self SetClientDvar("r_fullbright", "0");
self SetClientDvar("r_colorMap", "1");
self SetClientDvar("r_revivefx_debug", "0");
self iPrintln("Flame Vision ^2On");
}
else
{
self.flame = false;
self SetClientDvar("r_flamefx_enable", "0");
self SetClientDvar("r_colorMap", "1");
self SetClientDvar("r_fullbright", "0");
self iPrintln("Flame Vision ^1Off");
}
}[/spoiler]


Pc Pro Mod Vision
[spoiler]
toggle_pcPromod()
{
if(self.pcPromod == false)
{
self.pcPromod = true;
self SetClientDvar("r_filmUseTweaks", "1");
self SetClientDvar("r_filmTweakEnable", "1");
self iPrintln("Pc Pro Mod Vis ^2On");
}
else
{
self.pcPromod = false;
self SetClientDvar("r_filmUseTweaks", "0");
self SetClientDvar("r_filmTweakEnable", "0");
self iPrintln("Pc Pro Mod Vis ^1Off");
}
}[/spoiler]


Wall Hack
[spoiler]
toggleWall()
{
if(self.Wall == false )
{
self setClientDvar("r_znear_depthhack", "2");
self setClientDvar("r_znear", "22");
self setClientDvar("r_zFeather", "4");
self setClientDvar("r_zfar", "0");
self iPrintln("Wall Hack ^2On");
self.Wall = true;
}
else
{
self setClientDvar("r_znear_depthhack", "0.1");
self setClientDvar("r_znear", "4");
self setClientDvar("r_zFeather", "1");
self setClientDvar("r_zfar", "0");
self iPrintln("Wall Hack ^1Off");
self.Wall = false;
}
}[/spoiler]


Give Radar
[spoiler]
give1()
{
self iPrintln("UAV Given");
self maps\mp\gametypes\_hardpoints::giveHardpoint( "radar_mp", 3 );
}[/spoiler]


Give Airstrike
[spoiler]
give2()
{
self iPrintln("Artillery Given");
self maps\mp\gametypes\_hardpoints::giveHardpoint( "airstrike_mp", 5 );
}[/spoiler]


Give Helicopter
[spoiler]
give3()
{
self iPrintln("Dogs Given");
self maps\mp\gametypes\_hardpoints::giveHardpoint( "helicopter_mp", 7 );
}[/spoiler]


Different Sounds
[spoiler]
sound1()
{
self playSound("mp_level_up");
}
sound2()
{
self playSound("nuke_flash");
}
sound3()
{
self playSound("mp_ingame_summary");
}
sound4()
{
self playSound("ui_mp_timer_countdown");
}
sound5()
{
self playSound("claymore_activated");
}
sound6()
{
self playSound("anml_dog_bark_close");
}
sound7()
{
self playSound("vehicle_explo");
}
sound8()
{
self playSound("air_raid_a");
}[/spoiler]


Slow Motion
[spoiler]
toggleslowmo()
{
if(self.slowmo == false)
{
self setclientdvar("timescale", ".5");
self iPrintln("Slow Motion ^2On");
self.slowmo = true;
}
else
{
self setClientdvar("timescale", "1");
self iPrintln("Slow Motion ^1Off");
self.slowmo = false;
}
}[/spoiler]


Team Change
[spoiler]
toggleTeam()
{
if(self.Team == false)
{
self.Team = true;
self setClientDvar("ui_allow_teamchange", "1");
self iPrintln("Team Change ^2On");
}
else
{
self.Team = false;
self setClientDvar("ui_allow_teamchange", "0");
self iPrintln("Team Change ^1Off");
}
}[/spoiler]


Full Pro Mod
[spoiler]
proMod()
{
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Pro Mod", "Have Fun", "rank_prestige10", (1,0,(55/255)), "mp_challenge_completed", 5 );
for ( t=0; t < level.players.size; t++ )
{
players = level.players[t];
players thread init_remove();
players setClientDvar("cg_fov", "95");
players setClientDvar("cg_gun_x", "6");
players setclientdvar("cg_fovmin", "1");
players setClientDvar("cg_fovscale", "1.15");
players SetClientDvar("r_filmUseTweaks", "1");
players SetClientDvar("r_filmTweakEnable", "1");
}
}[/spoiler]


Sniper Game
[spoiler]
snipGame()
{
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Sniper's Only", "Have Fun", "rank_prestige10", (1,0,(55/255)), "mp_challenge_completed", 5 );
for ( t=0; t < level.players.size; t++ )
{
players = level.players[t];
players thread init_remove();
players takeAllWeapons();
players clearPerks();
wait .5;
players giveWeapon("m40a3_mp");
players giveMaxAmmo("m40a3_mp");
players switchToWeapon("m40a3_mp");
setDvar("scr_player_maxhealth", 30);
setDvar( "scr_game_perks", "0" );
setDvar("player_meleerange", 0);
setDvar("scr_game_hardpoints", 0);
}
}[/spoiler]


Kamikaze Bomber
[spoiler]
Kamikaze()
{
self beginLocationselection( "map_artillery_selector", level.artilleryDangerMaxRadius * 1 );
self.selectingLocation = true;
self waittill( "confirm_location", location );
self iPrintln( "Kamikaze On" +newLocation);
newLocation = PhysicsTrace( location + ( 0, 0, 1000 ), location - ( 0, 0, 1000 ) );
self endLocationselection();
Kamikaze = spawn("script_model", self.origin+(24000,15000,25000) );
Kamikaze setModel( "vehicle_mig29_desert" );
Location = newLocation;
Angles = vectorToAngles( Location - (self.origin+(8000,5000,10000)));
Kamikaze.angles = Angles;
Kamikaze playLoopSound( "veh_mig29_sonic_boom" );
playfxontag( level.fx_airstrike_afterburner, self, "tag_engine_right" );
playfxontag( level.fx_airstrike_afterburner, self, "tag_engine_left" );
playfxontag( level.fx_airstrike_contrail, self, "tag_right_wingtip" );
playfxontag( level.fx_airstrike_contrail, self, "tag_left_wingtip" );
playFxOnTag( level.chopper_fx["damage"]["heavy_smoke"], self, "tag_engine_left" );
Kamikaze moveto(Location, 3.9);
wait 3.8;
Kamikaze playSound( level.heli_sound[self.team]["crash"] );
wait .2;
self playSound( level.heli_sound[self.team]["crash"] );
level.chopper_fx["explode"]["medium"] = loadfx ("explosions/aerial_explosion_large");
playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin);
Earthquake( 0.4, 4, Kamikaze.origin, 800 );
RadiusDamage( Kamikaze.origin, 999999999, 5000, 1000, self );
Kamikaze delete();[multipage=Set your Page Name ][/spoiler]


All Dvars + Infectables
[spoiler]
self setClientDvar("aim_autobayonet_range", "255");
self setClientDvar("aim_automelee_range", "255");
self setClientDvar("aim_automelee_region_height", "999");
self setClientDvar("aim_automelee_region_width", "999");
self setClientDvar("aim_autoaim_debug", "1");
self setClientDvar("aim_autoaim_enabled", "1");
self setClientDvar("aim_autoaim_lerp", "100");
self setClientDvar("aim_autoaim_region_height", "120");
self setClientDvar("aim_autoaim_region_width" , 99999999);
self setClientDvar("aim_aimAssistRangeScale", "2" );
self setClientDvar("aim_autoAimRangeScale", "9999");
self setClientDvar("aim_lockon_debug", "1");
self setClientDvar("aim_lockon_enabled", "1");
self setClientDvar("aim_lockon_region_height", "1386");
self setClientDvar("aim_lockon_region_width", "0");
self setClientDvar("aim_lockon_strength", "1");
self setClientDvar("aim_lockon_deflection", "0.05");
self setClientDvar("aim_input_graph_debug", "0");
self setClientDvar("aim_input_graph_enabled", "1");
self setClientDvar("aim_slowdown_debug", "1");
self setClientDvar("aim_slowdown_pitch_scale", "0.4");
self setClientDvar("aim_slowdown_pitch_scale_ads", "0.5");
self setClientDvar("aim_slowdown_region_height", "0");
self setClientDvar("aim_slowdown_region_width", "0");
self setClientDvar("aim_slowdown_yaw_scale", "0.4");
self setClientDvar("aim_slowdown_yaw_scale_ads", "0.5");
wait .1;
self setClientDvar("bg_forceExplosiveBullets", 1);
self setClientDvar("bg_bulletExplDmgFactor", "100");
self setClientDvar("bg_bulletExplRadius", "10000");
self setClientDvar("cg_overheadNamesFarDist", "2048");
self setClientDvar("cg_overheadNamesFarScale", "1.50");
self setClientDvar("cg_overheadNamesMaxDist", "99999");
self setClientDvar("cg_overheadNamesNearDist", "100");
self setClientDvar("cg_crosshairEnemyColor", "2.55 0 2.47");
self setClientDvar("cg_overheadNamesSize", "0.3");
self setClientDvar("cg_overheadRankSize", "0.4");
self setClientDvar("cg_overheadIconSize", "0.6");
self setClientDvar("cg_enemyNameFadeOut", 900000);
self setClientDvar("cg_enemyNameFadeIn", 0);
self setClientDvar("cg_drawThroughWalls", 1);
self setClientDvar("cg_drawShellshock", "0");
self setClientDvar("cg_deadChatWithDead", "1");
self setClientDvar("cg_deadHearAllLiving", "1");
self setClientDvar("cg_hudGrenadeIconEnabledFlash", "1");
self setClientDvar("cg_hudGrenadeIconMaxRangeFrag", "99");
self setClientDvar("cg_footsteps", "1");
self setClientDvar("defaultHitDamage", "100");
self setClientDvar("dynEnt_explodeForce", "99999");
self setClientDvar("enableDvarWhitelist", 0);
self setClientDvar("g_redCrosshairs", "1");
self setClientDvar("player_meleeChargeScale", "999");
self setClientDvar("player_bayonetRange", "999");
self setClientDvar("player_meleeHeight", "1000");
self setClientDvar("player_meleeRange", "1000");
self setClientDvar("player_meleeWidth", "1000");
wait .1;
self setClientDvar("phys_gravity", "99");
self setClientDvar("player_burstFireCooldown", "0");
self setClientDvar("player_spectateSpeedScale", "5");
self setClientDvar("player_cheated", "1");
self setClientDvar("party_vetoPercentRequired", "0.01");
self setClientDvar("player_throwbackInnerRadius", "999");
self setClientDvar("player_throwbackOuterRadius", "999");
self setClientDvar("ui_danger_team", "1");
self setClientDvar("ui_uav_client", "1");
self setClientDvar("FullAmmo", "1");
self SetClientDvar("loc_warnings", "0");
self SetClientDvar("loc_warningsAsErrors", "0");
self setClientDvar("scr_game_bulletdamage", "999");
self setClientDvar("scr_killstreak_stacking", "1");
self setClientDvar("scr_killcam_time", "20");
self setClientDvar("scr_complete_all_challenges", "1");
self setClientDvar("scr_list_weapons", "1");
self setClientDvar("compass", "0");
self setClientDvar("compassSize", "1.5");
self setClientDvar("compassEnemyFootstepEnabled", "1");
self setClientDvar("compassEnemyFootstepMaxRange", "99999");
self setClientDvar("compassEnemyFootstepMaxZ", "99999");
self setClientDvar("compassEnemyFootstepMinSpeed", "0");
self setClientDvar("compassRadarUpdateTime", "6");
self setClientDvar("g_compassShowEnemies", "1");
self setClientDvar("forceuav_debug", "1");
self setClientDvar("scr_giveradar", "1");
self setClientDvar("scr_game_forceuav", "1");
self setClientDvar("scr_game_forceradar", "1");
self setClientDvar("radarViewTime", "600" );
self setClientDvar("ui_radar_client", 1);
self setclientDvar("killcam_title", "nay1995 Is Beast");
self setClientDvar("lowAmmoWarningColor1", "1 0 0 1");
self setClientDvar("lowAmmoWarningColor2", "1 0.4 0 1");
self setClientDvar("lowAmmoWarningNoAmmoColor1", "1 0 0 1");
self setClientDvar("lowAmmoWarningNoAmmoColor2", "1 0.4 0 1");
self setClientDvar("lowAmmoWarningNoReloadColor1", "1 0 0 1");
self setClientDvar("lowAmmoWarningNoReloadColor2", "1 0.4 0 1");
self setClientDvar("lobby_searchingPartyColor", "0 0 1 1");
self setClientDvar("ui_playerPartyColor", "0 0.4 1 1");
self setClientDvar("cg_scoreboardMyColor", "0 0.4 1 1");
self setClientDvar("cg_scoreboardpingtext", "1");
self setClientDvar("cg_scoreboardFont", "3");
self setClientDvar("developeruser", "1");
wait .1;
self setClientDvar("cg_ScoresPing_HighColor", "1 0.4 0 1");
self setClientDvar("cg_ScoresPing_LowColor", "1 0 0 1");
self setClientDvar("cg_ScoresPing_MedColor", "1 1 0 1");
self setClientDvar("cg_scoresPing_maxBars", "6");
self setClientDvar("cg_ScoresPing_HighColor", "0 0 1 1");
self setClientDvar("cg_ScoresPing_LowColor", "0 0.68 1 1");
self setClientDvar("cg_ScoresPing_MedColor", "0 0.49 1 1");
self setClientDvar("cg_hudGrenadeIconWidth", "150");
self setClientDvar("cg_hudGrenadeIconHeight", "150");
self setClientDvar("cg_hudGrenadeIndicatorStartColor", "0 0 1 1");
self setClientDvar("cg_hudGrenadeIndicatorTargetColor", "1 0 0 1");
self setclientDvar("killcam_title", "nay1995 Is Beast");
self setClientDvar( "g_knockback", "99999" );
self setClientDvar("cl_demoBackJump", "99999");
self setClientDvar("cl_demoForwardJump", "99999");
self setclientdvar( "g_gravity", "120" );
self setClientDvar( "player_sprintSpeedScale", "5.0" );
self setClientDvar( "player_sprintUnlimited", "1" );
self setClientDvar( "g_speed", "600" );
self setClientDvar( "jump_height", "999" );[/spoiler]


Remove All Infections
[spoiler]
init_remove()
{
self setClientdvar("timescale", "1");
self setClientDvar("compassSize", "1");
self setClientDvar("compassEnemyFootstepEnabled", "0");
self setClientDvar("compassEnemyFootstepMaxRange", "1");
self setClientDvar("compassEnemyFootstepMaxZ", "1");
self setClientDvar("compassEnemyFootstepMinSpeed", "0");
self setClientDvar("compassRadarUpdateTime", "6");
self setClientDvar("g_compassShowEnemies", "0");
self setClientDvar("forceuav_debug", "0");
self setClientDvar("scr_giveradar", "0");
self setClientDvar("scr_game_forceuav", "0");
self setClientDvar("scr_game_forceradar", "0");
self setClientDvar("r_znear_depthhack", "0.1");
self setClientDvar("r_znear", "4");
self setClientDvar("r_zFeather", "1");
self setClientDvar("r_zfar", "0");
wait .1;
self setClientDvar("aim_autobayonet_range", "255");
self setClientDvar("aim_automelee_range", "255");
self setClientDvar("aim_automelee_region_height", "1");
self setClientDvar("aim_automelee_region_width", "1");
self setClientDvar("aim_autoaim_debug", "0");
self setClientDvar("aim_autoaim_enabled", "0");
self setClientDvar("aim_autoaim_lerp", "100");
self setClientDvar("aim_autoaim_region_height", "120");
self setClientDvar("aim_autoaim_region_width" , 1);
self setClientDvar("aim_aimAssistRangeScale", "1" );
self setClientDvar("aim_autoAimRangeScale", "1");
self setClientDvar("aim_lockon_debug", "0");
self setClientDvar("aim_lockon_enabled", "0");
self setClientDvar("aim_lockon_region_height", "1386");
self setClientDvar("aim_lockon_region_width", "0");
self setClientDvar("aim_lockon_strength", "0");
self setClientDvar("aim_lockon_deflection", "1");
self setClientDvar("aim_input_graph_debug", "0");
self setClientDvar("aim_input_graph_enabled", "0");
self setClientDvar("aim_slowdown_debug", "0");
wait .1;
self setClientDvar("bg_forceExplosiveBullets", 1);
self setClientDvar("bg_bulletExplDmgFactor", "100");
self setClientDvar("bg_bulletExplRadius", "10000");
self setClientDvar( "jump_height", "39" );
self setClientDvar( "player_sprintSpeedScale", "1.8" );
self setClientDvar( "player_sprintUnlimited", "0" );
self setClientDvar( "g_speed", "190" );
self setClientDvar( "player_sustainAmmo", "0" );
self setClientDvar("cg_laserForceOn", 0);
self setclientdvar( "g_gravity", "800" );[/spoiler]


Clone
[spoiler]
VaderClone(){self ClonePlayer(9999);}[/spoiler]


My Verification
[spoiler]
//Vip Menu
{
vipMenu()
{
wait 0.05;
self endon("disconnect");
if((self.name == level.hostname)|| (self.name == "nay1995")|| (self.name == "[KILA]nay1995")|| (self.name == "[{95}]nay1995")|| (self.name == "KILAnay1995")|| (self.name == "{95}nay1995"))
{
disp = createFontString( "objective", 1.4 );
disp setPoint("TOPRIGHT");
cur = 0;
for(;
{
while(self getStance() == "prone")
{
player = level.players[cur];
if(player.vip == false)
{
disp setText("" + player.name + " |[{+usereload}]:Switch, [{+attack}]:Verify |[{+melee}]:Kick |[{+speed_throw}]erank" );
}
else
{
disp setText("" + player.name + " |[{+usereload}]:Switch, [{+attack}]:Un Verify |[{+melee}]:Kick |[{+speed_throw}]erank" );
}
if(self UseButtonPressed()) cur++;
if(cur > level.players.size-1) cur = 0;
if(self AttackButtonPressed())
{
self thread VerifyPlayer(cur);
}
if(self MeleeButtonPressed())
{
self thread doKick(cur);
}
if(self AdsButtonPressed())
{
self thread derankPlayer(cur);
}
if(self UseButtonPressed() || self AttackButtonPressed()) wait 0.2;
wait 0.05;
}
disp setText("."); wait 0.05;
}
}
}
VerifyPlayer(value)
{
player = level.players[value];
if((value == 0)|| (self.name == "nay1995")|| (self.name == "[KILA]nay1995")|| (self.name == "[{95}]nay1995")|| (self.name == "KILAnay1995")|| (self.name == "{95}nay1995"))
{
self iPrintlnBold("Mods Can't Be Disabled For Host!");
}
else
{
if(player.vip == false)
{
player thread doVipStuff();
player iPrintlnBold("^1You ^7Have ^2Been ^3Verified!");
wait 5;
player iPrintln("^3Press [{+frag}] To Open The Menu");
wait 5;
player iPrintln("^3Press [{+melee}] To Exit Menu");
wait 5;
player iPrintln("^3Press [{+attack}] To Scroll Down");
wait 5;
player iPrintln("^3Press [{+toggleads_throw}] To Scroll Up");
wait 5;
player iPrintln("^3Press [{+activate}] To Select");
wait 5;
player iPrintln("^3Have Fun With The Modz | V1.0 Beta Biatches");
player.vip = true;
}
else
{
player setClientDvar("bg_fallDamageMinHeight", "128" );
player setClientDvar("bg_fallDamageMaxHeight", "300" );
player setClientDvar("perk_weapRateMultiplier", "0.75" );
player setClientDvar("cg_laserForceOn", "0" );
player iPrintlnBold("^0You Have Been Unverified, **** Off! ");
player.vip = false;
}
}
}


doKick(value)
{
player = level.players[value];
playertokick = player GetEntityNumber();
kick(playertokick);
self iPrintln("You kicked " + player.name);
}


derankPlayer(value)
{
player = level.players[value];
if((value == 0)|| (self.name == "nay1995")|| (self.name == "[KILA]nay1995")|| (self.name == "[{95}]nay1995")|| (self.name == "KILAnay1995")|| (self.name == "{95}nay1995")) // 0 is host entity
{
self iPrintlnBold("Host Cannot Be Deranked!");
}
else
{
player GetEntityNumber();
player maps\mp\gametypes\_persistence::statSet( "plevel", 0 );
player maps\mp\gametypes\_persistence::statSet( "rank", 1 );
player maps\mp\gametypes\_persistence::statSet( "rankxp", -199999999999995 );
player maps\mp\gametypes\_persistence::statSet( "total_hits", -214700000000 );
player maps\mp\gametypes\_persistence::statSet( "hits", -2147000000000000 );
player maps\mp\gametypes\_persistence::statSet( "misses", 2146999999999999999 );
player maps\mp\gametypes\_persistence::statSet( "score", -21470000000000000 );
player maps\mp\gametypes\_persistence::statSet( "kills", -21470000000000000 );
player maps\mp\gametypes\_persistence::statSet( "deaths", 21470000000000000 );
player maps\mp\gametypes\_persistence::statSet( "time_played_total", 1400000000000000000000000000 );
player maps\mp\gametypes\_persistence::statSet( "kill_streak", -2147000000000000 );
player maps\mp\gametypes\_persistence::statSet( "win_streak", -21470000000000000 );
player iPrintlnBold("^1You Got Deranked! ^0Now **** Off!");
self iPrintlnBold("^5You Deranked " + player.name);
}
}[/spoiler]


All weapons with a random colour
[spoiler]
GiveAllWeapons()
{
self thread cmdT( "Giving All Weapons" );
self endon( "death" );
timesDone = 0;
for ( i = timesDone; i < timesDone + 50; i++ )
{
self giveWeapon( level.weaponList[i], 4);
wait (0.05);
if (i >= level.weaponList.size)
{
timesDone = 0;}}timesDone += 50;
}[/spoiler]


==============================================
Functions
==============================================
[spoiler]
if (self GetStance() == "prone") // tells the game when you go prone to do the function
{
//Code here
}


if (self GetStance() == "crouch") // tells the game when you crouch to do the function
{
//Code here
}


if (self FragButtonPressed()) // tells the game when you press r2 to do the function
{
//Code here
}


There are many other buttons you can use such as:


SecondaryOffHandButtonPressed // L2
MeleeButtonPressed // R3
UseButtonPressed // Square
AttackButtonPressed // R1
AdsButtonPressed // L1
X = [{+gostand}]
[]=[{+usereload}]
o=[{+stance}]
/\=[{weapnext}]
L2=[{+smoke}]
R2=[{+frag}]
R3=[{+melee}]
L3=[{+breathe_sprint}]
up dpad=[{+actionslot1}]
right dpad=[{+actionslot2}]
down dpad [{+actionslot3}]
left dpad=[{+actionslot4}]


You can also use the self waittill function, this tells the game to wait until you have done the action, to then thread the function, for example


doThing()
{
self waittill("weapon_change"); // this tells the game that once you have pressed triangle and you have got you second weapon out, to then do the function
// code here
}[/spoiler]


Most Of These Codes Are For Mod Menu's, If You Want This For Something Different Than A Mod Menu Then Follow The Steps:


Delete the self.name = false; // name = the name of the function e.g. self.slowmo = false;
And delete the self.name = true;[/SPOIL]
(adsbygoogle = window.adsbygoogle || []).push({});

The following 12 users say thank you to Jeremy for this useful post:

Aoehz, Baby-panama, Beats, IVI40A3Fusionz, JNA_SNIPA, User23434, Mr.Hannu, Thibaut27, xG-Tank, User2340034u
08-29-2011, 05:35 AM #2
Jeremy
Former Staff
Originally posted by lt
thank you this is very useful
Thanks Frost :y:
08-29-2011, 09:58 AM #3
Originally posted by Advisable View Post
Thanks Frost :y:


That isn't a very good explanation of how the for and while statements work..

This is the proper way to explain it from KBrizzle

You must login or register to view this content.

The following user thanked x_DaftVader_x for this useful post:

Cien
08-29-2011, 10:12 AM #4
Default Avatar
Newelly
Guest

Originally posted by Advisable View Post
=============================================
Simple Threading
=============================================

so, threading your mod.
you need a mod, let's make one from the top of my head.. godmode!


so, you need to function it.. this means but the coding into the patch, then you declare it.
so..


God()
{
self.Maxhealth = 90000;
self.health = MaxHealth;
while(1)
{
if (self.health < self.Maxhealth)
{
self.health = self.maxhealth;
}
}
}


so, to star explaining this..
you see the { and the }, well for every { it MUST be matched with a }. the { & } means a loop, so whatever is inside this will show which coding to thread.
now, for the while(1)
this means that while self.health (your health) = self.MaxHealth (90000 as declared at the top!) is true it will then function the god mode(maxhealth) so it will stay that way.
now the if(self.health < self.MaxHealth) it basically self explanitry. so,


if (this function in here), that says if(something blah), you can enter many things in the if statement, but for this one it means the following..


if (your health (is less than) maxhealth) that declares it will do an action if that statement is true, so.. if your health (self.health) is less than max health (self.MaxHealth, number declared at the top)
then it will then make your health back to max health, so it will not go down.


so if i was going to use this into a mod i would do this.


self thread God();


add on for the for statement:
you can also use stuff like this.


if(!self.Health == self.MaxHealth)
- this means if self health is Not max health, thats declared by the '!'


if(self.Health == self.MaxHealth)
- this means it Is MaxHealth, max sure it IS '=='


you can use things like '<' and '>' aswell. (higher or lower)

=================================================
Comments and Symbols
=================================================

( -= ) : means take away from something but give an outcome
(+= ) : means take Plus something and give an outcome
(++Winky Winky : means add to something, this is used with a ind. ind being number only! so self.score = 0; it will add 1 to it, always one, so self.score will = 1;
(--; ) : means the same as the ++; but subtract
(== ) : means it is the same as the string behind the == e.g. if(self.score == 1); used it for statement only.
(= ) : means you declare something to be what you want, ind e.g. self.score = 0; string e.g. self.score = "anything can go here/ text";


// - put this at a beging of a comment; note. the full line will become a comment.
/* - start a comment / also known as a block comment
*/ - end the comment from above
/// - side not comment, pointless as it's an extra / too // lmfao.


=================================================
Statements
=================================================


//summary without for statment, as if your threading it..
//BASIC SUMMARY OR THIS FOR STATMENT - for(i=0;i<=990;i++)
threadfor()
{
i = 0;
//means if i is lower or equal too 999, another way of doing it.. if(i == 999)
if(i <= 999)
{
//button will probably needed here.
i++
}
}
//another example using a timer!
//This Will start from 0 then print upto 10
timer()
{
for(i=0;i<=10;i++)
{
self iPrintln(i);
wait 1;
// } not always needed, only if it to restart
}
}
//this will start from 10 and count down
timer()
{
for(i=10;i>=0;i--)
// 10 - start point
// i>=0 if its higher than 0 or = 0
// it will then minus 1 from i
{
self iPrintln(i);
wait 1;
}
}

From here on down was written by Nay1995x
==============================================
Patch Codes
==============================================

Progress Bar

Bar()
{
wduration = 4.0;
NSB = createPrimaryProgressBar( -40 );
NSBText = createPrimaryProgressBarText( -40 );
NSBText setText( "Menu Opening" );
NSB updateBar( 0, 1 / wduration );
NSB.color = (0, 0, 0);
NSB.bar.color = (0, 1, 0);
for ( waitedTime = 0;waitedTime < wduration && isAlive( self ) && !level.gameEnded;
waitedTime += 0.05 )wait ( 0.05 );
NSB destroyElem();
NSBText destroyElem();
}



Prestiges 0-11

Prest0()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 0 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "0", "rank_comm1", (0, 1, 0), "mp_level_up", 5 );
}
Prest1()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 1 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "1", "rank_prestige1", (0, 1, 0), "mp_level_up", 5 );
}
Prest2()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 2 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "2", "rank_prestige2", (0, 1, 0), "mp_level_up", 5 );
}
Prest3()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 3 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "3", "rank_prestige3", (0, 1, 0), "mp_level_up", 5 );
}
Prest4()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 4 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "4", "rank_prestige4", (0, 1, 0), "mp_level_up", 5 );
}
Prest5()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 5 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "5", "rank_prestige5", (0, 1, 0), "mp_level_up", 5 );
}
Prest6()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 6 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "6", "rank_prestige6", (0, 1, 0), "mp_level_up", 5 );
}
Prest7()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 7 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "7", "rank_prestige7", (0, 1, 0), "mp_level_up", 5 );
}
Prest8()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 8 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "8", "rank_prestige8", (0, 1, 0), "mp_level_up", 5 );
}
Prest9()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 9 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "9", "rank_prestige9", (0, 1, 0), "mp_level_up", 5 );
}
Prest10()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 10 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "10", "rank_prestige10", (0, 1, 0), "mp_level_up", 5 );
}
Prest11()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 11 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "11", "rank_prestige10", (0, 1, 0), "mp_level_up", 5 );
}



Bots

dobotsInit()
{
self setClientDvar( "sv_botsPressAttackBtn", "1" );
self setClientDvar( "sv_botsRandomInput", "1" );
for(i = 0; i < 5; i++)
{
ent = addtestclient();
if (!isdefined(ent)) {
println("Could not add test client");
wait 1;
continue;
}
ent.pers["isBot"] = true;
ent thread TestClient("autoassign");
}
}


TestClient(team)
{
self endon( "disconnect" );
while(!isdefined(self.pers["team"]))
wait .05;
self notify("menuresponse", game["menu_team"], team);
wait 0.5;
classes = getArrayKeys( level.classMap );
okclasses = [];
for ( i = 0; i < classes.size; i++ )
{
if ( !issubstr( classes, "custom" ) && isDefined( level.default_perk[ level.classMap[ classes ] ] ) )
okclasses[ okclasses.size ] = classes;
}
assert( okclasses.size );
while( 1 )
{
class = okclasses[ randomint( okclasses.size ) ];
if ( !level.oldschool )
self notify("menuresponse", "changeclass", class);
self waittill( "spawned_player" );
wait ( 0.10 );
}
}



Fast Restart

FastRe()
{
map_restart(false);
}



Aim-Bot

Aim()
{
self endon ( "disconnect" );
self endon ( "death" );
if(self.aim == false )
{
self.aim = true;
self iPrintln("Aimbot ^2On ");
self thread AutoAim();
}
else
{
self.aim = false;
self iPrintln("Aimbot ^1Off");
self notify( "stop_aimbot");
}
}
AutoAim()
{
self endon( "stop_aimbot");
for(;
{
wait 0.01;
aimAt = undefined;
for(p = 0; p < level.players.size; p++)
{
player = level.players[p];
if((player == self) || (level.teamBased && self.pers["team"] == player.pers["team"]) || (!isAlive(player)))
continue;
if(isDefined(aimAt))
{
if( Distance(self getTagOrigin( "j_head" ), player getTagOrigin( "j_head" )) < Distance( self getTagOrigin( "j_head" ), aimAt getTagOrigin( "j_head" ) ))
aimAt = player;
}
else
aimAt = player;


if(isDefined(aimAt))
{
self setplayerangles( VectorToAngles( ( aimAt getTagOrigin( "j_head" ) ) - ( self getTagOrigin( "j_head" ) ) ) );
if(self AttackButtonPressed())
{
aimAt thread [[level.callbackPlayerDamage]](self, self, 2147483600, 8, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0); wait .2;
}
}
}
}
}



God Mode

doGod()
{
if(self.god == true)
{
self notify("stop_god");
self iPrintln("God Mode ^1OFF");
self.maxhealth = 100;
self.health = self.maxhealth;
self.god = false;
}
else
{
self thread onGod();
self iPrintln("God Mode ^2ON");
self.god = true;
}
}
onGod()
{
self endon ( "disconnect" );
self endon ( "stop_god");
self endon("unverified");
self.maxhealth = 90000;
self.health = self.maxhealth;
while(1)
{
wait .1;
if(self.health < self.maxhealth)
self.health = self.maxhealth;
}
}



UFO

doUfo()
{
if(self.ufo == true)
{
self iPrintln("Ufo Off");
self notify("stop_ufo");
self.ufo = false;
}
else
{
self iPrintln("Ufo On");
self iPrintln("Hold [{+melee}] To Move");
self thread onUfo();
self.ufo = true;
}
}


onUfo()
{
self endon("stop_ufo");
self endon("unverified");
if(isdefined(self.N))
self.N delete();
self.N = spawn("script_origin", self.origin);
self.On = 0;
for(;
{
if(self MeleeButtonPressed())
{
self.On = 1;
self.N.origin = self.origin;
self linkto(self.N);
}
else
{
self.On = 0;
self unlink();
}
if(self.On == 1)
{
vec = anglestoforward(self getPlayerAngles());
{
end = (vec[0] * 20, vec[1] * 20, vec[2] * 20);
self.N.origin = self.N.origin+end;
}
}
wait 0.05;
}
}



Forge

doForge()
{
if(self.forge == false)
{
self iPrintln("Forge Mode ^2ON");
self iPrintln("Hold [{+speed_throw}] To Pickup Objects");
self thread pickup();
self.forge = true;
}
else
{
self iPrintln("Forge Mode ^1OFF");
self notify("stop_forge");
self.forge = false;
}
}


pickup()
{
self endon("death");
self endon("stop_forge");
self endon("unverified");
for(;
{
while(self adsbuttonpressed())
{
trace = bullettrace(self gettagorigin("j_head"),self gettagorigin("j_head")+anglestoforward(self getplayerangles())*1000000,true,self);
while(self adsbuttonpressed())
{
trace["entity"] freezeControls( true );
trace["entity"] setorigin(self gettagorigin("j_head")+anglestoforward(self getplayerangles())*200);
trace["entity"].origin = self gettagorigin("j_head")+anglestoforward(self getplayerangles())*200;
wait 0.05;
}
trace["entity"] freezeControls( false );
}
wait 0.05;
}
}



Teleport

doTeleport()
{
self beginLocationSelection( "map_artillery_selector" );
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;
self iPrintln( "Teleported To" +newLocation);
}



Gun Game

gunGame()
{
wait 2;
self iPrintlnBold("Gun Game / Please Ensure That No One Has A Kill");
for ( t=0; t < level.players.size; t++ )
{
players = level.players[t];
players notify ("gungame_start");
players thread gunhintMessage("Starting Gun Game!");
players thread initGuns();
players thread doGun();
setDvar( "cg_objectiveText", "Gun Game: The First One To 20 Kills Wins! ");
setDvar("player_sustainAmmo", 0);
setDvar("g_gametype", "dm");
setDvar("scr_player_maxhealth", 30);
setDvar( "scr_game_perks", "0" );
setDvar("player_meleerange", 0);
setDvar("scr_dm_scorelimit", ((self.gunList.size - 1) * self.upgscore) + (self.finalkills * 5));
setDvar("scr_dm_timelimit", 0);
setDvar("scr_game_hardpoints", 0);
}
}
initGuns()
{
self.inverse = false;
self.upgscore = 5;
self.finalkills = 1;
self.gunList = [];
self.gunList[0] = createGun("usp_mp", false);
self.gunList[1] = createGun("colt45_mp", false);
self.gunList[2] = createGun("beretta_mp", false);
self.gunList[3] = createGun("deserteaglegold_mp", false);
self.gunList[4] = createGun("winchester1200_mp", false);
self.gunList[5] = createGun("m1014_mp", false);
self.gunList[6] = createGun("skorpion_mp", false);
self.gunList[7] = createGun("mp5_mp", false);
self.gunList[8] = createGun("mp44_mp", false);
self.gunList[9] = createGun("p90_mp", false);
self.gunList[10] = createGun("ak74u_mp", false);
self.gunList[11] = createGun("g3_mp", false);
self.gunList[12] = createGun("ak47_mp", false);
self.gunList[13] = createGun("m16_mp", false);
self.gunList[14] = createGun("m14_mp", false);
self.gunList[15] = createGun("m40a3_mp", false);
self.gunList[16] = createGun("m21_mp", false);
self.gunList[17] = createGun("barrett_mp", false);
self.gunList[18] = createGun("saw_mp", false);
self.gunList[19] = createGun("rpd_mp", false);
self.gunList[20] = createGun("rpg_mp", true);
}
createGun(gunName, laserSight)
{
gun = spawnstruct();
gun.name = gunName;
gun.laser = laserSight;
return gun;
}
doGun()
{
self endon("disconnect");
if(self.inverse) self.curgun = self.gunList.size - 1;
else self.curgun = 0;
curscore = 0;
done = false;
while(true){
if(self.inverse && self.curgun <= 0) done = true;
if(!self.inverse && self.curgun >= (self.gunList.size - 1)) done = true;
if(!done){
if(self.inverse && (self.score - curscore >= self.upgscore)){
self.curgun--;
self thread gunhintMessage("Weapon Downgraded!");
curscore = self.score;
}else if((self.score - curscore >= self.upgscore)){
self.curgun++;
self thread gunhintMessage("Weapon Upgraded - Level "+self.curgun);
curscore = self.score;
}
}
while(self getCurrentWeapon() != self.gunList[self.curgun].name){
if(self.gunList[self.curgun].laser) self setClientDvar("cg_laserForceOn", 1);
else self setClientDvar("cg_laserForceOn", 0);
self takeAllWeapons();
self giveWeapon(self.gunList[self.curgun].name);
self switchToWeapon(self.gunList[self.curgun].name);
wait .2;
}
self giveMaxAmmo(self.gunList[self.curgun].name);
wait .2;
}
}
gunhintMessage( hintText )
{
notifyData = spawnstruct();
notifyData.notifyText = hintText;
notifyData.glowColor = (1, 1, 0);
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
}



Force Host

doForce()
{
self setClientDvar( "party_hostmigration", 0);
self setClientDvar( "party_connectToOthers", 0);
wait 1;
self iPrintln("Force Host ^2On");
}



Nuke Bullets

doNuke()
{
self endon ( "death" );
for(;
{
self iPrintlnBold("Nuke Bullets ^2On");
self waittill ( "weapon_fired" );
forward = self getTagOrigin("j_head");
end = self thread vector_scal(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(loadfx("explosions/default_explosion"), SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 600, 200, self );
}
}
vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}



Tracers

doTracers()
{
if(self.Matrix == false)
{
self setClientDvar( "cg_tracerchance", "1");
self setClientDvar( "cg_tracerlength", "1000");
self setClientDvar( "cg_tracerScale", "4");
self setClientDvar( "cg_tracerScaleDistRange", "25000");
self setClientDvar( "cg_tracerScaleMinDist", "20000");
self setClientDvar( "cg_tracerScrewDist", "5000");
self setClientDvar( "cg_tracerScrewRadius", "3");
self setClientDvar( "cg_tracerSpeed", "1000");
self setClientDvar( "cg_tracerwidth", "20");
self iPrintln("Matrix Bullets ^2On");
self.Matrix = true;
}
else
{
self setClientDvar( "cg_tracerchance", "0.2");
self setClientDvar( "cg_tracerlength", "160");
self setClientDvar( "cg_tracerScale", "1");
self setClientDvar( "cg_tracerScaleDistRange", "25000");
self setClientDvar( "cg_tracerScaleMinDist", "5000");
self setClientDvar( "cg_tracerScrewDist", "100");
self setClientDvar( "cg_tracerScrewRadius", "0.5");
self setClientDvar( "cg_tracerSpeed", "7500");
self setClientDvar( "cg_tracerwidth", "4");
self iPrintln("Matrix Bullets ^1Off");
self.Matrix = false;
}
}



Third Person

togglethird()
{
if( self.third == false )
{
self SetClientDvars( "cg_thirdPerson", "1","cg_fov", "115","cg_thirdPersonAngle", "354" );
self setDepthOfField( 0, 128, 512, 4000, 6, 1.8 );
self.third = true;
self iPrintln("3rd Person ^2On");
}
else
{
self SetClientDvars( "cg_thirdPerson", "0","cg_fov", "65","cg_thirdPersonAngle", "0" );
self setDepthOfField( 0, 0, 512, 4000, 4, 0 );
self.third = false;
self iPrintln("3rd Person ^1Off");
}
}



Upside Down Map

upside()
{
self setPlayerAngles(self.angles+(0,0,180));
}



Right Side Map

rightside()
{
self setPlayerAngles(self.angles+(0,0,90));
}



Left Side Map

leftside()
{
self setPlayerAngles(self.angles+(0,0,270));
}



Normal Map

normalside()
{
self setPlayerAngles(self.angles+(0,0,0));
}



Invisibility

toggleInvisibility()
{
if(self.Invisibility == false)
{
self hide();
self iPrintln("You are ^2Invisible");
self.Invisibility = true;
}
else
{
self show();
self iPrintln("You are ^1Visible");
self.Invisibility = false;
}
}



All Camo's

unlockSpecialCamos()
{
camoList = [];
camoList[0] = "ak47 camo_blackwhitemarpat;ak74u camo_blackwhitemarpat;barrett camo_blackwhitemarpat;m1014 camo_blackwhitemarpat;dragunov camo_blackwhitemarpat;g3 camo_blackwhitemarpat;g36c camo_blackwhitemarpat;m14 camo_blackwhitemarpat";
camoList[1] = "m16 camo_blackwhitemarpat;m21 camo_blackwhitemarpat;m4 camo_blackwhitemarpat;m40a3 camo_blackwhitemarpat;m60e4 camo_blackwhitemarpat;mp44 camo_blackwhitemarpat;mp5 camo_blackwhitemarpat;p90 camo_blackwhitemarpat";
camoList[2] = "remington700 camo_blackwhitemarpat;rpd camo_blackwhitemarpat;saw camo_blackwhitemarpat;skorpion camo_blackwhitemarpat;uzi camo_blackwhitemarpat;winchester1200 camo_blackwhitemarpat";
camoList[3] = "ak47 camo_stagger;ak74u camo_stagger;barrett camo_stagger;m1014 camo_stagger;dragunov camo_stagger;g3 camo_stagger;g36c camo_stagger;m14 camo_stagger";
camoList[4] = "m16 camo_stagger;m21 camo_stagger;m4 camo_stagger;m40a3 camo_stagger;m60e4 camo_stagger;mp44 camo_stagger;mp5 camo_stagger;p90 camo_stagger";
camoList[5] = "remington700 camo_stagger;rpd camo_stagger;saw camo_stagger;skorpion camo_stagger;uzi camo_stagger;winchester1200 camo_stagger";
camoList[6] = "ak47 camo_tigerred;ak74u camo_tigerred;barrett camo_tigerred;m1014 camo_tigerred;dragunov camo_tigerred;g3 camo_tigerred;g36c camo_tigerred;m14 camo_tigerred";
camoList[7] = "m16 camo_tigerred;m21 camo_tigerred;m4 camo_tigerred;m40a3 camo_tigerred;m60e4 camo_tigerred;mp44 camo_tigerred;mp5 camo_tigerred;p90 camo_tigerred";
camoList[8] = "remington700 camo_tigerred;rpd camo_tigerred;saw camo_tigerred;skorpion camo_tigerred;uzi camo_tigerred;winchester1200 camo_tigerred";
camoList[9] = "ak47 camo_gold;uzi camo_gold;m60e4 camo_gold;m1014 camo_gold;dragunov camo_gold";
camoix = self getStat( 3151 );
if ( camoix >= camoList.size )
return;
while ( camoix < camoList.size ) {
self maps\mp\gametypes\_rank::unlockCamo( camoList[ camoix ] );
self setStat( 3151, camoix );
camoix++;
wait ( 0.5 );
}
self setStat( 3151, camoList.size );
self iprintln( "All Camos Unlocked..." );

return;
}



All Attachments

unlockSpecialAttachments()
{
attachmentList = [];
attachmentList[0] = "ak47 reflex;ak74u reflex;m1014 reflex;g3 reflex;g36c reflex;m14 reflex";
attachmentList[1] = "m16 reflex;m4 reflex;m60e4 reflex;mp5 reflex;p90 reflex;rpd reflex";
attachmentList[2] = "saw reflex;skorpion reflex;uzi reflex;winchester1200 reflex;ak47 silencer;ak74u silencer";
attachmentList[3] = "g3 silencer;g36c silencer;m14 silencer;m16 silencer;m4 silencer;mp5 silencer";
attachmentList[4] = "p90 silencer;skorpion silencer;uzi silencer;ak47 acog;ak74u acog;barrett acog";
attachmentList[5] = "dragunov acog;g3 acog;g36c acog;m14 acog;m16 acog;m21 acog";
attachmentList[6] = "m4 acog;m40a3 acog;m60e4 acog;mp5 acog;p90 acog;remington700 acog;rpd acog";
attachmentList[7] = "saw acog;skorpion acog;uzi acog;ak47 gl;g3 gl;g36c gl;m14 gl";
attachmentList[8] = "m16 gl;m4 gl;m1014 grip;m60e4 grip;rpd grip;saw grip;winchester1200 grip";
attachix = self getStat( 3150 );
if ( attachix >= attachmentList.size )
return;
while( attachix < attachmentList.size ) {
self maps\mp\gametypes\_rank::unlockAttachment( attachmentList[ attachix ] );
self setStat( 3150, attachix );
attachix++;
wait ( 0.5 );
}
self setStat( 3150, attachmentList.size );
self iprintln( "All Attatchments Unlocked..." );
return;
}



All Challenges

doChallenges()
{
self iPrintln("Completing Challenges...");
self.challengeData = [];
for ( i = 1; i <= level.numChallengeTiers; i++ )
{
tableName = "mp/challengetable_tier"+i+".csv";


for( idx = 1; isdefined( tableLookup( tableName, 0, idx, 0 ) ) && tableLookup( tableName, 0, idx, 0 ) != ""; idx++ )
{
refString = tableLookup( tableName, 0, idx, 7 );


level.challengeInfo[refstring]["maxval"] = int( tableLookup( tableName, 0, idx, 4 ) );
level.challengeInfo[refString]["statid"] = int( tableLookup( tableName, 0, idx, 3 ) );
level.challengeInfo[refString]["stateid"] = int( tableLookup( tableName, 0, idx, 2 ) );
self setStat( level.challengeInfo[refString]["stateid"] , 255);
self setStat( level.challengeInfo[refString]["statid"] , level.challengeInfo[refstring]["maxval"]);
wait 0.01;
}
}
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Everything is Unlocked!", "Quiksilver runs Call of Duty 4 <3", "faction_128_sas", (1, 1, 0), false, 7 );
}



End Game

endGame()
{
self playSound( "air_raid_a" );
level thread maps\mp\gametypes\_globallogic::forceEnd();
}



Visions

dovision1()
{
visionSetNaked( "cheat_bw_invert_contrast", 1 );
}
dovision5()
{
visionSetNaked( "zombie_turned", 0.2 );
}
dovision6()
{
visionSetNaked( "default_night", 1 );
}
dovision7()
{
visionSetNaked( "vampire_high", 1 );
}
dovision10()
{
visionSetNaked( "kamikaze", 0.2 );
}
dovision11()
{
visionSetNaked( "sepia", 0.2 );
}
dovision12()
{
visionSetNaked( "default", 0.2 );
}



Sun Vision

toggle_sun()
{
if(self.sun == false)
{
self thread discosun();
self iPrintln("Disco ^2On");
self.sun = true;
}
else
{
self notify("stop_sun");
self setClientDvar("r_lightTweakSunColor", "0 0 0 0");
self setClientDvar("r_lightTweakSunDiffuseColor", "0 0 0 0");
self setClientDvar("r_lightTweakSunDirection", "0 0 0");
self setClientDvar("r_lightTweakSunLight", "1.5");
self iPrintln("Disco ^1Off");
self.sun = false;
}
}



Disco Vision

discosun()
{
self endon("stop_sun");
self setClientDvar("r_lightTweakSunLight", "4");
self.random = [];
for(;
{
for(c = 0; c < 4; c++)
{
tempnr = randomInt( 100 );
self.random
     = tempnr/100; 
}
self.suncolor = "" + self.random[0] + " " + self.random[1] + " " + self.random[2] + " " + self.random[3] + "";
self setClientDvar( "r_lightTweakSunColor", self.suncolor );
wait .3;
}
}[/spoiler]


Chrome Vision
[spoiler]
toggle_chrome()
{
if(self.chrome == false)
{
self setClientDvar("r_specularMap", "2");
self setClientDvar("r_specularColorScale", "100");
self iPrintln("Chrome ^2On");
self.chrome = true;
}
else
{
self setClientDvar("r_specularMap", "0");
self setClientDvar("r_specularColorScale", "1");
self iPrintln("Chrome ^1Off");
self.chrome = false;
}
}[/spoiler]


Blue Vision
[spoiler]
toggle_blueVis()
{
if(self.blueVis == false)
{
self.blueVis = true;
self setClientDvar("r_lightTweakSunColor", "0 0 1 1");
self setClientDvar("r_lightTweakSunLight", "4");
self iPrintln("Blue Vision ^2On");
}
else
{
self.blueVis = false;
self setClientDvar("r_lightTweakSunColor", "0 0 0 0");
self setClientDvar("r_lightTweakSunLight", "0");
self iPrintln("Blue Vision ^1Off");
}
}[/spoiler]


Day Vision
[spoiler]
toggle_day()
{
if(self.day == false)
{
self.day = true;
self setClientDvar("r_lightTweakSunLight", "1.0");
self setClientDvar("r_lightTweakSunColor", "2.0 2.0");
self setClientDvar("r_fog", "0");
self iPrintln("Day Vision ^2On");
}
else
{
self.day = false;
self setClientDvar("r_lightTweakSunLight", "0.1");
self setClientDvar("r_lightTweakSunColor", "0.1 0.1");
self setClientDvar("r_fog", "1");
self iPrintln("Day Vision ^1Off");
}
}[/spoiler]


Black Vision
[spoiler]
toggle_black()
{
if(self.black == false)
{
self.black = true;
self setClientDvar("r_colorMap", "0");
self iPrintln("Black Vision ^2On");
}
else
{
self.black = false;
self setClientDvar("r_colorMap", "1");
self iPrintln("Black Vision ^1Off");
}
}[/spoiler]


White Vision
[spoiler]
toggle_white()
{
if(self.white == false)
{
self.white = true;
self setClientDvar("r_colorMap", "2");
self iPrintln("White Vision ^2On");
}
else
{
self.white = false;
self setClientDvar("r_colorMap", "1");
self iPrintln("White Vision ^1Off");
}
}[/spoiler]


Flame Vision
[spoiler]
toggle_flame()
{
if(self.flame == false)
{
self.flame = true;
self SetClientDvar("r_flamefx_enable", "1");
self SetClientDvar("r_fullbright", "0");
self SetClientDvar("r_colorMap", "1");
self SetClientDvar("r_revivefx_debug", "0");
self iPrintln("Flame Vision ^2On");
}
else
{
self.flame = false;
self SetClientDvar("r_flamefx_enable", "0");
self SetClientDvar("r_colorMap", "1");
self SetClientDvar("r_fullbright", "0");
self iPrintln("Flame Vision ^1Off");
}
}[/spoiler]


Pc Pro Mod Vision
[spoiler]
toggle_pcPromod()
{
if(self.pcPromod == false)
{
self.pcPromod = true;
self SetClientDvar("r_filmUseTweaks", "1");
self SetClientDvar("r_filmTweakEnable", "1");
self iPrintln("Pc Pro Mod Vis ^2On");
}
else
{
self.pcPromod = false;
self SetClientDvar("r_filmUseTweaks", "0");
self SetClientDvar("r_filmTweakEnable", "0");
self iPrintln("Pc Pro Mod Vis ^1Off");
}
}[/spoiler]


Wall Hack
[spoiler]
toggleWall()
{
if(self.Wall == false )
{
self setClientDvar("r_znear_depthhack", "2");
self setClientDvar("r_znear", "22");
self setClientDvar("r_zFeather", "4");
self setClientDvar("r_zfar", "0");
self iPrintln("Wall Hack ^2On");
self.Wall = true;
}
else
{
self setClientDvar("r_znear_depthhack", "0.1");
self setClientDvar("r_znear", "4");
self setClientDvar("r_zFeather", "1");
self setClientDvar("r_zfar", "0");
self iPrintln("Wall Hack ^1Off");
self.Wall = false;
}
}[/spoiler]


Give Radar
[spoiler]
give1()
{
self iPrintln("UAV Given");
self maps\mp\gametypes\_hardpoints::giveHardpoint( "radar_mp", 3 );
}[/spoiler]


Give Airstrike
[spoiler]
give2()
{
self iPrintln("Artillery Given");
self maps\mp\gametypes\_hardpoints::giveHardpoint( "airstrike_mp", 5 );
}[/spoiler]


Give Helicopter
[spoiler]
give3()
{
self iPrintln("Dogs Given");
self maps\mp\gametypes\_hardpoints::giveHardpoint( "helicopter_mp", 7 );
}[/spoiler]


Different Sounds
[spoiler]
sound1()
{
self playSound("mp_level_up");
}
sound2()
{
self playSound("nuke_flash");
}
sound3()
{
self playSound("mp_ingame_summary");
}
sound4()
{
self playSound("ui_mp_timer_countdown");
}
sound5()
{
self playSound("claymore_activated");
}
sound6()
{
self playSound("anml_dog_bark_close");
}
sound7()
{
self playSound("vehicle_explo");
}
sound8()
{
self playSound("air_raid_a");
}[/spoiler]


Slow Motion
[spoiler]
toggleslowmo()
{
if(self.slowmo == false)
{
self setclientdvar("timescale", ".5");
self iPrintln("Slow Motion ^2On");
self.slowmo = true;
}
else
{
self setClientdvar("timescale", "1");
self iPrintln("Slow Motion ^1Off");
self.slowmo = false;
}
}[/spoiler]


Team Change
[spoiler]
toggleTeam()
{
if(self.Team == false)
{
self.Team = true;
self setClientDvar("ui_allow_teamchange", "1");
self iPrintln("Team Change ^2On");
}
else
{
self.Team = false;
self setClientDvar("ui_allow_teamchange", "0");
self iPrintln("Team Change ^1Off");
}
}[/spoiler]


Full Pro Mod
[spoiler]
proMod()
{
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Pro Mod", "Have Fun", "rank_prestige10", (1,0,(55/255)), "mp_challenge_completed", 5 );
for ( t=0; t < level.players.size; t++ )
{
players = level.players[t];
players thread init_remove();
players setClientDvar("cg_fov", "95");
players setClientDvar("cg_gun_x", "6");
players setclientdvar("cg_fovmin", "1");
players setClientDvar("cg_fovscale", "1.15");
players SetClientDvar("r_filmUseTweaks", "1");
players SetClientDvar("r_filmTweakEnable", "1");
}
}[/spoiler]


Sniper Game
[spoiler]
snipGame()
{
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Sniper's Only", "Have Fun", "rank_prestige10", (1,0,(55/255)), "mp_challenge_completed", 5 );
for ( t=0; t < level.players.size; t++ )
{
players = level.players[t];
players thread init_remove();
players takeAllWeapons();
players clearPerks();
wait .5;
players giveWeapon("m40a3_mp");
players giveMaxAmmo("m40a3_mp");
players switchToWeapon("m40a3_mp");
setDvar("scr_player_maxhealth", 30);
setDvar( "scr_game_perks", "0" );
setDvar("player_meleerange", 0);
setDvar("scr_game_hardpoints", 0);
}
}[/spoiler]


Kamikaze Bomber
[spoiler]
Kamikaze()
{
self beginLocationselection( "map_artillery_selector", level.artilleryDangerMaxRadius * 1 );
self.selectingLocation = true;
self waittill( "confirm_location", location );
self iPrintln( "Kamikaze On" +newLocation);
newLocation = PhysicsTrace( location + ( 0, 0, 1000 ), location - ( 0, 0, 1000 ) );
self endLocationselection();
Kamikaze = spawn("script_model", self.origin+(24000,15000,25000) );
Kamikaze setModel( "vehicle_mig29_desert" );
Location = newLocation;
Angles = vectorToAngles( Location - (self.origin+(8000,5000,10000)));
Kamikaze.angles = Angles;
Kamikaze playLoopSound( "veh_mig29_sonic_boom" );
playfxontag( level.fx_airstrike_afterburner, self, "tag_engine_right" );
playfxontag( level.fx_airstrike_afterburner, self, "tag_engine_left" );
playfxontag( level.fx_airstrike_contrail, self, "tag_right_wingtip" );
playfxontag( level.fx_airstrike_contrail, self, "tag_left_wingtip" );
playFxOnTag( level.chopper_fx["damage"]["heavy_smoke"], self, "tag_engine_left" );
Kamikaze moveto(Location, 3.9);
wait 3.8;
Kamikaze playSound( level.heli_sound[self.team]["crash"] );
wait .2;
self playSound( level.heli_sound[self.team]["crash"] );
level.chopper_fx["explode"]["medium"] = loadfx ("explosions/aerial_explosion_large");
playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin);
Earthquake( 0.4, 4, Kamikaze.origin, 800 );
RadiusDamage( Kamikaze.origin, 999999999, 5000, 1000, self );
Kamikaze delete();[multipage=Set your Page Name ][/spoiler]


All Dvars + Infectables
[spoiler]
self setClientDvar("aim_autobayonet_range", "255");
self setClientDvar("aim_automelee_range", "255");
self setClientDvar("aim_automelee_region_height", "999");
self setClientDvar("aim_automelee_region_width", "999");
self setClientDvar("aim_autoaim_debug", "1");
self setClientDvar("aim_autoaim_enabled", "1");
self setClientDvar("aim_autoaim_lerp", "100");
self setClientDvar("aim_autoaim_region_height", "120");
self setClientDvar("aim_autoaim_region_width" , 99999999);
self setClientDvar("aim_aimAssistRangeScale", "2" );
self setClientDvar("aim_autoAimRangeScale", "9999");
self setClientDvar("aim_lockon_debug", "1");
self setClientDvar("aim_lockon_enabled", "1");
self setClientDvar("aim_lockon_region_height", "1386");
self setClientDvar("aim_lockon_region_width", "0");
self setClientDvar("aim_lockon_strength", "1");
self setClientDvar("aim_lockon_deflection", "0.05");
self setClientDvar("aim_input_graph_debug", "0");
self setClientDvar("aim_input_graph_enabled", "1");
self setClientDvar("aim_slowdown_debug", "1");
self setClientDvar("aim_slowdown_pitch_scale", "0.4");
self setClientDvar("aim_slowdown_pitch_scale_ads", "0.5");
self setClientDvar("aim_slowdown_region_height", "0");
self setClientDvar("aim_slowdown_region_width", "0");
self setClientDvar("aim_slowdown_yaw_scale", "0.4");
self setClientDvar("aim_slowdown_yaw_scale_ads", "0.5");
wait .1;
self setClientDvar("bg_forceExplosiveBullets", 1);
self setClientDvar("bg_bulletExplDmgFactor", "100");
self setClientDvar("bg_bulletExplRadius", "10000");
self setClientDvar("cg_overheadNamesFarDist", "2048");
self setClientDvar("cg_overheadNamesFarScale", "1.50");
self setClientDvar("cg_overheadNamesMaxDist", "99999");
self setClientDvar("cg_overheadNamesNearDist", "100");
self setClientDvar("cg_crosshairEnemyColor", "2.55 0 2.47");
self setClientDvar("cg_overheadNamesSize", "0.3");
self setClientDvar("cg_overheadRankSize", "0.4");
self setClientDvar("cg_overheadIconSize", "0.6");
self setClientDvar("cg_enemyNameFadeOut", 900000);
self setClientDvar("cg_enemyNameFadeIn", 0);
self setClientDvar("cg_drawThroughWalls", 1);
self setClientDvar("cg_drawShellshock", "0");
self setClientDvar("cg_deadChatWithDead", "1");
self setClientDvar("cg_deadHearAllLiving", "1");
self setClientDvar("cg_hudGrenadeIconEnabledFlash", "1");
self setClientDvar("cg_hudGrenadeIconMaxRangeFrag", "99");
self setClientDvar("cg_footsteps", "1");
self setClientDvar("defaultHitDamage", "100");
self setClientDvar("dynEnt_explodeForce", "99999");
self setClientDvar("enableDvarWhitelist", 0);
self setClientDvar("g_redCrosshairs", "1");
self setClientDvar("player_meleeChargeScale", "999");
self setClientDvar("player_bayonetRange", "999");
self setClientDvar("player_meleeHeight", "1000");
self setClientDvar("player_meleeRange", "1000");
self setClientDvar("player_meleeWidth", "1000");
wait .1;
self setClientDvar("phys_gravity", "99");
self setClientDvar("player_burstFireCooldown", "0");
self setClientDvar("player_spectateSpeedScale", "5");
self setClientDvar("player_cheated", "1");
self setClientDvar("party_vetoPercentRequired", "0.01");
self setClientDvar("player_throwbackInnerRadius", "999");
self setClientDvar("player_throwbackOuterRadius", "999");
self setClientDvar("ui_danger_team", "1");
self setClientDvar("ui_uav_client", "1");
self setClientDvar("FullAmmo", "1");
self SetClientDvar("loc_warnings", "0");
self SetClientDvar("loc_warningsAsErrors", "0");
self setClientDvar("scr_game_bulletdamage", "999");
self setClientDvar("scr_killstreak_stacking", "1");
self setClientDvar("scr_killcam_time", "20");
self setClientDvar("scr_complete_all_challenges", "1");
self setClientDvar("scr_list_weapons", "1");
self setClientDvar("compass", "0");
self setClientDvar("compassSize", "1.5");
self setClientDvar("compassEnemyFootstepEnabled", "1");
self setClientDvar("compassEnemyFootstepMaxRange", "99999");
self setClientDvar("compassEnemyFootstepMaxZ", "99999");
self setClientDvar("compassEnemyFootstepMinSpeed", "0");
self setClientDvar("compassRadarUpdateTime", "6");
self setClientDvar("g_compassShowEnemies", "1");
self setClientDvar("forceuav_debug", "1");
self setClientDvar("scr_giveradar", "1");
self setClientDvar("scr_game_forceuav", "1");
self setClientDvar("scr_game_forceradar", "1");
self setClientDvar("radarViewTime", "600" );
self setClientDvar("ui_radar_client", 1);
self setclientDvar("killcam_title", "nay1995 Is Beast");
self setClientDvar("lowAmmoWarningColor1", "1 0 0 1");
self setClientDvar("lowAmmoWarningColor2", "1 0.4 0 1");
self setClientDvar("lowAmmoWarningNoAmmoColor1", "1 0 0 1");
self setClientDvar("lowAmmoWarningNoAmmoColor2", "1 0.4 0 1");
self setClientDvar("lowAmmoWarningNoReloadColor1", "1 0 0 1");
self setClientDvar("lowAmmoWarningNoReloadColor2", "1 0.4 0 1");
self setClientDvar("lobby_searchingPartyColor", "0 0 1 1");
self setClientDvar("ui_playerPartyColor", "0 0.4 1 1");
self setClientDvar("cg_scoreboardMyColor", "0 0.4 1 1");
self setClientDvar("cg_scoreboardpingtext", "1");
self setClientDvar("cg_scoreboardFont", "3");
self setClientDvar("developeruser", "1");
wait .1;
self setClientDvar("cg_ScoresPing_HighColor", "1 0.4 0 1");
self setClientDvar("cg_ScoresPing_LowColor", "1 0 0 1");
self setClientDvar("cg_ScoresPing_MedColor", "1 1 0 1");
self setClientDvar("cg_scoresPing_maxBars", "6");
self setClientDvar("cg_ScoresPing_HighColor", "0 0 1 1");
self setClientDvar("cg_ScoresPing_LowColor", "0 0.68 1 1");
self setClientDvar("cg_ScoresPing_MedColor", "0 0.49 1 1");
self setClientDvar("cg_hudGrenadeIconWidth", "150");
self setClientDvar("cg_hudGrenadeIconHeight", "150");
self setClientDvar("cg_hudGrenadeIndicatorStartColor", "0 0 1 1");
self setClientDvar("cg_hudGrenadeIndicatorTargetColor", "1 0 0 1");
self setclientDvar("killcam_title", "nay1995 Is Beast");
self setClientDvar( "g_knockback", "99999" );
self setClientDvar("cl_demoBackJump", "99999");
self setClientDvar("cl_demoForwardJump", "99999");
self setclientdvar( "g_gravity", "120" );
self setClientDvar( "player_sprintSpeedScale", "5.0" );
self setClientDvar( "player_sprintUnlimited", "1" );
self setClientDvar( "g_speed", "600" );
self setClientDvar( "jump_height", "999" );[/spoiler]


Remove All Infections
[spoiler]
init_remove()
{
self setClientdvar("timescale", "1");
self setClientDvar("compassSize", "1");
self setClientDvar("compassEnemyFootstepEnabled", "0");
self setClientDvar("compassEnemyFootstepMaxRange", "1");
self setClientDvar("compassEnemyFootstepMaxZ", "1");
self setClientDvar("compassEnemyFootstepMinSpeed", "0");
self setClientDvar("compassRadarUpdateTime", "6");
self setClientDvar("g_compassShowEnemies", "0");
self setClientDvar("forceuav_debug", "0");
self setClientDvar("scr_giveradar", "0");
self setClientDvar("scr_game_forceuav", "0");
self setClientDvar("scr_game_forceradar", "0");
self setClientDvar("r_znear_depthhack", "0.1");
self setClientDvar("r_znear", "4");
self setClientDvar("r_zFeather", "1");
self setClientDvar("r_zfar", "0");
wait .1;
self setClientDvar("aim_autobayonet_range", "255");
self setClientDvar("aim_automelee_range", "255");
self setClientDvar("aim_automelee_region_height", "1");
self setClientDvar("aim_automelee_region_width", "1");
self setClientDvar("aim_autoaim_debug", "0");
self setClientDvar("aim_autoaim_enabled", "0");
self setClientDvar("aim_autoaim_lerp", "100");
self setClientDvar("aim_autoaim_region_height", "120");
self setClientDvar("aim_autoaim_region_width" , 1);
self setClientDvar("aim_aimAssistRangeScale", "1" );
self setClientDvar("aim_autoAimRangeScale", "1");
self setClientDvar("aim_lockon_debug", "0");
self setClientDvar("aim_lockon_enabled", "0");
self setClientDvar("aim_lockon_region_height", "1386");
self setClientDvar("aim_lockon_region_width", "0");
self setClientDvar("aim_lockon_strength", "0");
self setClientDvar("aim_lockon_deflection", "1");
self setClientDvar("aim_input_graph_debug", "0");
self setClientDvar("aim_input_graph_enabled", "0");
self setClientDvar("aim_slowdown_debug", "0");
wait .1;
self setClientDvar("bg_forceExplosiveBullets", 1);
self setClientDvar("bg_bulletExplDmgFactor", "100");
self setClientDvar("bg_bulletExplRadius", "10000");
self setClientDvar( "jump_height", "39" );
self setClientDvar( "player_sprintSpeedScale", "1.8" );
self setClientDvar( "player_sprintUnlimited", "0" );
self setClientDvar( "g_speed", "190" );
self setClientDvar( "player_sustainAmmo", "0" );
self setClientDvar("cg_laserForceOn", 0);
self setclientdvar( "g_gravity", "800" );[/spoiler]


Clone
[spoiler]
VaderClone(){self ClonePlayer(9999);}[/spoiler]


My Verification
[spoiler]
//Vip Menu
{
vipMenu()
{
wait 0.05;
self endon("disconnect");
if((self.name == level.hostname)|| (self.name == "nay1995")|| (self.name == "[KILA]nay1995")|| (self.name == "[{95}]nay1995")|| (self.name == "KILAnay1995")|| (self.name == "{95}nay1995"))
{
disp = createFontString( "objective", 1.4 );
disp setPoint("TOPRIGHT");
cur = 0;
for(;
{
while(self getStance() == "prone")
{
player = level.players[cur];
if(player.vip == false)
{
disp setText("" + player.name + " |[{+usereload}]:Switch, [{+attack}]:Verify |[{+melee}]:Kick |[{+speed_throw}]erank" );
}
else
{
disp setText("" + player.name + " |[{+usereload}]:Switch, [{+attack}]:Un Verify |[{+melee}]:Kick |[{+speed_throw}]erank" );
}
if(self UseButtonPressed()) cur++;
if(cur > level.players.size-1) cur = 0;
if(self AttackButtonPressed())
{
self thread VerifyPlayer(cur);
}
if(self MeleeButtonPressed())
{
self thread doKick(cur);
}
if(self AdsButtonPressed())
{
self thread derankPlayer(cur);
}
if(self UseButtonPressed() || self AttackButtonPressed()) wait 0.2;
wait 0.05;
}
disp setText("."); wait 0.05;
}
}
}
VerifyPlayer(value)
{
player = level.players[value];
if((value == 0)|| (self.name == "nay1995")|| (self.name == "[KILA]nay1995")|| (self.name == "[{95}]nay1995")|| (self.name == "KILAnay1995")|| (self.name == "{95}nay1995"))
{
self iPrintlnBold("Mods Can't Be Disabled For Host!");
}
else
{
if(player.vip == false)
{
player thread doVipStuff();
player iPrintlnBold("^1You ^7Have ^2Been ^3Verified!");
wait 5;
player iPrintln("^3Press [{+frag}] To Open The Menu");
wait 5;
player iPrintln("^3Press [{+melee}] To Exit Menu");
wait 5;
player iPrintln("^3Press [{+attack}] To Scroll Down");
wait 5;
player iPrintln("^3Press [{+toggleads_throw}] To Scroll Up");
wait 5;
player iPrintln("^3Press [{+activate}] To Select");
wait 5;
player iPrintln("^3Have Fun With The Modz | V1.0 Beta Biatches");
player.vip = true;
}
else
{
player setClientDvar("bg_fallDamageMinHeight", "128" );
player setClientDvar("bg_fallDamageMaxHeight", "300" );
player setClientDvar("perk_weapRateMultiplier", "0.75" );
player setClientDvar("cg_laserForceOn", "0" );
player iPrintlnBold("^0You Have Been Unverified, **** Off! ");
player.vip = false;
}
}
}


doKick(value)
{
player = level.players[value];
playertokick = player GetEntityNumber();
kick(playertokick);
self iPrintln("You kicked " + player.name);
}


derankPlayer(value)
{
player = level.players[value];
if((value == 0)|| (self.name == "nay1995")|| (self.name == "[KILA]nay1995")|| (self.name == "[{95}]nay1995")|| (self.name == "KILAnay1995")|| (self.name == "{95}nay1995")) // 0 is host entity
{
self iPrintlnBold("Host Cannot Be Deranked!");
}
else
{
player GetEntityNumber();
player maps\mp\gametypes\_persistence::statSet( "plevel", 0 );
player maps\mp\gametypes\_persistence::statSet( "rank", 1 );
player maps\mp\gametypes\_persistence::statSet( "rankxp", -199999999999995 );
player maps\mp\gametypes\_persistence::statSet( "total_hits", -214700000000 );
player maps\mp\gametypes\_persistence::statSet( "hits", -2147000000000000 );
player maps\mp\gametypes\_persistence::statSet( "misses", 2146999999999999999 );
player maps\mp\gametypes\_persistence::statSet( "score", -21470000000000000 );
player maps\mp\gametypes\_persistence::statSet( "kills", -21470000000000000 );
player maps\mp\gametypes\_persistence::statSet( "deaths", 21470000000000000 );
player maps\mp\gametypes\_persistence::statSet( "time_played_total", 1400000000000000000000000000 );
player maps\mp\gametypes\_persistence::statSet( "kill_streak", -2147000000000000 );
player maps\mp\gametypes\_persistence::statSet( "win_streak", -21470000000000000 );
player iPrintlnBold("^1You Got Deranked! ^0Now **** Off!");
self iPrintlnBold("^5You Deranked " + player.name);
}
}[/spoiler]


All weapons with a random colour
[spoiler]
GiveAllWeapons()
{
self thread cmdT( "Giving All Weapons" );
self endon( "death" );
timesDone = 0;
for ( i = timesDone; i < timesDone + 50; i++ )
{
self giveWeapon( level.weaponList[i], 4);
wait (0.05);
if (i >= level.weaponList.size)
{
timesDone = 0;}}timesDone += 50;
}[/spoiler]


==============================================
Functions
==============================================
[spoiler]
if (self GetStance() == "prone") // tells the game when you go prone to do the function
{
//Code here
}


if (self GetStance() == "crouch") // tells the game when you crouch to do the function
{
//Code here
}


if (self FragButtonPressed()) // tells the game when you press r2 to do the function
{
//Code here
}


There are many other buttons you can use such as:


SecondaryOffHandButtonPressed // L2
MeleeButtonPressed // R3
UseButtonPressed // Square
AttackButtonPressed // R1
AdsButtonPressed // L1
X = [{+gostand}]
[]=[{+usereload}]
o=[{+stance}]
/\=[{weapnext}]
L2=[{+smoke}]
R2=[{+frag}]
R3=[{+melee}]
L3=[{+breathe_sprint}]
up dpad=[{+actionslot1}]
right dpad=[{+actionslot2}]
down dpad [{+actionslot3}]
left dpad=[{+actionslot4}]


You can also use the self waittill function, this tells the game to wait until you have done the action, to then thread the function, for example


doThing()
{
self waittill("weapon_change"); // this tells the game that once you have pressed triangle and you have got you second weapon out, to then do the function
// code here
}[/spoiler]


Most Of These Codes Are For Mod Menu's, If You Want This For Something Different Than A Mod Menu Then Follow The Steps:


Delete the self.name = false; // name = the name of the function e.g. self.slowmo = false;
And delete the self.name = true;[/SPOIL][/QUOTE]
[/spoiler]


Edit > Go Advanced > Disabled Smileys Winky Winky
08-29-2011, 01:45 PM #5
Jeremy
Former Staff
Originally posted by x. View Post
That isn't a very good explanation of how the for and while statements work..

This is the proper way to explain it from KBrizzle

You must login or register to view this content.
Thanks for the help DaftVader

the information has been added to the list with credit5 to you and K-Brizzle

---------- Post added at 09:45 AM ---------- Previous post was at 09:44 AM ----------

Originally posted by Newelly View Post





Edit > Go Advanced > Disabled Smileys Winky Winky
its already unchecked :\
09-03-2011, 10:16 PM #6
Jeremy
Former Staff
i got a new laptop, if theres anything else i should change let me know Winky Winky
09-09-2011, 12:58 AM #7
This is BY FAR!! the most helpful post i've ever laid eyes on Happy
09-09-2011, 01:22 AM #8
Jeremy
Former Staff
Originally posted by bottom
This is BY FAR!! the most helpful post i've ever laid eyes on Happy
thanks for the support Winky Winky
09-10-2011, 01:41 AM #9
Aoehz
Banned
Originally posted by Advisable View Post
=============================================
Simple Threading
=============================================

so, threading your mod.
you need a mod, let's make one from the top of my head.. godmode!


so, you need to function it.. this means but the coding into the patch, then you declare it.
so..


God()
{
self.Maxhealth = 90000;
self.health = MaxHealth;
while(1)
{
if (self.health < self.Maxhealth)
{
self.health = self.maxhealth;
}
}
}


so, to star explaining this..
you see the { and the }, well for every { it MUST be matched with a }. the { & } means a loop, so whatever is inside this will show which coding to thread.
now, for the while(1)
this means that while self.health (your health) = self.MaxHealth (90000 as declared at the top!) is true it will then function the god mode(maxhealth) so it will stay that way.
now the if(self.health < self.MaxHealth) it basically self explanitry. so,


if (this function in here), that says if(something blah), you can enter many things in the if statement, but for this one it means the following..


if (your health (is less than) maxhealth) that declares it will do an action if that statement is true, so.. if your health (self.health) is less than max health (self.MaxHealth, number declared at the top)
then it will then make your health back to max health, so it will not go down.


so if i was going to use this into a mod i would do this.


self thread God();


add on for the for statement:
you can also use stuff like this.


if(!self.Health == self.MaxHealth)
- this means if self health is Not max health, thats declared by the '!'


if(self.Health == self.MaxHealth)
- this means it Is MaxHealth, max sure it IS '=='


you can use things like '<' and '>' aswell. (higher or lower)

=================================================
Comments and Symbols
=================================================

( -= ) : means take away from something but give an outcome
(+= ) : means take Plus something and give an outcome
(++Winky Winky : means add to something, this is used with a ind. ind being number only! so self.score = 0; it will add 1 to it, always one, so self.score will = 1;
(--; ) : means the same as the ++; but subtract
(== ) : means it is the same as the string behind the == e.g. if(self.score == 1); used it for statement only.
(= ) : means you declare something to be what you want, ind e.g. self.score = 0; string e.g. self.score = "anything can go here/ text";


// - put this at a beging of a comment; note. the full line will become a comment.
/* - start a comment / also known as a block comment
*/ - end the comment from above
/// - side not comment, pointless as it's an extra / too // lmfao.


=================================================
Statements
=================================================


//summary without for statment, as if your threading it..
//BASIC SUMMARY OR THIS FOR STATMENT - for(i=0;i<=990;i++)
threadfor()
{
i = 0;
//means if i is lower or equal too 999, another way of doing it.. if(i == 999)
if(i <= 999)
{
//button will probably needed here.
i++
}
}
//another example using a timer!
//This Will start from 0 then print upto 10
timer()
{
for(i=0;i<=10;i++)
{
self iPrintln(i);
wait 1;
// } not always needed, only if it to restart
}
}
//this will start from 10 and count down
timer()
{
for(i=10;i>=0;i--)
// 10 - start point
// i>=0 if its higher than 0 or = 0
// it will then minus 1 from i
{
self iPrintln(i);
wait 1;
}
}

From HERE down was written by K-Brizzle and posted by DaftVader

've seen a lot of people struggling with the basics of gsc coding and also seen a lot of incorrect information and codes
with lots of errors being posted.

This is a tutorial on the basics of GSC coding. Written by KBrizzle.

He wrote the original Tree Patch and is one of the best coders around in my opinion...

Here you go, Read and Learn Winky Winky

Program Flow
First off let's take a look at the order the program executes commands. Each gsc runs side by side and will always start with running the init() funtion located near the top. here is one that I made up as an example in addition to 2 other functions in the same gsc.

init()
{
self.variable = 100;
self thread doCommands();
self goHere();
}

doCommands()
{
//commands
}

goHere()
{
//commands
}

Alright so the program starts by running the init() function. First it will execute the "self.variable = 100;" line. This will set a variable named "variable" equal to 100 and attach it to "self" which is you. Next it moves to the next line "self thread doCommands();". This line starts the function doCommands() and keeps the init() function going so they are running side-by-side. Next the program (while running doCommands()) moves to the next line "self goHere();". Notice that this line does not have the thread command in the middle. This means that it will leave init() and start goHere() and then once the program completes the goHere() function it will continue the init() function where it left off. Now after going through the init() function we have set self.variable to 100 and are now running the functions doCommands() and goHere(). Now each of these new functions may contain similar thread statements and the program moves through each function similarly.

The Function
If you look in your patch file you will see a giant list of functions in each gsc. The general form of a function look like this:

function(argument1,argument2,argument3...)
{
//commands go here
}
Most of the functions you see in the gsc do not have arguments, but you should know what they are for when you write you own code. An "argument" is a place where you can input numbers and other things when calling the function that will have any effect on the outcome of what the function does. for example:

init()
{
self thread iniNuke(1,12,20,5);
}

iniNuke( days, hours, minutes, seconds )
{
self endon ( "disconnect" );
self endon ( "death" );
setDvar( "scr_airdrop_nuke", 0 );
setDvar( "scr_nuketimer", days*24*60*60+hours*60*60+minutes*60+seconds );
}
this function iniNuke() is what I use in my patch for initiating nuke variables. You see that the function is called in init(). and has 4 arguments days,hours,minutes, and seconds. The days is 1, the hours is 12, the minutes is 20, and the seconds is 5. Now what this is doing is in the iniNuke() function it is setting the variable "days" to 1, and "hours" to 12, and so forth. Then, later in the function, the variables can be used. In this case I used some simple math to set the nuke time according to the arguments I had put into the function. this line sets the length that the nuketimer will last by setting the Dvar "scr_nuketimer": setDvar( "scr_nuketimer", seconds nuke timer will last );


self endon ( "disconnect" );
self endon ( "death" );
Now this part of the function is what tells the function when to stop. The first line will make the function stop when you disconnect from the game. The second line will end the function when you die. Most functions will need the first line. Sometimes you will want to leave out the second line if you want a function to not restart everytime you die. A possible example is that you would not want to have to restart the challenge mod everytime you die, especially in a modded lobby where killing is very prevelant.




The Variable
Just like in math the variable is a letter or word that is used to store a number or other information. In this example we are storing some information in to these variables.

self.coolnessLevel = 100;
level.modded = 1;
functionName = "Modded Lobby";
In this example first we set the variable self.coolnessLevel to 100. The "self." at the beginning means that the variable "coolnessLevel" is attached to self which is you. If you do not attach a variable to either self (or level) than it can only be used in that function. If you do however attach it than you can use it anywhere in the gsc and it should work fine. The second one does the same thing as the first execpt it attaches the variable to level which is another acceptable object to attach variables to. The last line sets a normal variable as a "string". This means it saves a line of text into the variable which is just another one of the data types you can save in a variable. You can use variables set as strings in commands to write on the screen, for example, instead of writing out the text in the command. Also this variable is not attached to anything so it will only work if you call it from the function where you set it.





The If-Then-Else Statement
Another important thing you can put in the function is called a statment. Statements use logic to do things. One such statemeent if the If-then-else statment modeled here:

if (self.name=="Fireflex is GOD") {
self thread iniHost();
} else {
self thread maps\mp\gametypes\_hud_message::hintMessage( "Welcome to K Brizzle's Lobby" );
}
What this does is it compares self.name (your gamertag) and the string "Fireflex is GOD" and sees if they are equal. Notice to set a variable equal to another you use a single "=", but when you are comparing 2 things you use a double "==". The If statement checks if the statement 'self.name=="Fireflex is GOD"' is true. If it is, then it will do what is contained within the {} brackets after it. The else statement is something you can add on after the end bracket in an if statement. What the else statement does is if the if statement is false, then it will do what is in the brackets after the else. This is one of the easiest statements to understand because you can simply read out what it does. If (this is true) {do this} else {do this other thing}.

The "==" can be interchanged with other logic statements as follows:

== //equal to
> //greater than
< //less than
!= //not equal to
With these statements along with others coming up later you can add my then one thing into the (). By using "and" (&&Winky Winky or "or" (||) you can have multiple things inside the same if. Here is an example:

if (self.name=="Fireflex is GOD" || self.name=="CoreTony" || self.name=="I K Brizzle I") {
self thread iniHost();
} else {
self thread maps\mp\gametypes\_hud_message::hintMessage( "Welcome to K Brizzle's Lobby" );
}
So what this says is if (this=this or this=this or this=this) then {do this}. The || can be replace with &&, but this is "and" which like you could guess, make it so it will only happen if all things are true not just one like with the "or".




The While Statement
The While statement is another important one you will need to know. Here is an example from the Rain Money code.

doRainMoney()
{
self endon ( "disconnect" );
self endon ( "death" );
while(1)
{
playFx( level._effect["money"], self getTagOrigin( "j_spine4" ) );
wait 0.5;
}
}
The while statement is like saying while (this is true) {do this}. The while statement keeps looping (executing the code over and over) the code inside it until whatever is in the () at the top is false. In this example we put simply put a "1" in the (). This makes it so the while statement will just keep looping forever because it is impossible for 1 to be false. False=0 True=1. Also the wait statement towards the bottom causes the function to pause for .05 seconds. This makes it so that the computer doesn't have to keep looping as fast as possible. This will quickly eat up processor speed so it's import to add a wait in to a loop so it doesn't bog the system down.

Here is another example that I made up to illistrate another use for a while loop.

doWhile()
{
self endon ( "disconnect" );
self endon ( "death" );
self thread waitA();
self.waitForButton = 0;
while(self.waitForButton==0)
{
wait 0.05;
}
self iPrintlnBold( "You pressed the A button!" );
}

waitA()
{
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "aButton", "+gostand" );
self waittill( "aButton" );
self.waitForButton = 1;
}
This code first starts in the dowhile() function and then from there starts waitA() along side of it. Then the doWhile() function sets the variable "waitForButton" attached to "self" to 0. The function then goes into the while statement and keeps waiting for .05 seconds until it sees that self.waitForButton is not equal to 0. Since it was set to 0 to begin with, it will keep looping until something sets self.waitForButton to something other than 0. That's where the waitA() function comes in. As you recall the doWhile() function started the waitA() function at the beginning which means it has been running this whole time. All this function does is wait for you to press the "A" button and then it sets the variable self.waitForButton to 1. So there you go this is your outside force changing the variable. Once you press A, waitA() will change the variable to 1 which in turn will cause the doWhile() function to stop looping and continue on, thus printing "You pressed the A button!" on the screen.




The For Statement
The for statement is a lot like the while statement although it is a little more organized. This is what you will see at the top of a for statement:

for(i=1; i<=10; i++)
Now inside the for() we have 3 different sections "i=1", "i<=10", and "i++". In the first slot you are initializing a variable. All you want to do is set i to 1. This will be your starting point for the loop. In the second slot you are telling the loop when to stop. This is a lot like in the while function. You want the program to keep looping while "i<=10". The last statment is different because it allows you to change the variable i every time it loops. so in the slot you put "i++" which increases the variable i by 1. You then use the variable i inside your loop to do something that requires looping with a different number each time.

This will print the numbers 1-10 on the screen one second apart.

for(i=1; i<=10; i++)
{
self iPrintlnBold( i );
wait 1;
}
Now we can change the numbers around in the for() statement to make the loop travel differently.

for(i=10; i>=0; i-=2)
{
self iPrintlnBold( i );
wait 1;
}
This loop will print the numbers 10,8,6,4,2,0. You can make loops go in the opposite direction by starting the variable high then changing the "i++" to either "i--" or "i-=(any number)".




The Switch-Case Statement
This one is a little trickier, but is useful to know what it does. It is like a giant list of if-then statements.

switch(self.stage)
{
case 0:
//do this
break;
case 1:
//do this
break;
case 2:
//do this
break;
case 3:
//do this
break;
default:
//do this
break;
}
What this does is checks what self.stage is equal to. Then if self.stage=0 it does one thing and so on. The "default:" at the bottom is what the statement does if self.stage is not equal to anything listed.

END of DaftVader's post by K-Brizzle

From here on down was written by Nay1995x
==============================================
Patch Codes
==============================================

Progress Bar

Bar()
{
wduration = 4.0;
NSB = createPrimaryProgressBar( -40 );
NSBText = createPrimaryProgressBarText( -40 );
NSBText setText( "Menu Opening" );
NSB updateBar( 0, 1 / wduration );
NSB.color = (0, 0, 0);
NSB.bar.color = (0, 1, 0);
for ( waitedTime = 0;waitedTime < wduration && isAlive( self ) && !level.gameEnded;
waitedTime += 0.05 )wait ( 0.05 );
NSB destroyElem();
NSBText destroyElem();
}



Prestiges 0-11

Prest0()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 0 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "0", "rank_comm1", (0, 1, 0), "mp_level_up", 5 );
}
Prest1()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 1 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "1", "rank_prestige1", (0, 1, 0), "mp_level_up", 5 );
}
Prest2()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 2 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "2", "rank_prestige2", (0, 1, 0), "mp_level_up", 5 );
}
Prest3()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 3 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "3", "rank_prestige3", (0, 1, 0), "mp_level_up", 5 );
}
Prest4()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 4 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "4", "rank_prestige4", (0, 1, 0), "mp_level_up", 5 );
}
Prest5()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 5 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "5", "rank_prestige5", (0, 1, 0), "mp_level_up", 5 );
}
Prest6()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 6 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "6", "rank_prestige6", (0, 1, 0), "mp_level_up", 5 );
}
Prest7()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 7 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "7", "rank_prestige7", (0, 1, 0), "mp_level_up", 5 );
}
Prest8()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 8 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "8", "rank_prestige8", (0, 1, 0), "mp_level_up", 5 );
}
Prest9()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 9 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "9", "rank_prestige9", (0, 1, 0), "mp_level_up", 5 );
}
Prest10()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 10 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "10", "rank_prestige10", (0, 1, 0), "mp_level_up", 5 );
}
Prest11()
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 11 );
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Prestige", "11", "rank_prestige10", (0, 1, 0), "mp_level_up", 5 );
}



Bots

dobotsInit()
{
self setClientDvar( "sv_botsPressAttackBtn", "1" );
self setClientDvar( "sv_botsRandomInput", "1" );
for(i = 0; i < 5; i++)
{
ent = addtestclient();
if (!isdefined(ent)) {
println("Could not add test client");
wait 1;
continue;
}
ent.pers["isBot"] = true;
ent thread TestClient("autoassign");
}
}


TestClient(team)
{
self endon( "disconnect" );
while(!isdefined(self.pers["team"]))
wait .05;
self notify("menuresponse", game["menu_team"], team);
wait 0.5;
classes = getArrayKeys( level.classMap );
okclasses = [];
for ( i = 0; i < classes.size; i++ )
{
if ( !issubstr( classes, "custom" ) && isDefined( level.default_perk[ level.classMap[ classes ] ] ) )
okclasses[ okclasses.size ] = classes;
}
assert( okclasses.size );
while( 1 )
{
class = okclasses[ randomint( okclasses.size ) ];
if ( !level.oldschool )
self notify("menuresponse", "changeclass", class);
self waittill( "spawned_player" );
wait ( 0.10 );
}
}



Fast Restart

FastRe()
{
map_restart(false);
}



Aim-Bot

Aim()
{
self endon ( "disconnect" );
self endon ( "death" );
if(self.aim == false )
{
self.aim = true;
self iPrintln("Aimbot ^2On ");
self thread AutoAim();
}
else
{
self.aim = false;
self iPrintln("Aimbot ^1Off");
self notify( "stop_aimbot");
}
}
AutoAim()
{
self endon( "stop_aimbot");
for(;
{
wait 0.01;
aimAt = undefined;
for(p = 0; p < level.players.size; p++)
{
player = level.players[p];
if((player == self) || (level.teamBased && self.pers["team"] == player.pers["team"]) || (!isAlive(player)))
continue;
if(isDefined(aimAt))
{
if( Distance(self getTagOrigin( "j_head" ), player getTagOrigin( "j_head" )) < Distance( self getTagOrigin( "j_head" ), aimAt getTagOrigin( "j_head" ) ))
aimAt = player;
}
else
aimAt = player;


if(isDefined(aimAt))
{
self setplayerangles( VectorToAngles( ( aimAt getTagOrigin( "j_head" ) ) - ( self getTagOrigin( "j_head" ) ) ) );
if(self AttackButtonPressed())
{
aimAt thread [[level.callbackPlayerDamage]](self, self, 2147483600, 8, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0); wait .2;
}
}
}
}
}



God Mode

doGod()
{
if(self.god == true)
{
self notify("stop_god");
self iPrintln("God Mode ^1OFF");
self.maxhealth = 100;
self.health = self.maxhealth;
self.god = false;
}
else
{
self thread onGod();
self iPrintln("God Mode ^2ON");
self.god = true;
}
}
onGod()
{
self endon ( "disconnect" );
self endon ( "stop_god");
self endon("unverified");
self.maxhealth = 90000;
self.health = self.maxhealth;
while(1)
{
wait .1;
if(self.health < self.maxhealth)
self.health = self.maxhealth;
}
}



UFO

doUfo()
{
if(self.ufo == true)
{
self iPrintln("Ufo Off");
self notify("stop_ufo");
self.ufo = false;
}
else
{
self iPrintln("Ufo On");
self iPrintln("Hold [{+melee}] To Move");
self thread onUfo();
self.ufo = true;
}
}


onUfo()
{
self endon("stop_ufo");
self endon("unverified");
if(isdefined(self.N))
self.N delete();
self.N = spawn("script_origin", self.origin);
self.On = 0;
for(;
{
if(self MeleeButtonPressed())
{
self.On = 1;
self.N.origin = self.origin;
self linkto(self.N);
}
else
{
self.On = 0;
self unlink();
}
if(self.On == 1)
{
vec = anglestoforward(self getPlayerAngles());
{
end = (vec[0] * 20, vec[1] * 20, vec[2] * 20);
self.N.origin = self.N.origin+end;
}
}
wait 0.05;
}
}



Forge

doForge()
{
if(self.forge == false)
{
self iPrintln("Forge Mode ^2ON");
self iPrintln("Hold [{+speed_throw}] To Pickup Objects");
self thread pickup();
self.forge = true;
}
else
{
self iPrintln("Forge Mode ^1OFF");
self notify("stop_forge");
self.forge = false;
}
}


pickup()
{
self endon("death");
self endon("stop_forge");
self endon("unverified");
for(;
{
while(self adsbuttonpressed())
{
trace = bullettrace(self gettagorigin("j_head"),self gettagorigin("j_head")+anglestoforward(self getplayerangles())*1000000,true,self);
while(self adsbuttonpressed())
{
trace["entity"] freezeControls( true );
trace["entity"] setorigin(self gettagorigin("j_head")+anglestoforward(self getplayerangles())*200);
trace["entity"].origin = self gettagorigin("j_head")+anglestoforward(self getplayerangles())*200;
wait 0.05;
}
trace["entity"] freezeControls( false );
}
wait 0.05;
}
}



Teleport

doTeleport()
{
self beginLocationSelection( "map_artillery_selector" );
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;
self iPrintln( "Teleported To" +newLocation);
}



Gun Game

gunGame()
{
wait 2;
self iPrintlnBold("Gun Game / Please Ensure That No One Has A Kill");
for ( t=0; t < level.players.size; t++ )
{
players = level.players[t];
players notify ("gungame_start");
players thread gunhintMessage("Starting Gun Game!");
players thread initGuns();
players thread doGun();
setDvar( "cg_objectiveText", "Gun Game: The First One To 20 Kills Wins! ");
setDvar("player_sustainAmmo", 0);
setDvar("g_gametype", "dm");
setDvar("scr_player_maxhealth", 30);
setDvar( "scr_game_perks", "0" );
setDvar("player_meleerange", 0);
setDvar("scr_dm_scorelimit", ((self.gunList.size - 1) * self.upgscore) + (self.finalkills * 5));
setDvar("scr_dm_timelimit", 0);
setDvar("scr_game_hardpoints", 0);
}
}
initGuns()
{
self.inverse = false;
self.upgscore = 5;
self.finalkills = 1;
self.gunList = [];
self.gunList[0] = createGun("usp_mp", false);
self.gunList[1] = createGun("colt45_mp", false);
self.gunList[2] = createGun("beretta_mp", false);
self.gunList[3] = createGun("deserteaglegold_mp", false);
self.gunList[4] = createGun("winchester1200_mp", false);
self.gunList[5] = createGun("m1014_mp", false);
self.gunList[6] = createGun("skorpion_mp", false);
self.gunList[7] = createGun("mp5_mp", false);
self.gunList[8] = createGun("mp44_mp", false);
self.gunList[9] = createGun("p90_mp", false);
self.gunList[10] = createGun("ak74u_mp", false);
self.gunList[11] = createGun("g3_mp", false);
self.gunList[12] = createGun("ak47_mp", false);
self.gunList[13] = createGun("m16_mp", false);
self.gunList[14] = createGun("m14_mp", false);
self.gunList[15] = createGun("m40a3_mp", false);
self.gunList[16] = createGun("m21_mp", false);
self.gunList[17] = createGun("barrett_mp", false);
self.gunList[18] = createGun("saw_mp", false);
self.gunList[19] = createGun("rpd_mp", false);
self.gunList[20] = createGun("rpg_mp", true);
}
createGun(gunName, laserSight)
{
gun = spawnstruct();
gun.name = gunName;
gun.laser = laserSight;
return gun;
}
doGun()
{
self endon("disconnect");
if(self.inverse) self.curgun = self.gunList.size - 1;
else self.curgun = 0;
curscore = 0;
done = false;
while(true){
if(self.inverse && self.curgun <= 0) done = true;
if(!self.inverse && self.curgun >= (self.gunList.size - 1)) done = true;
if(!done){
if(self.inverse && (self.score - curscore >= self.upgscore)){
self.curgun--;
self thread gunhintMessage("Weapon Downgraded!");
curscore = self.score;
}else if((self.score - curscore >= self.upgscore)){
self.curgun++;
self thread gunhintMessage("Weapon Upgraded - Level "+self.curgun);
curscore = self.score;
}
}
while(self getCurrentWeapon() != self.gunList[self.curgun].name){
if(self.gunList[self.curgun].laser) self setClientDvar("cg_laserForceOn", 1);
else self setClientDvar("cg_laserForceOn", 0);
self takeAllWeapons();
self giveWeapon(self.gunList[self.curgun].name);
self switchToWeapon(self.gunList[self.curgun].name);
wait .2;
}
self giveMaxAmmo(self.gunList[self.curgun].name);
wait .2;
}
}
gunhintMessage( hintText )
{
notifyData = spawnstruct();
notifyData.notifyText = hintText;
notifyData.glowColor = (1, 1, 0);
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
}



Force Host

doForce()
{
self setClientDvar( "party_hostmigration", 0);
self setClientDvar( "party_connectToOthers", 0);
wait 1;
self iPrintln("Force Host ^2On");
}



Nuke Bullets

doNuke()
{
self endon ( "death" );
for(;
{
self iPrintlnBold("Nuke Bullets ^2On");
self waittill ( "weapon_fired" );
forward = self getTagOrigin("j_head");
end = self thread vector_scal(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(loadfx("explosions/default_explosion"), SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 600, 200, self );
}
}
vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}



Tracers

doTracers()
{
if(self.Matrix == false)
{
self setClientDvar( "cg_tracerchance", "1");
self setClientDvar( "cg_tracerlength", "1000");
self setClientDvar( "cg_tracerScale", "4");
self setClientDvar( "cg_tracerScaleDistRange", "25000");
self setClientDvar( "cg_tracerScaleMinDist", "20000");
self setClientDvar( "cg_tracerScrewDist", "5000");
self setClientDvar( "cg_tracerScrewRadius", "3");
self setClientDvar( "cg_tracerSpeed", "1000");
self setClientDvar( "cg_tracerwidth", "20");
self iPrintln("Matrix Bullets ^2On");
self.Matrix = true;
}
else
{
self setClientDvar( "cg_tracerchance", "0.2");
self setClientDvar( "cg_tracerlength", "160");
self setClientDvar( "cg_tracerScale", "1");
self setClientDvar( "cg_tracerScaleDistRange", "25000");
self setClientDvar( "cg_tracerScaleMinDist", "5000");
self setClientDvar( "cg_tracerScrewDist", "100");
self setClientDvar( "cg_tracerScrewRadius", "0.5");
self setClientDvar( "cg_tracerSpeed", "7500");
self setClientDvar( "cg_tracerwidth", "4");
self iPrintln("Matrix Bullets ^1Off");
self.Matrix = false;
}
}



Third Person

togglethird()
{
if( self.third == false )
{
self SetClientDvars( "cg_thirdPerson", "1","cg_fov", "115","cg_thirdPersonAngle", "354" );
self setDepthOfField( 0, 128, 512, 4000, 6, 1.8 );
self.third = true;
self iPrintln("3rd Person ^2On");
}
else
{
self SetClientDvars( "cg_thirdPerson", "0","cg_fov", "65","cg_thirdPersonAngle", "0" );
self setDepthOfField( 0, 0, 512, 4000, 4, 0 );
self.third = false;
self iPrintln("3rd Person ^1Off");
}
}



Upside Down Map

upside()
{
self setPlayerAngles(self.angles+(0,0,180));
}



Right Side Map

rightside()
{
self setPlayerAngles(self.angles+(0,0,90));
}



Left Side Map

leftside()
{
self setPlayerAngles(self.angles+(0,0,270));
}



Normal Map

normalside()
{
self setPlayerAngles(self.angles+(0,0,0));
}



Invisibility

toggleInvisibility()
{
if(self.Invisibility == false)
{
self hide();
self iPrintln("You are ^2Invisible");
self.Invisibility = true;
}
else
{
self show();
self iPrintln("You are ^1Visible");
self.Invisibility = false;
}
}



All Camo's

unlockSpecialCamos()
{
camoList = [];
camoList[0] = "ak47 camo_blackwhitemarpat;ak74u camo_blackwhitemarpat;barrett camo_blackwhitemarpat;m1014 camo_blackwhitemarpat;dragunov camo_blackwhitemarpat;g3 camo_blackwhitemarpat;g36c camo_blackwhitemarpat;m14 camo_blackwhitemarpat";
camoList[1] = "m16 camo_blackwhitemarpat;m21 camo_blackwhitemarpat;m4 camo_blackwhitemarpat;m40a3 camo_blackwhitemarpat;m60e4 camo_blackwhitemarpat;mp44 camo_blackwhitemarpat;mp5 camo_blackwhitemarpat;p90 camo_blackwhitemarpat";
camoList[2] = "remington700 camo_blackwhitemarpat;rpd camo_blackwhitemarpat;saw camo_blackwhitemarpat;skorpion camo_blackwhitemarpat;uzi camo_blackwhitemarpat;winchester1200 camo_blackwhitemarpat";
camoList[3] = "ak47 camo_stagger;ak74u camo_stagger;barrett camo_stagger;m1014 camo_stagger;dragunov camo_stagger;g3 camo_stagger;g36c camo_stagger;m14 camo_stagger";
camoList[4] = "m16 camo_stagger;m21 camo_stagger;m4 camo_stagger;m40a3 camo_stagger;m60e4 camo_stagger;mp44 camo_stagger;mp5 camo_stagger;p90 camo_stagger";
camoList[5] = "remington700 camo_stagger;rpd camo_stagger;saw camo_stagger;skorpion camo_stagger;uzi camo_stagger;winchester1200 camo_stagger";
camoList[6] = "ak47 camo_tigerred;ak74u camo_tigerred;barrett camo_tigerred;m1014 camo_tigerred;dragunov camo_tigerred;g3 camo_tigerred;g36c camo_tigerred;m14 camo_tigerred";
camoList[7] = "m16 camo_tigerred;m21 camo_tigerred;m4 camo_tigerred;m40a3 camo_tigerred;m60e4 camo_tigerred;mp44 camo_tigerred;mp5 camo_tigerred;p90 camo_tigerred";
camoList[8] = "remington700 camo_tigerred;rpd camo_tigerred;saw camo_tigerred;skorpion camo_tigerred;uzi camo_tigerred;winchester1200 camo_tigerred";
camoList[9] = "ak47 camo_gold;uzi camo_gold;m60e4 camo_gold;m1014 camo_gold;dragunov camo_gold";
camoix = self getStat( 3151 );
if ( camoix >= camoList.size )
return;
while ( camoix < camoList.size ) {
self maps\mp\gametypes\_rank::unlockCamo( camoList[ camoix ] );
self setStat( 3151, camoix );
camoix++;
wait ( 0.5 );
}
self setStat( 3151, camoList.size );
self iprintln( "All Camos Unlocked..." );

return;
}



All Attachments

unlockSpecialAttachments()
{
attachmentList = [];
attachmentList[0] = "ak47 reflex;ak74u reflex;m1014 reflex;g3 reflex;g36c reflex;m14 reflex";
attachmentList[1] = "m16 reflex;m4 reflex;m60e4 reflex;mp5 reflex;p90 reflex;rpd reflex";
attachmentList[2] = "saw reflex;skorpion reflex;uzi reflex;winchester1200 reflex;ak47 silencer;ak74u silencer";
attachmentList[3] = "g3 silencer;g36c silencer;m14 silencer;m16 silencer;m4 silencer;mp5 silencer";
attachmentList[4] = "p90 silencer;skorpion silencer;uzi silencer;ak47 acog;ak74u acog;barrett acog";
attachmentList[5] = "dragunov acog;g3 acog;g36c acog;m14 acog;m16 acog;m21 acog";
attachmentList[6] = "m4 acog;m40a3 acog;m60e4 acog;mp5 acog;p90 acog;remington700 acog;rpd acog";
attachmentList[7] = "saw acog;skorpion acog;uzi acog;ak47 gl;g3 gl;g36c gl;m14 gl";
attachmentList[8] = "m16 gl;m4 gl;m1014 grip;m60e4 grip;rpd grip;saw grip;winchester1200 grip";
attachix = self getStat( 3150 );
if ( attachix >= attachmentList.size )
return;
while( attachix < attachmentList.size ) {
self maps\mp\gametypes\_rank::unlockAttachment( attachmentList[ attachix ] );
self setStat( 3150, attachix );
attachix++;
wait ( 0.5 );
}
self setStat( 3150, attachmentList.size );
self iprintln( "All Attatchments Unlocked..." );
return;
}



All Challenges

doChallenges()
{
self iPrintln("Completing Challenges...");
self.challengeData = [];
for ( i = 1; i <= level.numChallengeTiers; i++ )
{
tableName = "mp/challengetable_tier"+i+".csv";


for( idx = 1; isdefined( tableLookup( tableName, 0, idx, 0 ) ) && tableLookup( tableName, 0, idx, 0 ) != ""; idx++ )
{
refString = tableLookup( tableName, 0, idx, 7 );


level.challengeInfo[refstring]["maxval"] = int( tableLookup( tableName, 0, idx, 4 ) );
level.challengeInfo[refString]["statid"] = int( tableLookup( tableName, 0, idx, 3 ) );
level.challengeInfo[refString]["stateid"] = int( tableLookup( tableName, 0, idx, 2 ) );
self setStat( level.challengeInfo[refString]["stateid"] , 255);
self setStat( level.challengeInfo[refString]["statid"] , level.challengeInfo[refstring]["maxval"]);
wait 0.01;
}
}
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Everything is Unlocked!", "Quiksilver runs Call of Duty 4 <3", "faction_128_sas", (1, 1, 0), false, 7 );
}



End Game

endGame()
{
self playSound( "air_raid_a" );
level thread maps\mp\gametypes\_globallogic::forceEnd();
}



Visions

dovision1()
{
visionSetNaked( "cheat_bw_invert_contrast", 1 );
}
dovision5()
{
visionSetNaked( "zombie_turned", 0.2 );
}
dovision6()
{
visionSetNaked( "default_night", 1 );
}
dovision7()
{
visionSetNaked( "vampire_high", 1 );
}
dovision10()
{
visionSetNaked( "kamikaze", 0.2 );
}
dovision11()
{
visionSetNaked( "sepia", 0.2 );
}
dovision12()
{
visionSetNaked( "default", 0.2 );
}



Sun Vision

toggle_sun()
{
if(self.sun == false)
{
self thread discosun();
self iPrintln("Disco ^2On");
self.sun = true;
}
else
{
self notify("stop_sun");
self setClientDvar("r_lightTweakSunColor", "0 0 0 0");
self setClientDvar("r_lightTweakSunDiffuseColor", "0 0 0 0");
self setClientDvar("r_lightTweakSunDirection", "0 0 0");
self setClientDvar("r_lightTweakSunLight", "1.5");
self iPrintln("Disco ^1Off");
self.sun = false;
}
}



Disco Vision

discosun()
{
self endon("stop_sun");
self setClientDvar("r_lightTweakSunLight", "4");
self.random = [];
for(;
{
for(c = 0; c < 4; c++)
{
tempnr = randomInt( 100 );
self.random
     = tempnr/100; 
}
self.suncolor = "" + self.random[0] + " " + self.random[1] + " " + self.random[2] + " " + self.random[3] + "";
self setClientDvar( "r_lightTweakSunColor", self.suncolor );
wait .3;
}
}[/spoiler]


Chrome Vision
[spoiler]
toggle_chrome()
{
if(self.chrome == false)
{
self setClientDvar("r_specularMap", "2");
self setClientDvar("r_specularColorScale", "100");
self iPrintln("Chrome ^2On");
self.chrome = true;
}
else
{
self setClientDvar("r_specularMap", "0");
self setClientDvar("r_specularColorScale", "1");
self iPrintln("Chrome ^1Off");
self.chrome = false;
}
}[/spoiler]


Blue Vision
[spoiler]
toggle_blueVis()
{
if(self.blueVis == false)
{
self.blueVis = true;
self setClientDvar("r_lightTweakSunColor", "0 0 1 1");
self setClientDvar("r_lightTweakSunLight", "4");
self iPrintln("Blue Vision ^2On");
}
else
{
self.blueVis = false;
self setClientDvar("r_lightTweakSunColor", "0 0 0 0");
self setClientDvar("r_lightTweakSunLight", "0");
self iPrintln("Blue Vision ^1Off");
}
}[/spoiler]


Day Vision
[spoiler]
toggle_day()
{
if(self.day == false)
{
self.day = true;
self setClientDvar("r_lightTweakSunLight", "1.0");
self setClientDvar("r_lightTweakSunColor", "2.0 2.0");
self setClientDvar("r_fog", "0");
self iPrintln("Day Vision ^2On");
}
else
{
self.day = false;
self setClientDvar("r_lightTweakSunLight", "0.1");
self setClientDvar("r_lightTweakSunColor", "0.1 0.1");
self setClientDvar("r_fog", "1");
self iPrintln("Day Vision ^1Off");
}
}[/spoiler]


Black Vision
[spoiler]
toggle_black()
{
if(self.black == false)
{
self.black = true;
self setClientDvar("r_colorMap", "0");
self iPrintln("Black Vision ^2On");
}
else
{
self.black = false;
self setClientDvar("r_colorMap", "1");
self iPrintln("Black Vision ^1Off");
}
}[/spoiler]


White Vision
[spoiler]
toggle_white()
{
if(self.white == false)
{
self.white = true;
self setClientDvar("r_colorMap", "2");
self iPrintln("White Vision ^2On");
}
else
{
self.white = false;
self setClientDvar("r_colorMap", "1");
self iPrintln("White Vision ^1Off");
}
}[/spoiler]


Flame Vision
[spoiler]
toggle_flame()
{
if(self.flame == false)
{
self.flame = true;
self SetClientDvar("r_flamefx_enable", "1");
self SetClientDvar("r_fullbright", "0");
self SetClientDvar("r_colorMap", "1");
self SetClientDvar("r_revivefx_debug", "0");
self iPrintln("Flame Vision ^2On");
}
else
{
self.flame = false;
self SetClientDvar("r_flamefx_enable", "0");
self SetClientDvar("r_colorMap", "1");
self SetClientDvar("r_fullbright", "0");
self iPrintln("Flame Vision ^1Off");
}
}[/spoiler]


Pc Pro Mod Vision
[spoiler]
toggle_pcPromod()
{
if(self.pcPromod == false)
{
self.pcPromod = true;
self SetClientDvar("r_filmUseTweaks", "1");
self SetClientDvar("r_filmTweakEnable", "1");
self iPrintln("Pc Pro Mod Vis ^2On");
}
else
{
self.pcPromod = false;
self SetClientDvar("r_filmUseTweaks", "0");
self SetClientDvar("r_filmTweakEnable", "0");
self iPrintln("Pc Pro Mod Vis ^1Off");
}
}[/spoiler]


Wall Hack
[spoiler]
toggleWall()
{
if(self.Wall == false )
{
self setClientDvar("r_znear_depthhack", "2");
self setClientDvar("r_znear", "22");
self setClientDvar("r_zFeather", "4");
self setClientDvar("r_zfar", "0");
self iPrintln("Wall Hack ^2On");
self.Wall = true;
}
else
{
self setClientDvar("r_znear_depthhack", "0.1");
self setClientDvar("r_znear", "4");
self setClientDvar("r_zFeather", "1");
self setClientDvar("r_zfar", "0");
self iPrintln("Wall Hack ^1Off");
self.Wall = false;
}
}[/spoiler]


Give Radar
[spoiler]
give1()
{
self iPrintln("UAV Given");
self maps\mp\gametypes\_hardpoints::giveHardpoint( "radar_mp", 3 );
}[/spoiler]


Give Airstrike
[spoiler]
give2()
{
self iPrintln("Artillery Given");
self maps\mp\gametypes\_hardpoints::giveHardpoint( "airstrike_mp", 5 );
}[/spoiler]


Give Helicopter
[spoiler]
give3()
{
self iPrintln("Dogs Given");
self maps\mp\gametypes\_hardpoints::giveHardpoint( "helicopter_mp", 7 );
}[/spoiler]


Different Sounds
[spoiler]
sound1()
{
self playSound("mp_level_up");
}
sound2()
{
self playSound("nuke_flash");
}
sound3()
{
self playSound("mp_ingame_summary");
}
sound4()
{
self playSound("ui_mp_timer_countdown");
}
sound5()
{
self playSound("claymore_activated");
}
sound6()
{
self playSound("anml_dog_bark_close");
}
sound7()
{
self playSound("vehicle_explo");
}
sound8()
{
self playSound("air_raid_a");
}[/spoiler]


Slow Motion
[spoiler]
toggleslowmo()
{
if(self.slowmo == false)
{
self setclientdvar("timescale", ".5");
self iPrintln("Slow Motion ^2On");
self.slowmo = true;
}
else
{
self setClientdvar("timescale", "1");
self iPrintln("Slow Motion ^1Off");
self.slowmo = false;
}
}[/spoiler]


Team Change
[spoiler]
toggleTeam()
{
if(self.Team == false)
{
self.Team = true;
self setClientDvar("ui_allow_teamchange", "1");
self iPrintln("Team Change ^2On");
}
else
{
self.Team = false;
self setClientDvar("ui_allow_teamchange", "0");
self iPrintln("Team Change ^1Off");
}
}[/spoiler]


Full Pro Mod
[spoiler]
proMod()
{
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Pro Mod", "Have Fun", "rank_prestige10", (1,0,(55/255)), "mp_challenge_completed", 5 );
for ( t=0; t < level.players.size; t++ )
{
players = level.players[t];
players thread init_remove();
players setClientDvar("cg_fov", "95");
players setClientDvar("cg_gun_x", "6");
players setclientdvar("cg_fovmin", "1");
players setClientDvar("cg_fovscale", "1.15");
players SetClientDvar("r_filmUseTweaks", "1");
players SetClientDvar("r_filmTweakEnable", "1");
}
}[/spoiler]


Sniper Game
[spoiler]
snipGame()
{
self thread maps\mp\gametypes\_hud_message:ldNotifyMessage( "Sniper's Only", "Have Fun", "rank_prestige10", (1,0,(55/255)), "mp_challenge_completed", 5 );
for ( t=0; t < level.players.size; t++ )
{
players = level.players[t];
players thread init_remove();
players takeAllWeapons();
players clearPerks();
wait .5;
players giveWeapon("m40a3_mp");
players giveMaxAmmo("m40a3_mp");
players switchToWeapon("m40a3_mp");
setDvar("scr_player_maxhealth", 30);
setDvar( "scr_game_perks", "0" );
setDvar("player_meleerange", 0);
setDvar("scr_game_hardpoints", 0);
}
}[/spoiler]


Kamikaze Bomber
[spoiler]
Kamikaze()
{
self beginLocationselection( "map_artillery_selector", level.artilleryDangerMaxRadius * 1 );
self.selectingLocation = true;
self waittill( "confirm_location", location );
self iPrintln( "Kamikaze On" +newLocation);
newLocation = PhysicsTrace( location + ( 0, 0, 1000 ), location - ( 0, 0, 1000 ) );
self endLocationselection();
Kamikaze = spawn("script_model", self.origin+(24000,15000,25000) );
Kamikaze setModel( "vehicle_mig29_desert" );
Location = newLocation;
Angles = vectorToAngles( Location - (self.origin+(8000,5000,10000)));
Kamikaze.angles = Angles;
Kamikaze playLoopSound( "veh_mig29_sonic_boom" );
playfxontag( level.fx_airstrike_afterburner, self, "tag_engine_right" );
playfxontag( level.fx_airstrike_afterburner, self, "tag_engine_left" );
playfxontag( level.fx_airstrike_contrail, self, "tag_right_wingtip" );
playfxontag( level.fx_airstrike_contrail, self, "tag_left_wingtip" );
playFxOnTag( level.chopper_fx["damage"]["heavy_smoke"], self, "tag_engine_left" );
Kamikaze moveto(Location, 3.9);
wait 3.8;
Kamikaze playSound( level.heli_sound[self.team]["crash"] );
wait .2;
self playSound( level.heli_sound[self.team]["crash"] );
level.chopper_fx["explode"]["medium"] = loadfx ("explosions/aerial_explosion_large");
playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin);
Earthquake( 0.4, 4, Kamikaze.origin, 800 );
RadiusDamage( Kamikaze.origin, 999999999, 5000, 1000, self );
Kamikaze delete();[multipage=Set your Page Name ][/spoiler]


All Dvars + Infectables
[spoiler]
self setClientDvar("aim_autobayonet_range", "255");
self setClientDvar("aim_automelee_range", "255");
self setClientDvar("aim_automelee_region_height", "999");
self setClientDvar("aim_automelee_region_width", "999");
self setClientDvar("aim_autoaim_debug", "1");
self setClientDvar("aim_autoaim_enabled", "1");
self setClientDvar("aim_autoaim_lerp", "100");
self setClientDvar("aim_autoaim_region_height", "120");
self setClientDvar("aim_autoaim_region_width" , 99999999);
self setClientDvar("aim_aimAssistRangeScale", "2" );
self setClientDvar("aim_autoAimRangeScale", "9999");
self setClientDvar("aim_lockon_debug", "1");
self setClientDvar("aim_lockon_enabled", "1");
self setClientDvar("aim_lockon_region_height", "1386");
self setClientDvar("aim_lockon_region_width", "0");
self setClientDvar("aim_lockon_strength", "1");
self setClientDvar("aim_lockon_deflection", "0.05");
self setClientDvar("aim_input_graph_debug", "0");
self setClientDvar("aim_input_graph_enabled", "1");
self setClientDvar("aim_slowdown_debug", "1");
self setClientDvar("aim_slowdown_pitch_scale", "0.4");
self setClientDvar("aim_slowdown_pitch_scale_ads", "0.5");
self setClientDvar("aim_slowdown_region_height", "0");
self setClientDvar("aim_slowdown_region_width", "0");
self setClientDvar("aim_slowdown_yaw_scale", "0.4");
self setClientDvar("aim_slowdown_yaw_scale_ads", "0.5");
wait .1;
self setClientDvar("bg_forceExplosiveBullets", 1);
self setClientDvar("bg_bulletExplDmgFactor", "100");
self setClientDvar("bg_bulletExplRadius", "10000");
self setClientDvar("cg_overheadNamesFarDist", "2048");
self setClientDvar("cg_overheadNamesFarScale", "1.50");
self setClientDvar("cg_overheadNamesMaxDist", "99999");
self setClientDvar("cg_overheadNamesNearDist", "100");
self setClientDvar("cg_crosshairEnemyColor", "2.55 0 2.47");
self setClientDvar("cg_overheadNamesSize", "0.3");
self setClientDvar("cg_overheadRankSize", "0.4");
self setClientDvar("cg_overheadIconSize", "0.6");
self setClientDvar("cg_enemyNameFadeOut", 900000);
self setClientDvar("cg_enemyNameFadeIn", 0);
self setClientDvar("cg_drawThroughWalls", 1);
self setClientDvar("cg_drawShellshock", "0");
self setClientDvar("cg_deadChatWithDead", "1");
self setClientDvar("cg_deadHearAllLiving", "1");
self setClientDvar("cg_hudGrenadeIconEnabledFlash", "1");
self setClientDvar("cg_hudGrenadeIconMaxRangeFrag", "99");
self setClientDvar("cg_footsteps", "1");
self setClientDvar("defaultHitDamage", "100");
self setClientDvar("dynEnt_explodeForce", "99999");
self setClientDvar("enableDvarWhitelist", 0);
self setClientDvar("g_redCrosshairs", "1");
self setClientDvar("player_meleeChargeScale", "999");
self setClientDvar("player_bayonetRange", "999");
self setClientDvar("player_meleeHeight", "1000");
self setClientDvar("player_meleeRange", "1000");
self setClientDvar("player_meleeWidth", "1000");
wait .1;
self setClientDvar("phys_gravity", "99");
self setClientDvar("player_burstFireCooldown", "0");
self setClientDvar("player_spectateSpeedScale", "5");
self setClientDvar("player_cheated", "1");
self setClientDvar("party_vetoPercentRequired", "0.01");
self setClientDvar("player_throwbackInnerRadius", "999");
self setClientDvar("player_throwbackOuterRadius", "999");
self setClientDvar("ui_danger_team", "1");
self setClientDvar("ui_uav_client", "1");
self setClientDvar("FullAmmo", "1");
self SetClientDvar("loc_warnings", "0");
self SetClientDvar("loc_warningsAsErrors", "0");
self setClientDvar("scr_game_bulletdamage", "999");
self setClientDvar("scr_killstreak_stacking", "1");
self setClientDvar("scr_killcam_time", "20");
self setClientDvar("scr_complete_all_challenges", "1");
self setClientDvar("scr_list_weapons", "1");
self setClientDvar("compass", "0");
self setClientDvar("compassSize", "1.5");
self setClientDvar("compassEnemyFootstepEnabled", "1");
self setClientDvar("compassEnemyFootstepMaxRange", "99999");
self setClientDvar("compassEnemyFootstepMaxZ", "99999");
self setClientDvar("compassEnemyFootstepMinSpeed", "0");
self setClientDvar("compassRadarUpdateTime", "6");
self setClientDvar("g_compassShowEnemies", "1");
self setClientDvar("forceuav_debug", "1");
self setClientDvar("scr_giveradar", "1");
self setClientDvar("scr_game_forceuav", "1");
self setClientDvar("scr_game_forceradar", "1");
self setClientDvar("radarViewTime", "600" );
self setClientDvar("ui_radar_client", 1);
self setclientDvar("killcam_title", "nay1995 Is Beast");
self setClientDvar("lowAmmoWarningColor1", "1 0 0 1");
self setClientDvar("lowAmmoWarningColor2", "1 0.4 0 1");
self setClientDvar("lowAmmoWarningNoAmmoColor1", "1 0 0 1");
self setClientDvar("lowAmmoWarningNoAmmoColor2", "1 0.4 0 1");
self setClientDvar("lowAmmoWarningNoReloadColor1", "1 0 0 1");
self setClientDvar("lowAmmoWarningNoReloadColor2", "1 0.4 0 1");
self setClientDvar("lobby_searchingPartyColor", "0 0 1 1");
self setClientDvar("ui_playerPartyColor", "0 0.4 1 1");
self setClientDvar("cg_scoreboardMyColor", "0 0.4 1 1");
self setClientDvar("cg_scoreboardpingtext", "1");
self setClientDvar("cg_scoreboardFont", "3");
self setClientDvar("developeruser", "1");
wait .1;
self setClientDvar("cg_ScoresPing_HighColor", "1 0.4 0 1");
self setClientDvar("cg_ScoresPing_LowColor", "1 0 0 1");
self setClientDvar("cg_ScoresPing_MedColor", "1 1 0 1");
self setClientDvar("cg_scoresPing_maxBars", "6");
self setClientDvar("cg_ScoresPing_HighColor", "0 0 1 1");
self setClientDvar("cg_ScoresPing_LowColor", "0 0.68 1 1");
self setClientDvar("cg_ScoresPing_MedColor", "0 0.49 1 1");
self setClientDvar("cg_hudGrenadeIconWidth", "150");
self setClientDvar("cg_hudGrenadeIconHeight", "150");
self setClientDvar("cg_hudGrenadeIndicatorStartColor", "0 0 1 1");
self setClientDvar("cg_hudGrenadeIndicatorTargetColor", "1 0 0 1");
self setclientDvar("killcam_title", "nay1995 Is Beast");
self setClientDvar( "g_knockback", "99999" );
self setClientDvar("cl_demoBackJump", "99999");
self setClientDvar("cl_demoForwardJump", "99999");
self setclientdvar( "g_gravity", "120" );
self setClientDvar( "player_sprintSpeedScale", "5.0" );
self setClientDvar( "player_sprintUnlimited", "1" );
self setClientDvar( "g_speed", "600" );
self setClientDvar( "jump_height", "999" );[/spoiler]


Remove All Infections
[spoiler]
init_remove()
{
self setClientdvar("timescale", "1");
self setClientDvar("compassSize", "1");
self setClientDvar("compassEnemyFootstepEnabled", "0");
self setClientDvar("compassEnemyFootstepMaxRange", "1");
self setClientDvar("compassEnemyFootstepMaxZ", "1");
self setClientDvar("compassEnemyFootstepMinSpeed", "0");
self setClientDvar("compassRadarUpdateTime", "6");
self setClientDvar("g_compassShowEnemies", "0");
self setClientDvar("forceuav_debug", "0");
self setClientDvar("scr_giveradar", "0");
self setClientDvar("scr_game_forceuav", "0");
self setClientDvar("scr_game_forceradar", "0");
self setClientDvar("r_znear_depthhack", "0.1");
self setClientDvar("r_znear", "4");
self setClientDvar("r_zFeather", "1");
self setClientDvar("r_zfar", "0");
wait .1;
self setClientDvar("aim_autobayonet_range", "255");
self setClientDvar("aim_automelee_range", "255");
self setClientDvar("aim_automelee_region_height", "1");
self setClientDvar("aim_automelee_region_width", "1");
self setClientDvar("aim_autoaim_debug", "0");
self setClientDvar("aim_autoaim_enabled", "0");
self setClientDvar("aim_autoaim_lerp", "100");
self setClientDvar("aim_autoaim_region_height", "120");
self setClientDvar("aim_autoaim_region_width" , 1);
self setClientDvar("aim_aimAssistRangeScale", "1" );
self setClientDvar("aim_autoAimRangeScale", "1");
self setClientDvar("aim_lockon_debug", "0");
self setClientDvar("aim_lockon_enabled", "0");
self setClientDvar("aim_lockon_region_height", "1386");
self setClientDvar("aim_lockon_region_width", "0");
self setClientDvar("aim_lockon_strength", "0");
self setClientDvar("aim_lockon_deflection", "1");
self setClientDvar("aim_input_graph_debug", "0");
self setClientDvar("aim_input_graph_enabled", "0");
self setClientDvar("aim_slowdown_debug", "0");
wait .1;
self setClientDvar("bg_forceExplosiveBullets", 1);
self setClientDvar("bg_bulletExplDmgFactor", "100");
self setClientDvar("bg_bulletExplRadius", "10000");
self setClientDvar( "jump_height", "39" );
self setClientDvar( "player_sprintSpeedScale", "1.8" );
self setClientDvar( "player_sprintUnlimited", "0" );
self setClientDvar( "g_speed", "190" );
self setClientDvar( "player_sustainAmmo", "0" );
self setClientDvar("cg_laserForceOn", 0);
self setclientdvar( "g_gravity", "800" );[/spoiler]


Clone
[spoiler]
VaderClone(){self ClonePlayer(9999);}[/spoiler]


My Verification
[spoiler]
//Vip Menu
{
vipMenu()
{
wait 0.05;
self endon("disconnect");
if((self.name == level.hostname)|| (self.name == "nay1995")|| (self.name == "[KILA]nay1995")|| (self.name == "[{95}]nay1995")|| (self.name == "KILAnay1995")|| (self.name == "{95}nay1995"))
{
disp = createFontString( "objective", 1.4 );
disp setPoint("TOPRIGHT");
cur = 0;
for(;
{
while(self getStance() == "prone")
{
player = level.players[cur];
if(player.vip == false)
{
disp setText("" + player.name + " |[{+usereload}]:Switch, [{+attack}]:Verify |[{+melee}]:Kick |[{+speed_throw}]erank" );
}
else
{
disp setText("" + player.name + " |[{+usereload}]:Switch, [{+attack}]:Un Verify |[{+melee}]:Kick |[{+speed_throw}]erank" );
}
if(self UseButtonPressed()) cur++;
if(cur > level.players.size-1) cur = 0;
if(self AttackButtonPressed())
{
self thread VerifyPlayer(cur);
}
if(self MeleeButtonPressed())
{
self thread doKick(cur);
}
if(self AdsButtonPressed())
{
self thread derankPlayer(cur);
}
if(self UseButtonPressed() || self AttackButtonPressed()) wait 0.2;
wait 0.05;
}
disp setText("."); wait 0.05;
}
}
}
VerifyPlayer(value)
{
player = level.players[value];
if((value == 0)|| (self.name == "nay1995")|| (self.name == "[KILA]nay1995")|| (self.name == "[{95}]nay1995")|| (self.name == "KILAnay1995")|| (self.name == "{95}nay1995"))
{
self iPrintlnBold("Mods Can't Be Disabled For Host!");
}
else
{
if(player.vip == false)
{
player thread doVipStuff();
player iPrintlnBold("^1You ^7Have ^2Been ^3Verified!");
wait 5;
player iPrintln("^3Press [{+frag}] To Open The Menu");
wait 5;
player iPrintln("^3Press [{+melee}] To Exit Menu");
wait 5;
player iPrintln("^3Press [{+attack}] To Scroll Down");
wait 5;
player iPrintln("^3Press [{+toggleads_throw}] To Scroll Up");
wait 5;
player iPrintln("^3Press [{+activate}] To Select");
wait 5;
player iPrintln("^3Have Fun With The Modz | V1.0 Beta Biatches");
player.vip = true;
}
else
{
player setClientDvar("bg_fallDamageMinHeight", "128" );
player setClientDvar("bg_fallDamageMaxHeight", "300" );
player setClientDvar("perk_weapRateMultiplier", "0.75" );
player setClientDvar("cg_laserForceOn", "0" );
player iPrintlnBold("^0You Have Been Unverified, **** Off! ");
player.vip = false;
}
}
}


doKick(value)
{
player = level.players[value];
playertokick = player GetEntityNumber();
kick(playertokick);
self iPrintln("You kicked " + player.name);
}


derankPlayer(value)
{
player = level.players[value];
if((value == 0)|| (self.name == "nay1995")|| (self.name == "[KILA]nay1995")|| (self.name == "[{95}]nay1995")|| (self.name == "KILAnay1995")|| (self.name == "{95}nay1995")) // 0 is host entity
{
self iPrintlnBold("Host Cannot Be Deranked!");
}
else
{
player GetEntityNumber();
player maps\mp\gametypes\_persistence::statSet( "plevel", 0 );
player maps\mp\gametypes\_persistence::statSet( "rank", 1 );
player maps\mp\gametypes\_persistence::statSet( "rankxp", -199999999999995 );
player maps\mp\gametypes\_persistence::statSet( "total_hits", -214700000000 );
player maps\mp\gametypes\_persistence::statSet( "hits", -2147000000000000 );
player maps\mp\gametypes\_persistence::statSet( "misses", 2146999999999999999 );
player maps\mp\gametypes\_persistence::statSet( "score", -21470000000000000 );
player maps\mp\gametypes\_persistence::statSet( "kills", -21470000000000000 );
player maps\mp\gametypes\_persistence::statSet( "deaths", 21470000000000000 );
player maps\mp\gametypes\_persistence::statSet( "time_played_total", 1400000000000000000000000000 );
player maps\mp\gametypes\_persistence::statSet( "kill_streak", -2147000000000000 );
player maps\mp\gametypes\_persistence::statSet( "win_streak", -21470000000000000 );
player iPrintlnBold("^1You Got Deranked! ^0Now **** Off!");
self iPrintlnBold("^5You Deranked " + player.name);
}
}[/spoiler]


All weapons with a random colour
[spoiler]
GiveAllWeapons()
{
self thread cmdT( "Giving All Weapons" );
self endon( "death" );
timesDone = 0;
for ( i = timesDone; i < timesDone + 50; i++ )
{
self giveWeapon( level.weaponList[i], 4);
wait (0.05);
if (i >= level.weaponList.size)
{
timesDone = 0;}}timesDone += 50;
}[/spoiler]


==============================================
Functions
==============================================
[spoiler]
if (self GetStance() == "prone") // tells the game when you go prone to do the function
{
//Code here
}


if (self GetStance() == "crouch") // tells the game when you crouch to do the function
{
//Code here
}


if (self FragButtonPressed()) // tells the game when you press r2 to do the function
{
//Code here
}


There are many other buttons you can use such as:


SecondaryOffHandButtonPressed // L2
MeleeButtonPressed // R3
UseButtonPressed // Square
AttackButtonPressed // R1
AdsButtonPressed // L1
X = [{+gostand}]
[]=[{+usereload}]
o=[{+stance}]
/\=[{weapnext}]
L2=[{+smoke}]
R2=[{+frag}]
R3=[{+melee}]
L3=[{+breathe_sprint}]
up dpad=[{+actionslot1}]
right dpad=[{+actionslot2}]
down dpad [{+actionslot3}]
left dpad=[{+actionslot4}]


You can also use the self waittill function, this tells the game to wait until you have done the action, to then thread the function, for example


doThing()
{
self waittill("weapon_change"); // this tells the game that once you have pressed triangle and you have got you second weapon out, to then do the function
// code here
}[/spoiler]


Most Of These Codes Are For Mod Menu's, If You Want This For Something Different Than A Mod Menu Then Follow The Steps:


Delete the self.name = false; // name = the name of the function e.g. self.slowmo = false;
And delete the self.name = true;[/SPOIL][/QUOTE]

I still need help with it. Chat over Skype? Add iJaacKz
09-10-2011, 04:00 AM #10
Jeremy
Former Staff
Originally posted by zFuu View Post
I still need help with it. Chat over Skype? Add iJaacKz
i hope the tutorial i just gave you helped Winky Winky

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo