Raised This Month: $ Target: $400
 0% 

Adding ammo to weapon


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-10-2011 , 17:38   Re: Adding ammo to weapon
Reply With Quote #4

Not tested.
PHP Code:
#include <engine>
#include <cstrike>

public plugin_init()
    
register_event("DeathMsg""OnDeathMsg""a");

public 
OnDeathMsg()
{
    new 
killer read_data(1);

    if (!
is_user_alive(killer))
        return;
    
    new 
weap[32] = "weapon_";
    
read_data(4weap[7], charsmax(weap[7]));
    
    if (
equal(weap"weapon_hegrenade"))
        return;
    
    new 
ent find_ent_by_owner(killer 1weapkiller);
    
    if (
ent killer)
        
cs_set_weapon_ammo(entcs_get_weapon_ammo(ent) + 1);

__________________
hleV 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 11:51.


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