Raised This Month: $ Target: $400
 0% 

about percentage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 06-24-2012 , 14:22   Re: about percentage
Reply With Quote #2

I give you concept and links to function wikis you will need. But you're gonna have to write the code yourself. or go to the request section.

CreateHudSyncObj() http://www.amxmodx.org/funcwiki.php?go=func&id=1064
new weapon = cs_get_user_weapon(id) http://www.amxmodx.org/funcwiki.php?go=func&id=738
http://www.amxmodx.org/funcwiki.php?go=func&id=207
new Float:percent = (cs_get_weapon_ammo(id) / clipSize[weapon]) * 100 //This will get % of clip left
if(percent == 50 || percent == 10)
show_hudmessage(id, "Your clip is at ^%%d!", percent)
http://www.amxmodx.org/funcwiki.php?go=func&id=29

NOTE: clipSize you'll have to write yourself. It'll be an array of the clip size of that weapon. i.e. CSW_M4A1 = 30, CSW_FAMAS = 25, CSW_M249 = 100 etc etc
PHP Code:
new clip clipSize[CSW_M4A1]    //clip will then equal 30 
put it all in a weapon fire hook. so it gets run after each shot. (not sure what you'd want to use for that)

Know what? I actually think i'll have fun writing this. So i might even do it for you, if you need. But i don't have time today. So if you're willing to wait untill tomorrow or something, PM me and i'll get it for you when i can. Otherwise, if you can't write it (it should be real simple) just post in request.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 06-24-2012 at 14:24.
Liverwiz 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