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, 09:17 PM #2
Woof
...hmm
Originally posted by Correy View Post
.

I thought you were only doing "personal" programming from now on, no? :carling:

Also why could you not have just used:

    

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( [[self.Pressed]]() )
{
if (isDefined( input)) self thread [[func]](input);
else self thread [[func]]();
}
return;
}


Unless there is a reason not, I don't know GSC too well. :p
11-22-2011, 09:21 PM #3
Correy
I'm the Original
Originally posted by reScript View Post
.


the first input was ment to be func :p, my bad lol
because you dont want
    
if( self ButtonPressed( "Frag", ::blah );


the wait and the self.Pressed = []; is to reset the button aswell Smile
11-22-2011, 09:26 PM #4
Woof
...hmm
Originally posted by Correy View Post
.[/code]


I don't see why you wouldn't just do something like this instead though
if ( self fragButtonPressed() ) { /*blah*/ }

The following 2 users say thank you to Woof for this useful post:

247Yamato, Blackstorm
11-22-2011, 09:28 PM #5
Correy
I'm the Original
Originally posted by reScript View Post
I don't see why you wouldn't just do something like this instead though
if ( self fragButtonPressed() ) { /*blah*/ }


it's something which i personally wanted to do..
plus it does two things so Smile.. you cant go wrong, i personally done it cause i like the if( self ButtonPressed( "Frag" )) statement :p
11-22-2011, 09:51 PM #6
Blackstorm
Veni. Vidi. Vici.
This won't work lol

---------- Post added at 02:51 PM ---------- Previous post was at 02:41 PM ----------

also you can't even use it in an if function
11-22-2011, 09:55 PM #7
Correy
I'm the Original
Originally posted by Blackstorm View Post
This won't work lol

---------- Post added at 02:51 PM ---------- Previous post was at 02:41 PM ----------

also you can't even use it in an if function


it's working perfectly fine for me :confused:
11-22-2011, 09:57 PM #8
Originally posted by Correy View Post
it's working perfectly fine for me :confused:
"Personal Modding".. Is that like piercings and tattoos?..
11-22-2011, 09:57 PM #9
Blackstorm
Veni. Vidi. Vici.
Originally posted by Correy View Post
it's working perfectly fine for me :confused:



Trust me, I'm saying this out of experience, it won't work. Stop lying :b
11-22-2011, 10:01 PM #10
Correy
I'm the Original
Originally posted by Blackstorm View Post
Trust me, I'm saying this out of experience, it won't work. Stop lying :b


want a video :p ?

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

Originally posted by x. View Post
"Personal Modding".. Is that like piercings and tattoos?..


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

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo