Raised This Month: $ Target: $400
 0% 

Knife Reward


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Racoon
Senior Member
Join Date: Mar 2008
Location: Ukraine
Old 12-03-2010 , 18:21   Re: Knife Reward
Reply With Quote #8

You need to register hamsandwich, if you want to hook three knife kills only during the round.
PHP Code:
#include <amxmodx> 
#include <hamsandwich>

#define is_user_valid_connected(%1) (1 <= %1 <= 32 && g_connected[ %1 ])
new g_kills[33], g_connected[33]

public 
plugin_init() {
    
register_plugin"Bonus Molotov""version""author" )
    
register_event("DeathMsg""Event_Deathmsg""a"
           
RegisterHam(Ham_Spawn,"player","playerSpawn")
}
    
public 
Event_DeathMsg() {
    static 
attackerattacker read_data(1)
    
    if (
is_user_valid_connected(attacker) && get_user_weapon(attacker) == CSW_KNIFE)
    {
        
g_kills[attacker]++ 
        
        if (
g_kills[attacker] == 3
        {
            
g_kills[attacker] -= 
            server_cmd
("molotov_give %s"attacker)
        }
    }
}

public 
client_disconnectid ) { 
    
g_connectedid ] =false
    g_kills
id ] = 0
}

public 
client_connectid ) { 
    
g_connectedid ] = true
}

public 
playerSpawn(id) {
        
g_connectedid ] = true
    g_kills
id ] = 0

Racoon is offline
Send a message via ICQ to Racoon
 



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:23.


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