Raised This Month: $ Target: $400
 0% 

Higher cvar


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-31-2011 , 19:02   Re: Higher cvar
Reply With Quote #3

Why do you need this exacly ?

But to answer your question... if you want to know which cvar is higher:
Code:
new highestCvar = 0

if(cvar1 > cvar2 && cvar1 > cvar3)
    highestCvar = 1

else if(cvar2 > cvar1 && cvar2 > cvar3)
    highestCvar = 2

else if(cvar3 > cvar2 && cvar3 > cvar1)
    highestCvar = 3
... but I think there's a better way for it.

Or if you just want the highest value of the three cvars:
Code:
new highestValue = max(max(cvar1, cvar2), cvar3)
Quote:
Originally Posted by OvidiuS View Post
higher than what?
Higher than themselves I guess, he's making a bad code example.
__________________
Hunter-Digital is offline
 



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 03:24.


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