Post: New Button Configuration; 2 In 1 Commanding!
11-22-2011, 08:55 PM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({}); Yes this is code, it's actually what i set out to do along time ago with IELIITEM0DZX but for some reason never finished it.
this is very different to other button system heres why.

- You can make someone actually press the button.
- It can also be used as a button, if it's pressed.

    
ButtonPressed( button, func, input )
{
self.Pressed = [];
switch( button )
{
case "Frag": self.Pressed = "self fragButtonPressed"; break;
case "Smoke": self.Pressed = "self SecondaryOffHandButtonPressed"; break;
case "Square": self.Pressed = "self UseButtonPressed"; break;
case "Melee": self.Pressed = "self MeleeButtonPressed"; break;
case "Fire": self.Pressed = "self AttackButtonPressed"; break;
case "Aim": self.Pressed = "self AdsButtonPressed"; break;
}
if( isDefined( func ))
{
if( [[self.Pressed]]() )
{
if(!isDefined( input )) self thread [[func]]();
if( isDefined( input )) self thread [[func]](input);
}
}
wait .02;
return;
}


put that into your GSC somewhere.
and here's an example of your too methods.

- Make someone press it.
    
Player[i] thread ButtonPressed( "Frag" );


that will make him actually press it, but of course you can have functions and inputs..

heres the other example of if the button is pressed
    
iif( self ButtonPressed( "Frag" ) )
{
//a thread here.
}


here's another little way of if it's pressed, if the player presses it.
    
if( level.players[i] ButtonPressed( "Frag" ))
{
self suicide();
self iPrintln( "Dont Press That Button!" );
}


and it's just like that, use this on how you wish.. just state if you used it.
i have tested this, it does work.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to Correy for this useful post:

FAKA_ELITE, FourzerotwoFAILS, IVI40A3Fusionz, Bichote, Rea
11-22-2011, 10:02 PM #11
Blackstorm
Veni. Vidi. Vici.
Originally posted by Correy View Post
want a video :p ?

---------- Post added at 10:01 PM ---------- Previous post was at 09:58 PM ----------



yeah, or sometimes like DvGM running through the mall Winky Winky


Want me to explain why this wouldn't work? :b
11-22-2011, 10:03 PM #12
Correy
I'm the Original
Originally posted by Blackstorm View Post
Want me to explain why this wouldn't work? :b


go for it :p
11-22-2011, 10:07 PM #13
Blackstorm
Veni. Vidi. Vici.
Originally posted by Correy View Post
go for it :p


First off, when you used the function calling brackets ( [[function]] ) you used strings. That's like doing... self thread "doGod"();. The only reason it doesn't error is because, you are using the brackets. Second, you named the function buttonPressed, which is a built in function. The game wouldn't even allow the script to run unless you changed it. Third, I just tested, and it in fact, did not work, it didn't error, but didn't work. So there Upside Down Happy

Also you say you tested it, yet you are using it in if functions incorrectly because the actual function itself doesn't even return a boolean. :b

The following user thanked Blackstorm for this useful post:

x_DaftVader_x
11-22-2011, 10:16 PM #14
Originally posted by Blackstorm View Post
First off, when you used the function calling brackets ( [[function]] ) you used strings. That's like doing... self thread "doGod"();. The only reason it doesn't error is because, you are using the brackets. Second, you named the function buttonPressed, which is a built in function. The game wouldn't even allow the script to run unless you changed it. Third, I just tested, and it in fact, did not work, it didn't error, but didn't work. So there Upside Down Happy

Also you say you tested it, yet you are using it in if functions incorrectly because the actual function itself doesn't even return a boolean. :b
smart arse...

---------- Post added at 10:16 PM ---------- Previous post was at 10:15 PM ----------

Originally posted by Correy View Post


yeah, or sometimes like DvGM running through the mall Winky Winky
My accuracy is just over 3% now xD
11-22-2011, 10:17 PM #15
Blackstorm
Veni. Vidi. Vici.
Originally posted by x. View Post
smart arse...

---------- Post added at 10:16 PM ---------- Previous post was at 10:15 PM ----------

My accuracy is just over 3% now xD


Was that suppose to be insulting? I'm just saying why it wouldn't work. I knew this wouldn't work out of experience because Karoolus and I had tried something extremely similar to this a few months ago.
11-22-2011, 10:20 PM #16
Originally posted by Blackstorm View Post
Was that suppose to be insulting? I'm just saying why it wouldn't work. I knew this wouldn't work out of experience because Karoolus and I had tried something extremely similar to this a few months ago.
It wasn't an insult.. It was a joke..
11-22-2011, 10:21 PM #17
Blackstorm
Veni. Vidi. Vici.
Originally posted by x. View Post
It wasn't an insult.. It was a joke..


Well you didn't put a :carling: face after it implying that you were joking like most of the hipsters here would. :carling:
11-22-2011, 10:21 PM #18
Correy
I'm the Original
Originally posted by Blackstorm View Post
First off, when you used the function calling brackets ( [[function]] ) you used strings. That's like doing... self thread "doGod"();. The only reason it doesn't error is because, you are using the brackets. Second, you named the function buttonPressed, which is a built in function. The game wouldn't even allow the script to run unless you changed it. Third, I just tested, and it in fact, did not work, it didn't error, but didn't work. So there Upside Down Happy

Also you say you tested it, yet you are using it in if functions incorrectly because the actual function itself doesn't even return a boolean. :b


but i did test and when that button was pressed it done the function..
11-22-2011, 10:23 PM #19
Correy
I'm the Original
Originally posted by x. View Post

[/COLOR]My accuracy is just over 3% now xD


well arent you getting better Winky Winky!

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo