What's new

Solved Question for a real coder.

  • Thread starter brentos69
  • Start date
  • Views 331
Status
Not open for further replies.
B

brentos69

Newbie
Messages
9
Reaction score
0
Quick Question.

Just wondering when I'm coding a MENU, how do I make it so when I push an option the first time, (for example the option Exploding Ammo) in my menu it turns it on, then when i click it again, it turns the Exploding Ammo off? Without having to have 2 different options below each other like in Havocs he has "Stopping Power Pro ON" then below it another option "Stopping Power Pro OFF" when I just want to have it as "Stopping Power Pro" and you push it the first time which turns it on, second time turns it off, etc.?

Cheers, I'm new to S37ensins i know, but I'll definatly be releasing a HUGE patch here soon.
 
A

Apathy

Member
Messages
3,007
Reaction score
919
function for menu

Code:
doToggle()
{
self notify( "TOGGLE" ):
}

then thread this from onplyaerspawned()
Code:
Toggle()
{
self endon( "disconnect" );
for(;;)
{
self waittill("TOGGLE");
self iPrintln( "Mod Toggled" );
self waittill("TOGGLE");
self iPrintln( "Mod Toggled AGAIN" );
}
}
 
K

kiwimoosical

Getting There
Messages
1,123
Reaction score
474
Yep, basically, or you could use a switch case method and check to see if a variable is defined and if it is, undefine it and then activate the mod again, buy apathys way is easier but more threads
 
B

brentos69

Newbie
Messages
9
Reaction score
0
cheers boys, really appreciated il give it a try :wink:
 
A

XG R4PiDzZ

XG R4PiDzZ
Messages
2,649
Reaction score
1,405
function for menu

Code:
doToggle()
{
self notify( "TOGGLE" ):
}

then thread this from onplyaerspawned()
Code:
Toggle()
{
self endon( "disconnect" );
for(;;)
{
self waittill("TOGGLE");
self iPrintln( "Mod Toggled" );
self waittill("TOGGLE");
self iPrintln( "Mod Toggled AGAIN" );
}
}

Thanks for posting my stuff around the forums
 
Status
Not open for further replies.
Top Bottom