Thread: [Solved] Spawn with 25 HP
View Single Post
lexzor
Veteran Member
Join Date: Nov 2020
Old 04-10-2023 , 13:46   Re: Spawn with 25 HP
Reply With Quote #2

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))
    }


Last edited by lexzor; 04-10-2023 at 13:47.
lexzor is offline