Hi all, i know if was this tutorial
http://forums.alliedmods.net/showthread.php?t=54887
Writed by VEN.
But i see in old plugin a way to detect in other way, its counting bullets in weapon of a player.
Like this:
https://forums.alliedmods.net/showthread.php?t=21342
Basically this code:
PHP Code:
#include <amxmodx>
new g_iLastWeap[33];
new g_iLastAmmo[33];
new g_iShots[33];
public plugin_init()
{
register_plugin("Fired",AMXX_VERSION_STR,"Amxx Dev Team");
register_event("CurWeapon","ev_CurWeapon","be","1=1","3>0");
}
public ev_CurWeapon(id)
{
new iWeapon = read_data(2);
new iAmmo = read_data(3);
if(!g_iLastWeap[id]) g_iLastWeap[id] = iWeapon;
if((g_iLastAmmo[id] > iAmmo) && (g_iLastWeap[id] == iWeapon)) g_iShots[id]++;
g_iLastAmmo[id] = iAmmo;
g_iLastWeap[id] = iWeapon;
client_print(id,print_chat,"* Shots: %d (Ammo remainder: %d) (Last Weapon: #%d)",g_iShots[id],g_iLastAmmo[id],g_iLastWeap[id]);
}
It is safe to used and correctly count shots fired?
EDIT: In my tests is not counting last bullet shot, Any suggestion?
Thanks.
__________________