What's new

Discussion Does this work?

jsully

jsully

Enthusiast
Messages
1,338
Reaction score
115
Points
175
Sin$
0
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”)
}
}
 
SnappiestJack

lloydie

Contributor
Modder Fabled Veteran Forum Addict
Messages
2,941
Reaction score
642
Points
365
Sin$
7
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");
}
}
}
 
Aristotle

Aristotle

Enthusiast
Messages
256
Reaction score
35
Points
85
Sin$
0
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
 
Dwack

Dwack

Now employed at Dominoes!
Experienced Veteran Hardened Veteran
Messages
4,551
Reaction score
2,949
Points
685
Sin$
0
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();
}
}
}
 
SnappiestJack

lloydie

Contributor
Modder Fabled Veteran Forum Addict
Messages
2,941
Reaction score
642
Points
365
Sin$
7
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");
}
}
}
 
jsully

jsully

Enthusiast
Messages
1,338
Reaction score
115
Points
175
Sin$
0
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
 
SnappiestJack

lloydie

Contributor
Modder Fabled Veteran Forum Addict
Messages
2,941
Reaction score
642
Points
365
Sin$
7
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
Login
Register