Raised This Month: $ Target: $400
 0% 

Help a newb with bad code?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
iheartshrooms
Junior Member
Join Date: Mar 2007
Location: wa
Old 07-13-2008 , 22:19   Help a newb with bad code?
Reply With Quote #1

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) == && 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(3639192, -1.00.906.04.00.10.24)
            
show_hudmessage(killer,"+%dhp",(addition+addition))
            }

        else
            {
            
set_user_health(killer,(oldhealth+addition))
            
set_hudmessage(3639192, -1.00.906.04.00.10.24)
            
show_hudmessage(killer,"+%dhp",addition)
            }
        }
    }
   return 
PLUGIN_HANDLED


Last edited by iheartshrooms; 07-14-2008 at 00:45. Reason: thanx vet.
iheartshrooms is offline
 


Thread Tools
Display Modes

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 05:38.


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