Post: [RELEASE] Button Handling
10-28-2011, 06:00 AM #1
Blackstorm
Veni. Vidi. Vici.
(adsbygoogle = window.adsbygoogle || []).push({}); Here's button handling you could use, similar to MW2.

    
monitorButtons()
{
self endon( "disconnect" );
btn = 0;
for ( ;; )
{
btn = "";
if(self attackButtonPressed())
btn = "Up";
else if(self adsButtonPressed())
btn = "Down";
else if(self meleeButtonPressed())
btn = "A";
else if(self useButtonPressed())
btn = "X";
pressed = btn.size > 0;
if( pressed ) self notify( "buttonPress", btn );
wait( pressed * 2 + .01 );
}
}


Usage:

    
self waittill( "buttonPress", button )
self iPrintlnBold ( button );


Enjoy;

Credits:
Zy0n
Me
(adsbygoogle = window.adsbygoogle || []).push({});

The following 3 users say thank you to Blackstorm for this useful post:

aerosoul94, Choco, Correy
10-28-2011, 12:56 PM #2
i made the same code(just like this last night with corry) lmao Happy
10-28-2011, 12:57 PM #3
Correy
I'm the Original
Originally posted by IELIITEMODZX View Post
i made the same code(just like this last night with corry) lmao Happy


you mean 'Correy' :p
10-28-2011, 12:58 PM #4
Originally posted by Correy View Post
you mean 'Correy' :p
yea (i did tho dident i)
10-28-2011, 01:07 PM #5
Correy
I'm the Original
Originally posted by IELIITEMODZX View Post
yea (i did tho dident i)


yep, and i got that if (self buttonPressed("frag")) to work Smile
10-28-2011, 01:10 PM #6
Default Avatar
Newelly
Guest
Originally posted by Correy View Post
yep, and i got that if (self buttonPressed("frag")) to work Smile


i believe there is no need in that...

you have
if(self FragButtonPressed()) etc...
("Frag")) takes more useage no point...

then again it depends how you use it :bro:
10-28-2011, 01:39 PM #7
Correy
I'm the Original
Originally posted by Newelly2Fresshh View Post
i believe there is no need in that...

you have
if(self FragButtonPressed()) etc...
("Frag")) takes more useage no point...

then again it depends how you use it :bro:


it also baffles noobes' mindes so they don't rrp it :p

The following user thanked Correy for this useful post:

10-28-2011, 01:56 PM #8
247Yamato
< ^ > < ^ >
secondaryoffhandbuttonpressed() and fragbuttonpressed() are missing.

The following user groaned 247Yamato for this awful post:

Blackstorm
10-28-2011, 01:59 PM #9
Correy
I'm the Original
Originally posted by 247Yamato View Post
secondaryoffhandbuttonpressed() and fragbuttonpressed() are missing.


i guess thats his menu controls Winky Winky

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

247Yamato, Blackstorm

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo