How to hook on late load? [Solved]
I have done this to hook the players picking items when theres a knife round, everything is working fine except it let players get droped items, but since i did a late load of the plugin, i think thats why it's not working, because i did the hook OnClientPutInServer() that is why the plugin is not working well, but since i ussually load and unload plugins every x time, i'll like to get a way to handle it, theres the code:
PHP Code:
PHP Code:
|
Re: How to hook on late load?
You can use AskPluginLoad2
|
Re: How to hook on late load?
PHP Code:
|
Re: How to hook on late load?
Quote:
|
Re: How to hook on late load?
You dont need to close sdhooks hooks, sdkhooks do it for you when entity is destroyed/player disconnected.
|
Re: How to hook on late load?
Any entities hooked with SDKHooks in a plugin will be automatically unhooked when the plugin unloads.
|
Re: How to hook on late load?
Quote:
Quote:
PHP Code:
|
Re: How to hook on late load?
Quote:
|
Re: How to hook on late load? [Solved]
That's correct for a different reason. You don't need to unhook when a client disconnects from the server.
I'm not sure exactly why though. It's either because you can't hook something twice (which I doubt, you probably actually can and have double repeating code), or because client entities don't actually get "killed" or "removed" - at least that's my theory as I don't know - that when someone connects his control is exerted on an existing player entity that's being unused. Or maybe SM does unhook clients on disconnect, who knows. |
Re: How to hook on late load? [Solved]
I have seen many plugins hook stuff on player spawn. Now I'm wondering how long these hooks stay active. And if hooktype + entindex + callback-address is unique so that it wouldn't be hooked or called multiple times.
|
All times are GMT -4. The time now is 22:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.