Raised This Month: $51 Target: $400
 12% 

Help - Whats wrong with this code?


Post New Thread Reply   
 
Thread Tools Display Modes
recimo
Junior Member
Join Date: Aug 2011
Old 04-13-2012 , 18:42   Re: Help - Whats wrong with this code?
Reply With Quote #11

Thats it? Other is ok?
Where i should put model. In which folder? I put it in: cstrike/models/v_knife_vip/v_knife_vip.mdl
v_knife_vip - folder that i create
That should be like that?
recimo is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-13-2012 , 18:49   Re: Help - Whats wrong with this code?
Reply With Quote #12

you try to change knife model?.. to this.. use Ham_Item_Deploy
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
recimo
Junior Member
Join Date: Aug 2011
Old 04-13-2012 , 19:12   Re: Help - Whats wrong with this code?
Reply With Quote #13

Like this?
PHP Code:
#include <amxmodx> 
#include <hamsandwich> 
#include <fun>
#include <cstrike> 

new number_of_kills[33

public 
plugin_init() 

    
register_plugin("Knife VIP","1.0","recimo"
    
RegisterHam(Ham_Killed"player""Kill"1
    
register_logevent("new_round"2"1=Round_Start")
}
public 
plugin_precache()
{
    
precache_model("v_knife_vip.mdl"
}     
public 
Kill(victimkillershould_gib

    if(!
is_user_connected(killer)) 
    { 
        return 
HAM_IGNORED 
    
}
    if(
get_user_flags(killer) & ADMIN_LEVEL_H
    {
        
Ham_Item_Deploy(killer"v_knife_vip.mdl")
    }
    if(
get_user_team(killer) != get_user_team(victim)) 
    { 
        if(++
number_of_kills[killer] == 4)  
        { 
            
give_item(killer"weapon_hegrenade")
        }       
    } 
    return 
HAM_IGNORED 

public 
new_round() 

    
arrayset(number_of_kills0sizeof(number_of_kills)) 

This is probably bad. Im not sure how to put Ham_Item_Deploy.

Last edited by recimo; 04-13-2012 at 19:13.
recimo is offline
Desikac
Senior Member
Join Date: Apr 2010
Location: Serbia
Old 04-14-2012 , 17:46   bot si!
Reply With Quote #14

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

new number_of_kills[33
new const 
kModel[] = "models/v_knife_vip.mdl"
public plugin_init() 

    
register_plugin("Knife VIP","1.0","recimo"
    
RegisterHam(Ham_Killed"player""Kill"1
    
register_logevent("new_round"2"1=Round_Start")
    
register_event"CurWeapon""EventCurWeapon""be""1=1" )
}
public 
plugin_precache()
    
precache_model(kModel

public 
Kill(victimkillershould_gib

    if(!
is_user_connected(killer)) 
    { 
        return 
HAM_IGNORED 
    
}
    if(
get_user_team(killer) != get_user_team(victim)) 
    { 
        if(++
number_of_kills[killer] == 4)  
        { 
            
give_item(killer"weapon_hegrenade")
        }       
    } 
    return 
HAM_IGNORED 

public 
new_round() 

    
arrayset(number_of_kills0sizeof(number_of_kills)) 
}

public 
EventCurWeapon(id) {
    if(
read_data(2) != CSW_KNIFE)
        return 
PLUGIN_CONTINUE
            
    set_pev
(id,pev_viewmodel2,kModel)
    return 
PLUGIN_CONTINUE


Last edited by Desikac; 04-14-2012 at 17:46.
Desikac is offline
Send a message via MSN to Desikac Send a message via Skype™ to Desikac
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-14-2012 , 17:47   Re: bot si!
Reply With Quote #15

Quote:
Originally Posted by Desikac View Post
PHP Code:
#include <amxmodx> 
#include <hamsandwich> 
#include <fun>
#include <fakemeta>

new number_of_kills[33
new const 
kModel[] = "models/v_knife_vip.mdl"
public plugin_init() 

    
register_plugin("Knife VIP","1.0","recimo"
    
RegisterHam(Ham_Killed"player""Kill"1
    
register_logevent("new_round"2"1=Round_Start")
    
register_event"CurWeapon""EventCurWeapon""be""1=1" )
}
public 
plugin_precache()
    
precache_model(kModel

public 
Kill(victimkillershould_gib

    if(!
is_user_connected(killer)) 
    { 
        return 
HAM_IGNORED 
    
}
    if(
get_user_team(killer) != get_user_team(victim)) 
    { 
        if(++
number_of_kills[killer] == 4)  
        { 
            
give_item(killer"weapon_hegrenade")
        }       
    } 
    return 
HAM_IGNORED 

public 
new_round() 

    
arrayset(number_of_kills0sizeof(number_of_kills)) 
}

public 
EventCurWeapon(id) {
    if(
read_data(2) != CSW_KNIFE)
        return 
PLUGIN_CONTINUE
            
    set_pev
(id,pev_viewmodel2,kModel)
    return 
PLUGIN_CONTINUE

use item_deploy
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
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 11:14.


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