AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Show damage armor (https://forums.alliedmods.net/showthread.php?t=335726)

Heisen 12-28-2021 09:11

Show damage armor
 
Hello, I have a question, can do show the damage to the armor?

PHP Code:

public event_showdamage(id) {
    new 
attacker get_user_attacker(id)
    if(
is_user_connected(id) && is_user_connected(attacker)) {
        new 
damage read_data(2)
        
set_hudmessage(127255127, -1.00.5500.01.10.00.0); 
        
show_hudmessage(attacker"%i"damage)
    } 



I want to do a display like in a fortnite, blue is armor white is health

Supremache 12-28-2021 10:21

Re: Show damage armor
 
Quote:

Originally Posted by Heisen (Post 2767125)
Hello, I have a question, can do show the damage to the armor?

PHP Code:

public event_showdamage(id) {
    new 
attacker get_user_attacker(id)
    if(
is_user_connected(id) && is_user_connected(attacker)) {
        new 
damage read_data(2)
        
set_hudmessage(127255127, -1.00.5500.01.10.00.0); 
        
show_hudmessage(attacker"%i"damage)
    } 



I want to do a display like in a fortnite, blue is armor white is health

read_data(2)
->
read_data(1)

Heisen 12-28-2021 12:31

Re: Show damage armor
 
Thank you

Shadows Adi 12-28-2021 13:46

Re: Show damage armor
 
Quote:

Originally Posted by Supremache (Post 2767130)
read_data(2)
->
get_user_armor

That is absolutely wrong.

read_data(2) is for damage taken.
read_data(1) is for damage saved by armor.

https://wiki.alliedmods.net/Half-lif..._events#Damage

bigdaddy424 12-28-2021 19:30

Re: Show damage armor
 
Quote:

Originally Posted by Supremache (Post 2767155)
No problem he just gonna use it in hud not on an important thing

You're giving bad advice.

Supremache 12-29-2021 02:38

Re: Show damage armor
 
Quote:

Originally Posted by bigdaddy424 (Post 2767167)
You're giving bad advice.

The post was edited

Natsheh 12-29-2021 08:37

Re: Show damage armor
 
If you want to modifie the damage you need to hook the player takedamage pre forward and change the damage from within the forward.


All times are GMT -4. The time now is 11:41.

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