Difficulty with plugin-strange glitches?
Code:
#include <sourcemod> This locks players in sniper, and should block damage incoming until 3 shots from the shooting star. Some issues noticed-The shooting star is spawned, but when going to the refill it drops the current one, creating another... any reason for this? Also, when I shoot someone (yes, the laser activated thing is activated unless I somehow broke that) it doesn't register as removing the damage and does the damage anyway. The plugin code clearly shows those values being reduced to 0.0. The TF2_RegeneratePlayer code should regenerate ammo and health, but does nothing of the sort, so clearly this code isn't being reached but for what reason I couldn't guess nor test to find out. It's puzzling to me... so any help or any spotted flaws in the code would be helpful. I want the gun to be at 1 ammo in clip every time you shoot it, but apparently regenerate isn't doing that. I don't want, when going to a refill station, for it to drop another rifle on the ground (I thought I had blocked the creation of another one)... any help? |
Re: Difficulty with plugin-strange glitches?
Have you checked your error logs?
|
Re: Difficulty with plugin-strange glitches?
Why are you returning plugin handled all the time?
|
Re: Difficulty with plugin-strange glitches?
Code:
#include <sourcemod> [SM] Exception reported: Entity 1 is invalid (This comes after I join) [SM] Blaming: newtestlaser.smx (This is the plugin) [SM] Call stack trace: [SM] [0] SDKHook [SM] [1] Line 25, newtestlaser.sp::OnClientConnected For some reason things that have worked in previous codes are not working now. These are the errors I receive. The error logs show me where a problem may lie, but there seems to be no reconciling the code that has worked for me for a while. I removed regeneration and such as to solve one problem at a time, and I cannot pick up ammo for the weapon. Ideally I would like the weapon to have infinite ammo, but one thing at a time. EDIT: Issue found. Apparently calling OnClientConnected is too early. PostAdminCheck works, however. As for the weapon dropping, I was told that this is simply a feature we will have to live with as valve dislikes any true ownership of a weapon. |
Re: Difficulty with plugin-strange glitches?
Quote:
You only use Plugin_Changed in an event if you've changed a value related to an event integer/string/bool/float/what-have-you. Unless I'm completely missing something here.... |
Re: Difficulty with plugin-strange glitches?
OnClientPutInServer is the forward you want to use.
|
Re: Difficulty with plugin-strange glitches?
Quote:
Iirc you can not cancel the event. You can modify it with changed, or return continue (mabye?)... Most of the time you do not even need a return, and do not need the action tag either... This is because the values are passed by refernce and the callback ignores the return type. For stuff like looping timers continue/stop make sense.. sdkhooks it makes sense to use changed/continue/handled for many callbacks. I mean, having a return just to have a return doesnt make sense if the return is ignored.. You never see return at the end of every function if the expected return value is to be ignored. Nor do you see like, return 0 and return 1 just for shits and giggles if the return values will be ignored by the function caller. Why does adding a tag suddenly change this practice? |
Re: Difficulty with plugin-strange glitches?
Quote:
|
Re: Difficulty with plugin-strange glitches?
Quote:
OnClientPostAdminCheck is fired after both OnClientPutInServer and OnClientAuthorized have fired (if not delayed further by an asynchronous admin plugin). It is possible for a player to be in-game and playing for several minutes before it is fired. |
All times are GMT -4. The time now is 22:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.