Raised This Month: $ Target: $400
 0% 

Replacing Holster and Deploy


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 10-07-2014 , 14:48   Replacing Holster and Deploy
Reply With Quote #1

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?
Attached Files
File Type: sma Get Plugin or Get Source (cs_weapons_api.sma - 586 views - 16.7 KB)
File Type: inc cs_weapons_api.inc (2.4 KB, 170 views)
File Type: inc cs_weapons_api_stocks.inc (2.9 KB, 162 views)
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness

Last edited by GuskiS; 10-07-2014 at 15:50.
GuskiS is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode