I have made this API (look in attachment). What it basicly does is gives user weapon(lol), if it is normal, then it just checks that weapons ammo on Holster(removes from player) and on Deploy(gives back). You might ask why, it is because I wan't ammo to be weapon specific not player, so each weapon has it's own ammo count. Also, there is a way to give other features with API - models, attack speed, reload time etc.
So, where is the problem? It is with that many RegisterHam calls (I think), because when I register them in plugin_init, server crashes on map change (server starts normally, after map change = crash). So I though about adding it to plugin_precache, it fixed it a bit. Now it doesn't crash on every mapchange, but randomly and gives this crash log:
https://forums.alliedmods.net/showpo...31&postcount=6
So my question is, what to change, so there won't be so many RegisterHam? Can I determine in CurWeapon event if it was holstered or deployed?