This is my first attempt at a plugin (and c++). It probably is all wrong, but I would like to know what I need to fix.
I want this plugin to give players a start health and extra health for kills.
When I try to compile, i get this error a whole bunch of times: "error 075: input line too long"
Any and all help will be appreciated. =]
PHP Code:
public plugin_init()
{
register_plugin("Fun Health","0.1beta","iheartshrooms")
p_enabled = register_cvar("funhealth_on","1")
p_givehealth = register_cvar("funhealth_bonus","50")
p_spawnhealth = register_cvar("funhealth_spawn","300")
register_statsfwd(XMF_DEATH)
}
public dod_client_spawn(id)
{
new spawnhp = get_pcvr_num(p_spawnhealth)
if(get_pcvar_num(p_enabled) == 1)
{
set_user_health(id,p_spawnhealth)
}
return PLUGIN_CONTINUE
}
public client_death(killer,victim,wpnindex,hitplace,TK)
{
if(get_pcvar_num(p_enabled) == 1 && is_user_connected(killer))
{
if(TK == 0)
{
new killername[32]
get_user_name(killer,killername,31)
new oldhealth = get_user_health(killer)
new addition = get_pcvar_num(p_givehealth)
if(wpnindex == DODW_GARAND_BUTT || wpnindex == DODW_K43_BUTT || wpnindex == DODW_KAR_BAYONET || wpnindex == DODW_AMERKNIFE || wpnindex == DODW_BRITKNIFE || wpnindex == DODW_GERKNIFE || wpnindex == DODW_SPADE)
{
set_user_health(killer,(oldhealth+addition+addition))
set_hudmessage(36, 39, 192, -1.0, 0.9, 0, 6.0, 4.0, 0.1, 0.2, 4)
show_hudmessage(killer,"+%dhp",(addition+addition))
}
else
{
set_user_health(killer,(oldhealth+addition))
set_hudmessage(36, 39, 192, -1.0, 0.9, 0, 6.0, 4.0, 0.1, 0.2, 4)
show_hudmessage(killer,"+%dhp",addition)
}
}
}
return PLUGIN_HANDLED
}