Raised This Month: $ Target: $400
 0% 

solid_bsp without movetype_push


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 07-14-2013 , 06:37   solid_bsp without movetype_push
Reply With Quote #1

When I type /give_helmet, the CS crash and showed windows dialog "Solid_BSP Without Movetype_Push". What's wrong?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <fakemeta_stocks>

#define PLUGIN    "Helmet Protection"
#define VERSION    "1.0"
#define AUTHOR    "DavidJr"

new bool:g_have_helmet[33]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /helmet""give_helmet")
    
register_concmd("helmet""give_helmet")    
    
RegisterHam(Ham_TraceAttack"player""fw_trace")
}
public 
plugin_precache()
{    
    
precache_model("models/cspb/headgear.mdl")
}
public 
fw_trace(victimidFloat:damageFloat:dir[3], ptrbits
{
    new 
victim read_data(2)
    if (
get_user_attacker(id) == victim  && is_user_connected(id) && is_user_alive(id))
    {
        if (
get_tr2(ptrTR_iHitgroup) == HIT_HEAD//be attacked on head, drop the helmet
        

            
client_cmd(id"spk cspb/helmet_hit.wav")
            
client_cmd(victim"spk cspb/helmet_protection.wav")
            
client_print(victimprint_chat"Helmet Protection!")
            
g_have_helmet[id] = false
            drop_helmet
(id)
        }
    }
    return 
HAM_IGNORED 
}
public 
give_helmet(idimodelnumtargeter//set helmet on head
{
    if (
g_have_helmet[id] == false)
    {
        
set_pev(g_have_helmet[id], pev_movetypeMOVETYPE_FOLLOW)
        
set_pev(g_have_helmet[id], pev_aimentid)
        
set_pev(g_have_helmet[id], pev_rendermodekRenderNormal)
        
engfunc(EngFunc_SetModelg_have_helmet[id], "models/cspb/headgear.mdl")
        
client_print(idprint_chat"You got a helmet.")
    }
    return 
true
}
public 
drop_helmet(id//drop helmet on ground
{
    if (
g_have_helmet[id] == true)
    {
        
set_pev(g_have_helmet[id], pev_movetypeMOVETYPE_NONE)
        
set_pev(g_have_helmet[id], pev_aimentid)
        
set_pev(g_have_helmet[id], pev_rendermodekRenderNormal)
        
engfunc(EngFunc_SetModelg_have_helmet[id], "models/cspb/headgear.mdl")
    }
    return 
false

Randomize is offline
 



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 06:20.


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