This wiki was in read-only mode for many years, but can now be edited again. A lot of information will need to be updated.

Bz loadPlugin: Difference between revisions

From BZFlagWiki
Jump to navigation Jump to search
Sigonasr2 (talk | contribs)
Update to modern template. Include Example.
Sigonasr2 (talk | contribs)
m Don't know for sure.
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
| param1      = path
| param1      = path
| param1type  = const char*
| param1type  = const char*
| param1desc  = The exact path to the file. In addition, it may be locally referenced starting from the path returned by [[bz_pluginBinPath]]().
| param1desc  = The exact path to the file.
| param2      = params
| param2      = params
| param2type  = const char*
| param2type  = const char*
Line 14: Line 14:
===Example===
===Example===
Attempt to load the '''FlagOnSpawn''' plugin with the parameters to give any team a WG flag on spawn when the game starts.
Attempt to load the '''FlagOnSpawn''' plugin with the parameters to give any team a WG flag on spawn when the game starts.
  case bz_eGameStartEvent: {
  case bz_eWorldFinalized: {
  bz_loadPlugin("/home/name/path/to/flagOnSpawn.so","WG:-1");
  bz_loadPlugin("/home/name/path/to/flagOnSpawn.so","WG:-1");
  }break;
  }break;

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

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;