This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "Bz loadPlugin"

From BZFlagWiki
Jump to: navigation, search
(New page: {{BZFS_API_Doc}}{{BZFS_API_Funcs}} ==Syntax== bool bz_loadPlugin( const char* path, const char* params ) ==Parameters== * '''''path''''': The path to the plug-in to load. * '''''params''...)
 
m (Don't know for sure.)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{BZFS_API_Doc}}{{BZFS_API_Funcs}}
+
{{apicall
==Syntax==
+
| name          = bz_loadPlugin
bool bz_loadPlugin( const char* path, const char* params )
+
| returns      = Whether or not the plugin was loaded successfully.
 +
| returntype    = bool
 +
| description  = Attempts to load a plugin with the given path and filename along with any passed parameters.
 +
| param1      = path
 +
| param1type  = const char*
 +
| param1desc  = The exact path to the file.
 +
| param2      = params
 +
| param2type  = const char*
 +
| param2desc  = The command separated list of file parameters to pass on to the plugin.
 +
}}
  
==Parameters==
+
===Example===
* '''''path''''': The path to the plug-in to load.
+
Attempt to load the '''FlagOnSpawn''' plugin with the parameters to give any team a WG flag on spawn when the game starts.
 
+
case bz_eWorldFinalized: {
* '''''params''''': The parameters to pass to the plug-in.
+
bz_loadPlugin("/home/name/path/to/flagOnSpawn.so","WG:-1");
 
+
}break;
==Returns==
+
True upon success, false otherwise..
+
 
+
==Description==
+
This API function attempts to load a plug-in.
+
 
+
==See Also==
+
[[bz_getLoadedPlugins]], [[bz_unloadPlugin]], [[bz_registerCustomPluginHandler]], [[bz_removeCustomPluginHandler]]
+

Latest revision as of 10:32, 19 October 2011

bool bz_loadPlugin (const char* path, const char* params)


Attempts to load a plugin with the given path and filename along with any passed parameters.

Parameters:
path  -  The exact path to the file.
params  -  The command separated list of file parameters to pass on to the plugin.
Returns:
Whether or not the plugin was loaded successfully.


Example[edit]

Attempt to load the FlagOnSpawn plugin with the parameters to give any team a WG flag on spawn when the game starts.

case bz_eWorldFinalized: {
	bz_loadPlugin("/home/name/path/to/flagOnSpawn.so","WG:-1");
}break;