Raised This Month: $ Target: $400
 0% 

about percentage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-24-2012 , 21:16   Re: about percentage
Reply With Quote #6

Quote:
Originally Posted by Liverwiz View Post
new Float:percent = (cs_get_weapon_ammo(id) / clipSize[weapon]) * 100 //This will get % of clip left
if(percent == 50 || percent == 10)
You are performing integer division which will give you an integer (0 in this case). Also, you can never use the comparison operator (==) with floating point numbers.
__________________
fysiks 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 06:13.


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