Library - Sentry Gun
1 Attachment(s)
Hello everyone ! I'm using Diablix library of Cannon that is being controlled by person!
It is a little bugged[Maybe more than little] , but the author isn't interested anymore in this project[Or maybe he don't know how to fix this :>] PHP Code:
Allowing You to shoot each one second [Working only with 1.0 value , 0.9 value is giving crazy effect [Totally fast shoot] So the problems are : 1 # PHP Code:
[But still annoying] 2 # Even after You die - While You are still pressing Left Mouse Button , the cannon is shooting ;D 3 # Even If Your Cannon is destroyed. On next round in the place where the cannon was, You can press E and attack like with cannon[But Cannon was destroyed] Ehh don't know If my description of this problem is normal. I wanted to say. a) Your Cannon is destroyed b) In the place where it standed, You still can press E and attack with cannon ;d 4 # The cannon is not deleted after round end. If someone could fix this, it could be really usefull for a lot of servers! It is library so implementing this in any plugin is 30sec of work. I'm uploading sma below. The sma on top of this topic is just test plugin. Can't upload the INC files so I'm adding it here PHP Code:
native diablix_create_cannon(id, const iHp, const iDamage, const Float:fCooldown=0.4); |
Re: Library - Sentry Gun
Assuming that you know how to edit the plugin yourself:
Note: The spawn function is hooked by the usage of ResetHud, note that this is not the correct way to see if a player has spawned. Use Ham_Spawn with "player" classname. |
Re: Library - Sentry Gun
Hehe You are forcing me to do a hard work :)
I will try to fix it myself. Thanks a lot for tips bro. |
Re: Library - Sentry Gun
Yeah, well, this is scripting help. I gave you tips on how to fix it. You should at least try fixing it yourself, that'll only improve your AMXX-scripting skills. :wink:
However, if you don't manage to fix it by yourself, I can help you further. |
Re: Library - Sentry Gun
Alright.
Where should I disable/enable the Ham? new HamHook: ClassThink // On top ClassThink = RegisterHam(Ham_Think,g_sClassName,"think_Dzi alko"); //in natives DisableHamForward(ClassThink) // 308 line Where should I enable this? |
Re: Library - Sentry Gun
I realized you cannot unregister ham hooks (mixed them with fakemeta hooks). You can use Enable|DisableHamHook to Enable|Disable it.
There is a problem though. The reason you're getting the invalid classname error is that Hamsandwich cannot hook custom classname entities. You'll have to replace the Ham_Think with either fakemeta (hook FM_Think) or engine (register_think). So disregard from #1 that I told you, it's incorrect. |
Re: Library - Sentry Gun
omg .
Trying this now . I will update this post with SMA when I'm done , so someone will check it :) PHP Code:
|
Re: Library - Sentry Gun
Quote:
Code:
If you plan on spawning several sentrys, unregistering the think would result in the other sentrys not working. So again, disregard from what I said about disabling the hook, just hook the think with fakemeta as following: Code:
And you're good to go. Won't throw an error. |
Re: Library - Sentry Gun
Alright I understand a little about registering/unregistering forwards/ham ;p
The problem is that this doesn't want to compile ;/ PHP Code:
|
Re: Library - Sentry Gun
Quote:
Using FM_Think: Code:
whereas using register_think (engine) would not: Code:
I'd suggest you to use register_think. |
| All times are GMT -4. The time now is 14:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.