Raised This Month: $51 Target: $400
 12% 

Call_StartFunction called twice?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shortguy
Member
Join Date: Jul 2009
Old 01-04-2015 , 23:41   Call_StartFunction called twice?
Reply With Quote #1

I have some code that looks like this


Code:
if (eventFunc != INVALID_FUNCTION)
	{
		PrintToChat(client, "Function is about to be called.");
		Call_StartFunction(INVALID_HANDLE, func); 	
		Call_PushCell(client);
		Call_Finish();
	}
That calls a function with my client as a parameter, the func in the method looks like this:

Code:
public Function:myFunc(client)
{
    PrintToChat(client, "Function has been called.");
}
But for some reason, "Function is about to be called" is printed once to the chat, and "Function has been called" is being printed twice (being called twice I assume).

Anyone know what causes this/a fix?
shortguy is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 01-04-2015 , 23:50   Re: Call_StartFunction called twice?
Reply With Quote #2

Is it possible that you have two plugins (or perhaps two different versions of the same plugin, but with different filenames) loaded, each with the code from your second snippet?
__________________
ddhoward is offline
shortguy
Member
Join Date: Jul 2009
Old 01-04-2015 , 23:55   Re: Call_StartFunction called twice?
Reply With Quote #3

Holy crap, thank you so much! I have been struggling with this for the longest time. This same issue must have been causing some other bugs I was having. I would have never thought to check if there was another version.

I now know that I accidentally dragged my smx file into the include folder in FTP without noticing, causing it to be run from the root plugins folder and from plugins/include.

Thanks!
shortguy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode