Raised This Month: $ Target: $400
 0% 

Solved Spawn with 25 HP


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 04-10-2023 , 18:20   Re: Spawn with 25 HP
Reply With Quote #3

Quote:
Originally Posted by lexzor View Post
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>

#define IsValid(%0) (0 < %0 < 33)

new g_cvar

public plugin_init()
{
    
register_plugin("Low HP""alliedmods""0.1")

    
RegisterHam(Ham_Spawn"player""fwPlayerSpawn"1)

    
g_cvar register_cvar("spawn_hp_amount""25")
}

public 
fwPlayerSpawn(id)
{
    if(
is_user_alive(id) && IsValid(id))
    {
        
set_user_health(idget_pcvar_num(g_cvar))
    }

Thanks, it works fine even in DeathMatch, but the BOTs are not affected when they respawn, they keep respawning at 100% HP
__________________
Extended Arm Weapon Skin v2.1 {16/Apr/23}
(Detect which class is and associate it with the corresponding arms)
SideWeapons v0.2 {01/Sep/22}
(New version of Back Weapons v1.87)


Last edited by SoulWeaver16; 04-10-2023 at 18:25.
SoulWeaver16 is offline
 



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 07:46.


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