Raised This Month: $ Target: $400
 0% 

getting buttons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-02-2013 , 06:27   Re: getting buttons
Reply With Quote #1

PHP Code:
new button pev(indexpev_button);
if(
button IN_USE && button IN_ATTACK && button IN_FORWARD
can write like this :

PHP Code:
const IN_USE_ATTACK_FORWARD IN_USE IN_ATTACK IN_FORWARD// that one in global scope.
if(pev(indexpev_button) & IN_USE_ATTACK_FORWARD == IN_USE_ATTACK_FORWARD 

And that one :
PHP Code:
new button pev(indexpev_button);
if(
button IN_USE || button IN_ATTACK || button IN_FORWARD
can write like this :

PHP Code:
const IN_USE_ATTACK_FORWARD IN_USE IN_ATTACK IN_FORWARD// that one in global scope.
if(pev(indexpev_button) & IN_USE_ATTACK_FORWARD 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 05-02-2013 , 07:05   Re: getting buttons
Reply With Quote #2

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
new button pev(indexpev_button);
if(
button IN_USE && button IN_ATTACK && button IN_FORWARD
can write like this :

PHP Code:
const IN_USE_ATTACK_FORWARD IN_USE IN_ATTACK IN_FORWARD// that one in global scope.
if(pev(indexpev_button) & IN_USE_ATTACK_FORWARD == IN_USE_ATTACK_FORWARD 
Ok, Thanks

But my question is: Will my code work, because I will use code like that
PHP Code:
static buttonbutton pev(indexpev_button);
if(
button IN_USE)
{
   if(
button IN_ATTACK)
   {
      
// do sth
   
}
   else if(
button IN_ATTACK2)
   {
      
// do sth
   
}

Because with your way, I'll check IN_USE many times, instead of one

Last edited by didoWEE; 05-02-2013 at 07:24.
didoWEE is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-02-2013 , 08:32   Re: getting buttons
Reply With Quote #3

You should have asked with that last code from the beginning then.
Yes your code is ok.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode