AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Correct way you use a common functions script (https://forums.alliedmods.net/showthread.php?t=319294)

SpartanK 10-23-2019 09:49

Correct way you use a common functions script
 
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.

Fyren 10-26-2019 13:39

Re: Correct way you use a common functions script
 
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)

SpartanK 10-28-2019 13:52

Re: Correct way you use a common functions script
 
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"


All times are GMT -4. The time now is 00:09.

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