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

Correct way you use a common functions script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpartanK
Junior Member
Join Date: Oct 2019
Location: Cambodia
Old 10-23-2019 , 09:49   Correct way you use a common functions script
Reply With Quote #1

Say I develop multiple plugins with different features but each of those scripts use common functions, I want to make a common / base file that all the separate plugins can access, what is the correct way to set it up?

I imagine making an uncompiled include file that is referenced by the main plugins might work.

But what if I want to use that base file to execute some code when it's loaded to store data about the game that other plugins can access? I guess an uncompiled include file won't be able to run in that way.

Perhaps I need a base plugin to run some common code when it loads that other plugins can access. And I would also need an include file containing just a bunch of functions that all the plugins could include and call functions from.
SpartanK is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 10-26-2019 , 13:39   Re: Correct way you use a common functions script
Reply With Quote #2

Quote:
Perhaps I need a base plugin to run some common code when it loads that other plugins can access. And I would also need an include file containing just a bunch of functions that all the plugins could include and call functions from.
There's documentation on how to do this here: https://wiki.alliedmods.net/Creating...eMod_Scripting)

Perhaps also check out: https://wiki.alliedmods.net/Function...eMod_Scripting)
Fyren is offline
SpartanK
Junior Member
Join Date: Oct 2019
Location: Cambodia
Old 10-28-2019 , 13:52   Re: Correct way you use a common functions script
Reply With Quote #3

Thanks for the reply, I did manage to get a common plugin working using natives and a basic include file to store common functions. - #include "include/extra.sp"
SpartanK is offline
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

Forum Jump


All times are GMT -4. The time now is 06:57.


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