SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 08/04/2009, 02:15 AM   #1
Nubotron
Big Clucker
 
Join Date: Jan 2008
Posts: 156
Reputation: 0
Default How to call/share functions between plugins?

Hi,

I want to call function of a plugin, inside another plugin. Is possible? If yes, can you describe how do, and there is plugin order for loading in samp server?

Thanks
Nubotron is offline   Reply With Quote
Old 08/04/2009, 02:51 AM   #2
ICECOLDKILLAK8
High-roller
 
Join Date: Aug 2008
Posts: 1,154
Reputation: 5
Default Re: How to call/share functions between plugins?

I dont think its possible
__________________
IVMP
ICECOLDKILLAK8 is offline   Reply With Quote
Old 08/04/2009, 11:38 PM   #3
Nubotron
Big Clucker
 
Join Date: Jan 2008
Posts: 156
Reputation: 0
Default Re: How to call/share functions between plugins?

Well, it is possible with Pawn so i really think it is possible with C or C++ maybe. Nobody know?
Nubotron is offline   Reply With Quote
Old 09/04/2009, 07:10 AM   #4
roleplayman
Big Clucker
 
Join Date: Mar 2008
Posts: 147
Reputation: 0
Default Re: How to call/share functions between plugins?

you can do that using DLL Export/Import functions

Quote:
C Language Reference
DLL Import and Export Functions

Microsoft Specific

The most complete and up-to-date information on this topic can be found in dllexport, dllimport.

The dllimport and dllexport storage-class modifiers are Microsoft-specific extensions to the C language. These modifiers explicitly define the DLL's interface to its client (the executable file or another DLL). Declaring functions as dllexport eliminates the need for a module-definition (.DEF) file. You can also use the dllimport and dllexport modifiers with data and objects.

The dllimport and dllexport storage-class modifiers must be used with the extended attribute syntax keyword, __declspec, as shown in this example:
Code:
#define DllImport __declspec( dllimport )
#define DllExport __declspec( dllexport )

DllExport void func();
DllExport int i = 10;
DllExport int j;
DllExport int n;

DllImport Int Func();
DllImport float axi = 0.0;
Source:http://msdn.microsoft.com/en-us/libr...ae(VS.80).aspx

Tell me if it helped
roleplayman is offline   Reply With Quote
Old 09/04/2009, 12:11 PM   #5
boylett
Huge Clucker
 
Join Date: Jul 2006
Posts: 441
Reputation: 0
Default Re: How to call/share functions between plugins?

What about Linux?
boylett is offline   Reply With Quote
Old 09/04/2009, 02:29 PM   #6
ICECOLDKILLAK8
High-roller
 
Join Date: Aug 2008
Posts: 1,154
Reputation: 5
Default Re: How to call/share functions between plugins?

Or you could use the .def file, That way it would work on Linux and Windows
__________________
IVMP
ICECOLDKILLAK8 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
share the server smuf_albert95 Help Archive 6 10/01/2010 02:16 AM
share the server smuf_albert95 Help Archive 12 09/01/2010 07:33 PM
how can i share my server to others? kyle_uchiha Server Support 9 27/11/2009 05:37 AM
2 functions in a call back? >_< _Vortex Help Archive 3 12/09/2009 02:17 AM
Question about functions in plugins.... XPlatform Plugin Development 1 14/07/2009 09:27 PM


All times are GMT. The time now is 11:31 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.