This is what I used.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#define PLUGIN "Spray counter"
#define VERSION "1.0"
#define AUTHOR "Santa"
new Sprays[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("23", "Cmdspray", "a", "1=112")
}
public Cmdspray()
{
new id = read_data(2)
Sprays[id]++
}