10.12.2015, 18:09
I'm using 1.2.
I do have a theory though.
I noticed that the method is called from different amx handles. And that kind of makes sense, I do register that method to all of them(with AmxLoadEvent). But, I only used CallShoebillFunction in one of my Pawn scripts.
I may have an answer. This code is from SampEventDispatcher class:
I don't really know C++, but I believe that that method is called from the plugin(not directly it seems).
So this code doesn't care WHERE did the CallShoebillFunction call came from, it simply calls it on every amx instance that registered that function.
My suggested sollution is passing the origin(amx handle) of the script that CallShoebillFunction was called(assuming that possible).
I do have a theory though.
I noticed that the method is called from different amx handles. And that kind of makes sense, I do register that method to all of them(with AmxLoadEvent). But, I only used CallShoebillFunction in one of my Pawn scripts.
I may have an answer. This code is from SampEventDispatcher class:
Код:
@Override public int onRegisteredFunctionCall(String name, Object[] parameters) { try { int returnValue = 0; for(AmxInstance instance : AmxInstanceManager.get().getAmxInstances()) { if(instance.hasRegisteredFunction(name)) { returnValue = instance.callRegisteredFunction(name, parameters); } } return returnValue; } catch (Throwable e) { e.printStackTrace(); return 0; } }
So this code doesn't care WHERE did the CallShoebillFunction call came from, it simply calls it on every amx instance that registered that function.
My suggested sollution is passing the origin(amx handle) of the script that CallShoebillFunction was called(assuming that possible).