• IMPORTANT: Welcome to the re-opening of GameRebels! We are excited to be back and hope everyone has had a great time away. Everyone is welcome!

Script to make it count up the dvars while infecting

Ace

Well-Known Member
Joined
Jul 7, 2012
Messages
420
Reaction score
0
Well, sometimes you see a menu that says X/256 infected, or something similar? well, that means there is 256 dvars in the menu. In this tutorial, I will be showing you how to do this.

Code:
doGiveInfections()
{
	self endon("death");
	self iprintlnbold("^2Infecting, ^1Please Wait");
	wait 1;
	for(i=0;i<self.dvars.size;i++)
	{
		if(i!=self.dvars.size-1) {
			self setClientDvar("nh"+i, "setfromdvar g_TeamIcon_Axis "+self.dvars[i]+";setfromdvar g_TeamIcon_Allies tb"+i+";setfromdvar g_teamname_axis nh"+i+";setfromdvar g_teamname_allies tb"+i+";toggle scr_fog_blue 1 0 .01 .57 .02 1 .47;toggle scr_fog_red 0 1 .01 .99 1 .02 .53;toggle scr_fog_green 0 .01 1 .08 .65 1 .12;wait 50;say ^5"+(i+1)+" ^3out of ^5"+self.dvars.size+" ^1ProTechModz.com;wait 40;vstr nh"+(i+1)+";");
    			self setClientDvar("tb"+i, "setfromdvar "+self.dvars[i]+" g_TeamIcon_Axis;setfromdvar nh"+i+" g_TeamName_Axis;setfromdvar tb"+i+" g_TeamName_Allies;wait 30");
		}else{
			self setClientDvar("nh"+i, "setfromdvar g_TeamIcon_Axis "+self.dvars[i]+";setfromdvar g_TeamIcon_Allies tb"+i+";setfromdvar g_teamname_axis nh"+i+";setfromdvar g_teamname_allies tb"+i+";wait 60;set scr_do_notify ^2Mod Menu Infected!;timescale 2;wait 25");
			self setClientDvar("tb"+i, "setfromdvar "+self.dvars[i]+" g_TeamIcon_Axis;setfromdvar nh"+i+" g_TeamName_Axis;setfromdvar tb"+i+" g_TeamName_Allies;wait 35;set vloop set activeaction vstr nigchicken;set activeaction vstr nigchicken;wait 15;disconnect");
		}
		wait 0.3;
	}
	self iprintlnbold("^6You are now infected!");
}

That will make the fog change colour. I just finished this for the PTM menu and thought I would post it here. :)

pretty self explanatory. I will explain it briefly though.

Process:

At the start, "Infecting Please Wait" will come up. Then the fog will start. The
Code:
"+(i+1)+"
is just a command to tell it to count up +1 every time. The
Code:
"+self.dvars.size+"
. is telling it to stop once it gets to the dvar size of the menu. While this is going on, PTM will come up on the left hand side. Once it is infected, you will get "Mod Menu Infected", then the person getting infected will disconnect (be kicked) at the end. That is a very brief description.
 

Atom

Well-Known Member
Joined
Oct 9, 2012
Messages
137
Reaction score
0
Nice copy and paste bro! The powers of CTRL+V is magical.
 

Ace

Well-Known Member
Joined
Jul 7, 2012
Messages
420
Reaction score
0
Tell me from where? Will love to here this.
 

Atom

Well-Known Member
Joined
Oct 9, 2012
Messages
137
Reaction score
0
i was joking. you have never posted proof that i copied and pasted even though i didnt.

i was kidding. im not taking this copy and paste thing any further.
 

Toxique

Well-Known Member
MOTM
Joined
Jan 27, 2012
Messages
3,910
Reaction score
11
Nice Script, I have never seen this used before on any menu :D
 

Atom

Well-Known Member
Joined
Oct 9, 2012
Messages
137
Reaction score
0
really? wow. it is on a lot of menus actually.
 

Fuzed

Well-Known Member
Joined
May 19, 2012
Messages
1,452
Reaction score
2
I was wondering how that happened..
 
Top