AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Fix ammor over 999 hud bug (https://forums.alliedmods.net/showthread.php?t=299059)

Celena Luna 07-01-2017 06:59

Fix ammor over 999 hud bug
 
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?

PRoSToTeM@ 07-01-2017 07:43

Re: Fix ammor over 999 hud bug
 
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)); }

Celena Luna 07-01-2017 13:11

Re: Fix ammor over 999 hud bug
 
Quote:

Originally Posted by PRoSToTeM@ (Post 2532804)
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


All times are GMT -4. The time now is 22:56.

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