Raised This Month: $ Target: $400
 0% 

A little bit help with '?'


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-02-2013 , 16:12   Re: A little bit help with '?'
Reply With Quote #1

PHP Code:
show_hudmessage(id, (!Points[id]) ? "Points will be reseted." "Points [%d]"Points[id]); 
I don't see any other way to put this in an function

>> (!Points[id]) Always return true if the points its equal or < 0

Remember:

PHP Code:
(CONDITION) ? TRUE FALSE 
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 06-02-2013 at 16:17. Reason: Oops
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 06-02-2013 , 16:35   Re: A little bit help with '?'
Reply With Quote #2

PHP Code:
show_hudmessage(idPoints[id] <= "Points will be reseted" "Points [%d]"Points[id]) 
works correctly in this way, thanks.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 06-03-2013 , 17:16   Re: A little bit help with '?'
Reply With Quote #3

Quote:
Originally Posted by ^SmileY View Post

>> (!Points[id]) Always return true if the points its equal or < 0
Actually in that case only if it's 0.

PHP Code:
new iVariable 0;
if( !
iVariable )
 
client_print(0print_chat"passed, since (!0 == true)");

new 
iVariable 1;
if( !
iVariable )
 
client_print(0print_chat"didn't pass, since (!1 == false)");

new 
iVariable = -1;
if( !
iVariable )
 
client_print(0print_chat"didn't pass, since (!-1 == false)"); 
// Only if( 0 ) function will not pass, in other conditions it always passes. In other words, only 0 is false, everything else is considered as true. (At least in my experience).
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.

Last edited by MPNumB; 06-03-2013 at 17:17.
MPNumB is offline
Send a message via Skype™ to MPNumB
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 16:24.


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