Raised This Month: $ Target: $400
 0% 

set hp plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
slpknt
Senior Member
Join Date: Dec 2007
Location: Russia
Old 01-06-2019 , 11:35   set hp plugin
Reply With Quote #1

hello, guys! I'm looking for a cs1.6 (or csgo) plugin that can set players' start hp, for example:
player1 100 hp
player2 500 hp

or:
ct 100 hp
t 500 hp

is there a plugin for this?

PS: I need this to play vs my newbie friend, cs1.6 or csgo both ok.
__________________
play hard go pr0
dmg / slipknot!

Last edited by slpknt; 01-06-2019 at 11:37.
slpknt is offline
Send a message via ICQ to slpknt
X3.
Junior Member
Join Date: Sep 2018
Old 01-06-2019 , 12:10   Re: set hp plugin
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>

public plugin_init()
{
    
register_plugin("Give health on spawn","0.1","X3")
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)  
}

public 
fwHamPlayerSpawnPost(id)
{
    if(
is_user_alive(id))
    {
        if(
get_user_team(id) == 1// Terr have 500 HP
            
set_user_health(id,500)
        else if(
get_user_team(id) == 2// CT have 100 HP
            
set_user_health(id,100
    }


Last edited by X3.; 01-06-2019 at 12:11.
X3. is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-06-2019 , 14:55   Re: set hp plugin
Reply With Quote #3

better to add cvars, dont you think?
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>

new thpstart;
new 
cthpstart;

public 
plugin_init()
{
    
register_plugin("Give health on spawn","0.1","X3")
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)  
    
    
thpstart register_cvar "t_hp_start" "100" );
    
cthpstart register_cvar "ct_hp_start" "500" );
    
}

public 
fwHamPlayerSpawnPost(id)
{
    if(
is_user_alive(id))
    {
        if(
get_user_team(id) == 1// Terr have 500 HP
            
set_user_health(idget_pcvar_num(thpstart));
        else if(
get_user_team(id) == 2// CT have 100 HP
            
set_user_health(idget_pcvar_num(cthpstart));
    }

__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Reply



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 01:51.


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