|
Author
|
Message
|
|
Senior Member
Join Date: Oct 2012
Location: Bulgaria
|

05-21-2013
, 11:53
Re: References for custom ranking system?
|
#1
|
Quote:
Originally Posted by didoWEE
PHP Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich>
new g_iMaxPlayers;
public plugin_init() { g_iMaxPlayers = get_maxplayer(); RegisterHam(Ham_Weapon_PrimaryAttack, "player", "BulletFired", 0); // Bullet Fired forward RegisterHam(Ham_TakeDamage, "player", "BulletHit", 1); // Bullet Hit forward }
public BulletHit(victim, inflictor, attacker, Float:damage, damage_bit) { if(attacker && attacker <= g_iMaxPlayers) { // Bullet Hit is made (by attacker) // Add your code here } }
public BulletFired(ent) { static id; id = pev(ent, pev_owner); static iClip, iAmmo; static iWeapon; iWeapon = get_user_weapon(id, iClip, iAmmo); if(iWeapon == CSW_KNIFE) return HAM_IGNORED; if(iWeapon == CSW_HEGRENADE) return HAM_IGNORED; if(iWeapon == CSW_SMOKEGRENADE) return HAM_IGNORED; if(iWeapon == CSW_FLASHBANG) return HAM_IGNORED; if(iWeapon == CSW_C4) return HAM_IGNORED; // If this isn't working, replace iClip with iAmmo if(iClip == 0) return HAM_IGNORED; // Bullet Fire is made // Add your code here }
|
How is it now
|
|
|
|