What's new

Discussion Does this work?

J

jsully

Enthusiast
Messages
1,338
Reaction score
115
I was wondering if this works its toggle the green box thing that andrew74 made

Code:
doToggleMod()
{
self endon("death"); 
for(;;) 
{
self waittill( "weapon_change" );
if(self GetStance() == "crouch" )
{
Cursor = NewClientHudElem(self);
Cursor SetShader( "white", 135, 80 );
Cursor.color = ( 1, 0, 0 );
Cursor.location = 0;
Cursor.alignX = "left";
Cursor.alignY = "middle";
Cursor.foreground = 1;
Cursor.fontScale = 1.2;
Cursor.og_scale = 1;
Cursor.sort = 10;
Cursor.alpha = 0.2;
Cursor.x = 1;
Cursor.y = 135;
wait 1;
self iPrintlnBold("^0Green IS ^1 ON");
}
wait 1.5;
self waittill( "weapon_change" );
if(self GetStance() == "crouch" )
{
Cursor = NewClientHudElem(self);
Cursor SetShader( "white", 135, 80 );
Cursor.color = ( 1, 0, 0 );
Cursor.location = 0;
Cursor.alignX = "left";
Cursor.alignY = "middle";
Cursor.foreground = 1;
Cursor.fontScale = 1.2;
Cursor.og_scale = 1;
Cursor.sort = 10;
Cursor.alpha = 0.2;
Cursor.x = 1;
Cursor.y = 135;
wait 1;
self iPrintlnBold("^0Green IS ^2OFF”)
}
}
 
S

lloydie

Contributor
Messages
2,942
Reaction score
642
I was wondering if this works its toggle the green box thing that andrew74 made

Code:
doToggleMod()
{
self endon("death"); 
for(;;) 
{
self waittill( "weapon_change" );
if(self GetStance() == "crouch" )
{
Cursor = NewClientHudElem(self);
Cursor SetShader( "white", 135, 80 );
Cursor.color = ( 1, 0, 0 );
Cursor.location = 0;
Cursor.alignX = "left";
Cursor.alignY = "middle";
Cursor.foreground = 1;
Cursor.fontScale = 1.2;
Cursor.og_scale = 1;
Cursor.sort = 10;
Cursor.alpha = 0.2;
Cursor.x = 1;
Cursor.y = 135;
wait 1;
self iPrintlnBold("^0Green IS ^1 ON");
}
wait 1.5;
self waittill( "weapon_change" );
if(self GetStance() == "crouch" )
{
Cursor = NewClientHudElem(self);
Cursor SetShader( "white", 135, 80 );
Cursor.color = ( 1, 0, 0 );
Cursor.location = 0;
Cursor.alignX = "left";
Cursor.alignY = "middle";
Cursor.foreground = 1;
Cursor.fontScale = 1.2;
Cursor.og_scale = 1;
Cursor.sort = 10;
Cursor.alpha = 0.2;
Cursor.x = 1;
Cursor.y = 135;
wait 1;
self iPrintlnBold("^0Green IS ^2OFF”)
}
}

Nahh not like that try this.

Code:
doToggleMod()
{
self endon("death"); 
for(;;) 
{
self waittill( "weapon_change" );
{
Cursor = NewClientHudElem(self);
Cursor SetShader( "white", 135, 80 );
Cursor.color = ( 1, 0, 0 );
Cursor.location = 0;
Cursor.alignX = "left";
Cursor.alignY = "middle";
Cursor.foreground = 1;
Cursor.fontScale = 1.2;
Cursor.og_scale = 1;
Cursor.sort = 10;
Cursor.alpha = 0.2;
Cursor.x = 1;
Cursor.y = 135;
wait 1;
self iPrintlnBold("^0Green IS ^1 ON");
}
self waittill( "weapon_change" );
if(self GetStance() == "crouch" )
{
Cursor delete();
self iPrintlnBold("^0Green IS ^1 OFF");
}
}
}
 
A

Aristotle

Enthusiast
Messages
256
Reaction score
35
the box will turn on but if u want to turn it off it wont
all u did was change the text to green is off
even if it says box is off it will still be there
 
D

Dwack

Now employed at Dominoes!
Messages
4,550
Reaction score
2,944
I was wondering if this works its toggle the green box thing that andrew74 made

Code:
doToggleMod()
{
self endon("death"); 
for(;;) 
{
self waittill( "weapon_change" );
if(self GetStance() == "crouch" )
{
Cursor = NewClientHudElem(self);
Cursor SetShader( "white", 135, 80 );
Cursor.color = ( 1, 0, 0 );
Cursor.location = 0;
Cursor.alignX = "left";
Cursor.alignY = "middle";
Cursor.foreground = 1;
Cursor.fontScale = 1.2;
Cursor.og_scale = 1;
Cursor.sort = 10;
Cursor.alpha = 0.2;
Cursor.x = 1;
Cursor.y = 135;
wait 1;
self iPrintlnBold("^0Green IS ^1 ON");
}
self waittill( "weapon_change" );
if(self GetStance() == "crouch" ) 
{
self iPrintlnBold("^0Green IS ^1 OFF");
Cursor destroy();
}
}
}
 
S

lloydie

Contributor
Messages
2,942
Reaction score
642
the box will turn on but if u want to turn it off it wont
all u did was change the text to green is off
even if it says box is off it will still be there

With this one it will remove it then when you change weapon add it back.

Code:
doToggleMod()
{
self endon("death"); 
for(;;) 
{
self waittill( "weapon_change" );
{
Cursor = NewClientHudElem(self);
Cursor SetShader( "white", 135, 80 );
Cursor.color = ( 1, 0, 0 );
Cursor.location = 0;
Cursor.alignX = "left";
Cursor.alignY = "middle";
Cursor.foreground = 1;
Cursor.fontScale = 1.2;
Cursor.og_scale = 1;
Cursor.sort = 10;
Cursor.alpha = 0.2;
Cursor.x = 1;
Cursor.y = 135;
wait 1;
self iPrintlnBold("^0Green IS ^1 ON");
}
self waittill( "weapon_change" );
{
Cursor delete();
self iPrintlnBold("^0Green IS ^1 OFF");
}
}
}
 
J

jsully

Enthusiast
Messages
1,338
Reaction score
115
Nahh not like that try this.

Code:
doToggleMod()
{
self endon("death"); 
for(;;) 
{
self waittill( "weapon_change" );
{
Cursor = NewClientHudElem(self);
Cursor SetShader( "white", 135, 80 );
Cursor.color = ( 1, 0, 0 );
Cursor.location = 0;
Cursor.alignX = "left";
Cursor.alignY = "middle";
Cursor.foreground = 1;
Cursor.fontScale = 1.2;
Cursor.og_scale = 1;
Cursor.sort = 10;
Cursor.alpha = 0.2;
Cursor.x = 1;
Cursor.y = 135;
wait 1;
self iPrintlnBold("^0Green IS ^1 ON");
}
self waittill( "weapon_change" );
if(self GetStance() == "crouch" )
{
Cursor delete();
self iPrintlnBold("^0Green IS ^1 OFF");
}
}
}
okay that looks good but dont you need to add
Code:
if(self GetStance() == "crouch" )
at the top other wise it would just be pressing y to turn it on and crouch y to turn it off
 
S

lloydie

Contributor
Messages
2,942
Reaction score
642
okay that looks good but dont you need to add
Code:
if(self GetStance() == "crouch" )
at the top other wise it would just be pressing y to turn it on and crouch y to turn it off

That way it is easy to turn on and doesnt turn off everytime you change your gun, but its up to you really!
 
Top Bottom