Raised This Month: $ Target: $400
 0% 

Solved Fix ammor over 999 hud bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-01-2017 , 06:59   Fix ammor over 999 hud bug
Reply With Quote #1

I am trying to fix this bug because it really annoying when you set the armor to like 10000, the hud will be overflow number from 0 - 9

I have try this but it didn't work.
Copied from message_health in Zombie Plague

PHP Code:
register_message(get_user_msgid("ArmorType"), "message_armor")

public 
message_armor(msg_idmsg_destmsg_entity)
{
    new 
armor get_msg_arg_int(1)
    
    
// Don't bother
    
if (armor 999) return;
    
    
// Check if we need to fix it
    
if (armor 999 == 0)
        
cs_set_user_armor(msg_entityget_user_armor(msg_entity)+ 1CS_ARMOR_VESTHELM)
    
    
// HUD can only show as much as 255 hp
    
set_msg_arg_int(1get_msg_argtype(1), 999)

If possible, can I also have list of msg and it name too?
__________________
My plugin:

Last edited by Celena Luna; 07-01-2017 at 13:12. Reason: Problem Sovled!
Celena Luna is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 07-01-2017 , 07:43   Re: Fix ammor over 999 hud bug
Reply With Quote #2

Code:
register_message(get_user_msgid("Battery"), "SendingBattery"); public SendingBattery() {     set_msg_arg_int(1, get_msg_argtype(1), clamp(get_msg_arg_int(1), 0, 999)); }
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-01-2017 , 13:11   Re: Fix ammor over 999 hud bug
Reply With Quote #3

Quote:
Originally Posted by PRoSToTeM@ View Post
Code:
register_message(get_user_msgid("Battery"), "SendingBattery"); public SendingBattery() {     set_msg_arg_int(1, get_msg_argtype(1), clamp(get_msg_arg_int(1), 0, 999)); }
it work ^^
thank you so much <3
__________________
My plugin:
Celena Luna is offline
Reply


Thread Tools
Display Modes

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 22:56.


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