AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bug base builder (https://forums.alliedmods.net/showthread.php?t=318113)

Ykaru 08-14-2019 15:50

Bug base builder
 
Hi, sometimes, I do not know why when I go to the server my image appears on one side and it appears to me that I have 1 HP.
Look at the picture to see how it looks.
And it does so only if I'm on Steam ON.

https://imgur.com/a/5AizUzp

And if im using like bb_revive command server will crash.
This is the base plugin if you want to see it.
Please help me.

https://www84.zippyshare.com/v/AKf7I4GH/file.html

OciXCrom 08-14-2019 16:43

Re: Bug base builder
 
That is normal behavior when your health bar is supposed to show 0, but you actually have above 255 health. It's a bug from the game itself.

Ykaru 08-14-2019 16:55

Re: Bug base builder
 
Quote:

Originally Posted by OciXCrom (Post 2663265)
That is normal behavior when your health bar is supposed to show 0, but you actually have above 255 health. It's a bug from the game itself.

And can i do something about that ?

edon1337 08-14-2019 17:20

Re: Bug base builder
 
Download the original BB v6.5 and disable plugins one by one, there must be a plugin that's causing this. I remember this once happened to me back in ~2017 because I had no idea what I was adding to my plugin.

OciXCrom 08-15-2019 07:35

Re: Bug base builder
 
Quote:

Originally Posted by edon1337 (Post 2663273)
Download the original BB v6.5 and disable plugins one by one, there must be a plugin that's causing this. I remember this once happened to me back in ~2017 because I had no idea what I was adding to my plugin.

Like I said - it's not from any plugin. This can happen in default CS as well, but of course you can't go over 255 health that way.

https://github.com/ValveSoftware/halflife/issues/2203

CrazY. 08-15-2019 11:15

Re: Bug base builder
 
That's not a bug with any plugin, CS can't show over 255 health. In order to fix that you need to hook the health message and clamp the health value:

Code:
register_message(get_user_msgid("Health"), "message_health")

Code:
// Fix for the HL engine bug when HP is multiples of 256 public message_health(msg_id, msg_dest, msg_entity) {     // Get player's health     new health = get_msg_arg_int(1)         // Don't bother     if (health < 256) return;         // Check if we need to fix it     if (health % 256 == 0)         set_user_health(msg_entity, get_user_health(msg_entity) + 1)         // HUD can only show as much as 255 hp     set_msg_arg_int(1, get_msg_argtype(1), 255) }


All times are GMT -4. The time now is 17:29.

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