AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   health + armor + refill ammo on kill (CSDM) (https://forums.alliedmods.net/showthread.php?t=333999)

theuser 08-22-2021 12:54

health + armor + refill ammo on kill (CSDM)
 
hi
i need a plugin that automatically set your Health & Armor & your gun ammo to FULL right after you kill an enemy!
and Also support ffa mode

Natsheh 08-22-2021 14:31

Re: health + armor + refill ammo on kill (CSDM)
 
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <fun>

// weapons offsets
#define OFFSET_CLIPAMMO        51
#define OFFSET_LINUX_WEAPONS    4
#define fm_cs_set_weapon_ammo(%1,%2)    set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS)

const m_pActiveItem 373;

const 
NOCLIP_WPN_BS    = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))

new const 
g_MaxClipAmmo[] = 
{
    
0,
    
13//CSW_P228
    
0,
    
10//CSW_SCOUT
    
0,  //CSW_HEGRENADE
    
7,  //CSW_XM1014
    
0,  //CSW_C4
    
30,//CSW_MAC10
    
30//CSW_AUG
    
0,  //CSW_SMOKEGRENADE
    
15,//CSW_ELITE
    
20,//CSW_FIVESEVEN
    
25,//CSW_UMP45
    
30//CSW_SG550
    
35//CSW_GALIL
    
25//CSW_FAMAS
    
12,//CSW_USP
    
20,//CSW_GLOCK18
    
10//CSW_AWP
    
30,//CSW_MP5NAVY
    
100,//CSW_M249
    
8,  //CSW_M3
    
30//CSW_M4A1
    
30,//CSW_TMP
    
20//CSW_G3SG1
    
0,  //CSW_FLASHBANG
    
7,  //CSW_DEAGLE
    
30//CSW_SG552
    
30//CSW_AK47
    
0,  //CSW_KNIFE
    
50//CSW_P90
}

public 
plugin_init()
{
   
RegisterHam(Ham_Killed"player""fw_player_killed_post"1);
}

public 
fw_player_killed_post(victimattackergibs)
{
   if( 
<= attacker && attacker <= 32 && victim != attacker )
   {
      static 
iWeapon;
      if( (
iWeapon=get_user_weapon(attacker)) > && !((1<<iWeapon) & NOCLIP_WPN_BS) )
      {
          
fm_cs_set_weapon_ammoget_pdata_cbase(attackerm_pActiveItem) , g_MaxClipAmmoiWeapon ] );
      }
      
set_user_health(attacker100);
      
set_user_armor(attacker100);
   }




All times are GMT -4. The time now is 20:39.

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