PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <tfcx>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_TakeDamage, "player", "damage")
}
public damage(victim, wpn, attacker, Float:dmg, bit)
{
tfc_setweaponammo(wpn, 4)
}
The include says "Index must be weapon's entity index" but TFCX is now getting an error saying "Non-player entity # out of range" every time a hit is made by a projectile or hitscan. I've tried getting wepaon index though get_user_weapon() and no weapon index returned valid to this function. Something is broken somewhere for weapon ents returned to not actually be valid. Not sure whats going on with it