Raised This Month: $ Target: $400
 0% 

Few sp files in one plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pawemol12
Member
Join Date: Jun 2012
Location: Poland - Wojnowice
Old 08-17-2012 , 15:11   Few sp files in one plugin
Reply With Quote #1

Hi ,

as always i have very important question. Can i create plugin which will have few sp files? For example, can i do something like this:

in main sp file:

Code:
#include "ponk.sp"
#include "dona.sp"
And now i can uses their functions and variables?

If yes, please call me what type of function i can use. Maybe stock, and public?

And please tell me about variables.

Thx
Pawemol12 is offline
-Absolute-
Member
Join Date: Mar 2010
Old 08-17-2012 , 16:36   Re: Few sp files in one plugin
Reply With Quote #2

you can use any functions, imagine #include as inserting the code of the mentioned source file here.
-Absolute- is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 08-17-2012 , 17:04   Re: Few sp files in one plugin
Reply With Quote #3

As long as your functions are not static, you can call them from other file if you have correct includes.
__________________

Last edited by FaTony; 08-17-2012 at 17:05.
FaTony is offline
Pawemol12
Member
Join Date: Jun 2012
Location: Poland - Wojnowice
Old 08-17-2012 , 17:13   Re: Few sp files in one plugin
Reply With Quote #4

A variable? It can not only retrieve static?

A compilation will not be any problems?

Last edited by Pawemol12; 08-17-2012 at 17:16.
Pawemol12 is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 08-17-2012 , 17:26   Re: Few sp files in one plugin
Reply With Quote #5

PHP Code:
//file a.inc

new MyVar1;
static 
MyVar2;

MyFunction1()
{
}

static 
MyFunction2()
{

PHP Code:
//file b.sp
#include "a.inc"

public OnPluginStart()
{
    
MyVar1 0//OK
    
MyVar2 1//error
    
MyFunction1(); //OK
    
MyFunction2(); //error

__________________
FaTony is offline
Pawemol12
Member
Join Date: Jun 2012
Location: Poland - Wojnowice
Old 08-17-2012 , 17:38   Re: Few sp files in one plugin
Reply With Quote #6

@Up

Thx now i know what i should do.
Pawemol12 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 09:56.


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