AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Increasing Health (https://forums.alliedmods.net/showthread.php?t=299886)

RAW_192 07-29-2017 03:26

Increasing Health
 
How can we increase the health shown on screen from 255?

I have set an option to increase health till 500 but it just shows 255 on screen...

PurposeLessx 07-29-2017 03:45

Re: Increasing Health
 
You can use it.
I didn't use #include <dhudmessage>.
It's working very well.

PHP Code:

#include <amxmodx>

public plugin_init() {
    
register_plugin("Health Armor""1.0""PurposeLess")

    
register_event("ResetHUD""Event_ResetHUD""b")
    
register_message(get_user_msgid("HideWeapon"), "Message_HideWeapon")
}

public 
client_putinserver(id)
{
    
set_task(0.1"purposeless"id 1907""0"b")
}

public 
purposeless(TaskId)
{
    new 
id TaskId 1907
    
if(!is_user_alive(id) || !is_user_connected(id))
        return

    static 
purpo[64]
    
formatex(purpocharsmax(purpo), "HP:  %i       |       ARMOR:  %d"get_user_health(id), get_user_armor(id))
    
message_begin(MSG_ONE_UNRELIABLESVC_DIRECTOR_id); {
        
write_byte(strlen(purpo) + 31)
        
write_byte(DRC_CMD_MESSAGE)
        
write_byte(0)
        
write_long(((clamp(650255)) + ((clamp(1570255)) << 8) + ((clamp(2160255)) << 16)))
        
write_long(_:0.01)
        
write_long(_:0.95)
        
write_long(_:0.1)
        
write_long(_:0.1)
        
write_long(_:0.0)
        
write_long(_:0.0)
        
write_string(purpo)
    }
    
message_end()
}

public 
Event_ResetHUD(id)
{
    
message_begin(MSG_ONEget_user_msgid("HideWeapon"), _id)
    
write_byte((1<<3) | (1<<5))
    
message_end()
}

public 
Message_HideWeapon()
{
    
set_msg_arg_int(1ARG_BYTEget_msg_arg_int(1) | (1<<3) | (1<<5))



HamletEagle 07-29-2017 04:42

Re: Increasing Health
 
The default health hud limit can't be increased

RAW_192 07-29-2017 05:15

Re: Increasing Health
 
Quote:

Originally Posted by PurposeLessx (Post 2538479)
You can use it.
I didn't use #include <dhudmessage>.
It's working very well.

PHP Code:

#include <amxmodx>

public plugin_init() {
    
register_plugin("Health Armor""1.0""PurposeLess")

    
register_event("ResetHUD""Event_ResetHUD""b")
    
register_message(get_user_msgid("HideWeapon"), "Message_HideWeapon")
}

public 
client_putinserver(id)
{
    
set_task(0.1"purposeless"id 1907""0"b")
}

public 
purposeless(TaskId)
{
    new 
id TaskId 1907
    
if(!is_user_alive(id) || !is_user_connected(id))
        return

    static 
purpo[64]
    
formatex(purpocharsmax(purpo), "HP:  %i       |       ARMOR:  %d"get_user_health(id), get_user_armor(id))
    
message_begin(MSG_ONE_UNRELIABLESVC_DIRECTOR_id); {
        
write_byte(strlen(purpo) + 31)
        
write_byte(DRC_CMD_MESSAGE)
        
write_byte(0)
        
write_long(((clamp(650255)) + ((clamp(1570255)) << 8) + ((clamp(2160255)) << 16)))
        
write_long(_:0.01)
        
write_long(_:0.95)
        
write_long(_:0.1)
        
write_long(_:0.1)
        
write_long(_:0.0)
        
write_long(_:0.0)
        
write_string(purpo)
    }
    
message_end()
}

public 
Event_ResetHUD(id)
{
    
message_begin(MSG_ONEget_user_msgid("HideWeapon"), _id)
    
write_byte((1<<3) | (1<<5))
    
message_end()
}

public 
Message_HideWeapon()
{
    
set_msg_arg_int(1ARG_BYTEget_msg_arg_int(1) | (1<<3) | (1<<5))




Working Great Thanks

RAW_192 07-30-2017 04:16

Re: Increasing Health
 
Quote:

Originally Posted by PurposeLessx (Post 2538479)
You can use it.
I didn't use #include <dhudmessage>.
It's working very well.

PHP Code:

#include <amxmodx>

public plugin_init() {
    
register_plugin("Health Armor""1.0""PurposeLess")

    
register_event("ResetHUD""Event_ResetHUD""b")
    
register_message(get_user_msgid("HideWeapon"), "Message_HideWeapon")
}

public 
client_putinserver(id)
{
    
set_task(0.1"purposeless"id 1907""0"b")
}

public 
purposeless(TaskId)
{
    new 
id TaskId 1907
    
if(!is_user_alive(id) || !is_user_connected(id))
        return

    static 
purpo[64]
    
formatex(purpocharsmax(purpo), "HP:  %i       |       ARMOR:  %d"get_user_health(id), get_user_armor(id))
    
message_begin(MSG_ONE_UNRELIABLESVC_DIRECTOR_id); {
        
write_byte(strlen(purpo) + 31)
        
write_byte(DRC_CMD_MESSAGE)
        
write_byte(0)
        
write_long(((clamp(650255)) + ((clamp(1570255)) << 8) + ((clamp(2160255)) << 16)))
        
write_long(_:0.01)
        
write_long(_:0.95)
        
write_long(_:0.1)
        
write_long(_:0.1)
        
write_long(_:0.0)
        
write_long(_:0.0)
        
write_string(purpo)
    }
    
message_end()
}

public 
Event_ResetHUD(id)
{
    
message_begin(MSG_ONEget_user_msgid("HideWeapon"), _id)
    
write_byte((1<<3) | (1<<5))
    
message_end()
}

public 
Message_HideWeapon()
{
    
set_msg_arg_int(1ARG_BYTEget_msg_arg_int(1) | (1<<3) | (1<<5))



It hides the Radar Map .. Any suggestions on how to get it back?

simanovich 07-30-2017 08:33

Re: Increasing Health
 
Quote:

Originally Posted by RAW_192 (Post 2538651)
It hides the Radar Map .. Any suggestions on how to get it back?

Not possible

RAW_192 07-30-2017 12:06

Re: Increasing Health
 
So it means we can either hide radar , user money and get that health limit to increase or keep the limit and everything right ?

HamletEagle 07-30-2017 16:33

Re: Increasing Health
 
The limit is always there, the plugin is just showing a custom hud message.

RAW_192 07-31-2017 01:40

Re: Increasing Health
 
Ok Thanks Hamlet

Yeah i know it displays a custom HUD

PurposeLessx 08-01-2017 07:41

Re: Increasing Health
 
Actually we can not hide just health without armor and radar.
But you can draw money.

If you want the money to be shown, do it.

PHP Code:

write_byte((1<<3) | (1<<5)) 

Change
PHP Code:

write_byte((1<<3)) 


PHP Code:

set_msg_arg_int(1ARG_BYTEget_msg_arg_int(1) | (1<<3) | (1<<5)) 

Change
PHP Code:

set_msg_arg_int(1ARG_BYTEget_msg_arg_int(1) | (1<<3)) 



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

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