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(id, get_pcvar_num(thpstart));
else if(get_user_team(id) == 2) // CT have 100 HP
set_user_health(id, get_pcvar_num(cthpstart));
}
}
__________________