Problem with fake natives & forwards
With the below code, specifically the CreateOneForward line, I have been having some difficulty getting the forwards to actually function correctly.
Another thing I noticed is that register_plugin seems to always return 1, which according to Bail should not happen (it should return plugin id) The first section is the API, the second is the test plugin, and the third is the include file. Code:
Code:
Code:
|
It was to my understanding that CreateOneForward was to supercede callfunc for internal function calling.
So why not use CreateMultiForward for external plugins? Example |
Quote:
|
Ah I see, so you mean this is broken or not working correctly?
public fnVoteBegin(iPlugin,iParams) I looked at register_plugin and that is returning the ID fine. What you could do is the 1st parameter for the fnVoteBegin could be the pluginID that each plugin sends. Code:
Code:
|
No, because register_plugin returns 1 always on my current build.
I'm trying to get VC++ set up so I can compile 1.75 and try now, but I'd rather not use this method as I was making this API to be simple and easy to use. |
Scrap what I previously said :lol:
I see that was commited on the 14th April, 1.71 was released on the 2nd April. Just tested with that iPlugin in the prototype, that was also returning fine for me. If its still not working for you the only thing you can do is get hold of 1.75 in CVS and also delay your plugin release until this super version is out 8) Either way its not an issue for the upcoming build of AMXX 1.75 |
Quote:
I wasn't planning on releasing this, I was going to give it to Bail in the hopes he would add it to the next release (1.80 I guess?), but it's just not working out. After this is all done, I'm going to write an article in the wiki about plugin API stuff. I couldn't find any documentation on it (other than your post in Cheap_Suit's thread and Bail's example in the bug reports after it was added), and I don't want others to go through what I did just to do this simple plugin. |
You don't need to capture the ID of register_plugin at all mate.
How I did my tests was I altered my create_bot to include the prototypes, and even the calling plugin doesn't capture the id of register_plugin, its done automactically through the native system. That iPlugin, iNumParams prototypes are powerful enough to work out what plugin is calling it and with how many parameters :wink: |
Quote:
I just thought of one thing though. Instead of calling a function after flTime, maybe I could add a fake native like "vote_end" and let the plugin handle the time between? That would avoid the API issue entirely, and it also allows you to stop the vote at any time (ex. amx_cancelvote in the core) |
Its more than likely not working since it might of been added as well after AMXX 1.71 was released.
I've been using the CVS builds for ages, since FakeMeta didn't have the capability of some things that I required with 1.71 release :wink: |
| All times are GMT -4. The time now is 16:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.