Replacing Holster and Deploy
3 Attachment(s)
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? |
Re: Replacing Holster and Deploy
Error: attachment not found.
|
Re: Replacing Holster and Deploy
Ham doesn't crash because of too many RegiserHam calls and CurWeapon sucks. Fix your installation instead of searching for pointless workarounds.
|
Re: Replacing Holster and Deploy
Quote:
Quote:
|
Re: Replacing Holster and Deploy
PHP Code:
|
Re: Replacing Holster and Deploy
Maybe you could test my plugin please? :/
Just put that cycle from plugin_precache to plugin_init. Start server, join, change map = crash. |
Re: Replacing Holster and Deploy
It doesn't crash, and there's no reason it ever should. I have been running multiple plugins with similar or even more Ham usage for years, without any issues.
|
Re: Replacing Holster and Deploy
Did you really test it?
EDIT: Just tested myself, it crashes. |
Re: Replacing Holster and Deploy
Yes I tested it. And I put a 0 to 100 for loop around it just to be sure.
|
Re: Replacing Holster and Deploy
1 Attachment(s)
Well, that is just weird, cause I just installed new amxmodx, put default plugins and this one, and it still crashes.
Linux OS, newest HLDS, newest AMXX, Metamod v1.21p37. Here is the crashing version. Hmm, it seems that this crash happens when player decides to join. Start server, player joins = works fines. Server changes map, player joins = crash. When I put it in plugin_precache - it works fine. |
| All times are GMT -4. The time now is 17:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.