Commit 6a9c9d5c authored by Razer's avatar Razer

Updated InitClient and InitServer examples

parent f6a23263
......@@ -233,6 +233,7 @@ Note: the \texttt{units[]~=~\{\};} is required to make the Plugin \ac{CBA} compa
\label{PluginInformations}
To define the Informations about the Plugins including its name and description you have to use the \texttt{Plugins} keyword. The required flags are \texttt{name}, \texttt{desc} for the description as well as \texttt{tag}. The \texttt{tag} will be used as prefix for defined functions. In the following example the \texttt{tag} is named \texttt{EXP} so the resulting functions will be \texttt{EXP\_fnc\_FunctionName}.
Only name and tag are required.
An example for this section is the following:
\begin{lstlisting}
class Plugins
......@@ -241,6 +242,8 @@ class Plugins
{
name = "ExamplePluginName";
desc = "An Example Plugin for the Handbook";
version = 1;
requiredPlugins[] = {"plugin1","plugin2","plugin3..."};
tag = "EXP";
};
};
......@@ -298,11 +301,46 @@ class CfgFunctions
};
};
};
\end{lstlisting}
For more examples about the definition of functions take an Plugin like the database Plugin of \ac{APMS}:
\url{https://gitlab.desolationredux.com/DesolationREDUX/Server_Files/tree/4e9228c8cf3d240fabedfdd88a7a9055f1425e6f/@DesolationServer/Addons/DesoDB}
\url{https://gitlab.desolationredux.com/DesolationREDUX/Server_Files/tree/4e9228c8cf3d240fabedfdd88a7a9055f1425e6f/@DesolationServer/Addons/DesoDB} % TODO (Update - ApmsDB)
\subsection{Server & Client Inits}
No parameters are passed into \texttt{fn_InitClient}. However, plugin load index and server command password are passed into \texttt{fn_InitServer}.
But to be able to pass the correct password into \texttt{fn_InitServer}, you need to make sure that you have set the server command password in \texttt{Config\\PluginManager.cfg} file.
An example for fn_initClient:
\begin{lstlisting}
EXP_var_value = 100;
EXP_var_array1 = [];
player setVariable ["EXP_var_variable1",true,true];
player setPosATL [0,0,0];
[] spawn EXP_fnc_handlePlayers;
_data = call EXP_fnc_getData;
[_data,player] remoteExec ["setData",2];
\end{lstlisting}
An example for fn_initServer:
\begin{lstlisting}
_id = _this select 0;
_password = _this select 1;
EXP_var_value = 100; // Server variable
EXP_var_array1 = []; // Server variable
setDate [2018, 10, 25, 10, 0];
str(_password) serverCommand "#lock";
call EXP_fnc_spawnObjects;
_group = createGroup east;
"B_RangeMaster_F" createUnit [[10,1556,0],_group];
\end{lstlisting}
\subsection{Plugin Events}
\texttt{CfgItemSpawns}
......@@ -313,7 +351,7 @@ For more examples about the definition of functions take an Plugin like the data
\subsection{Replace Buildings}
\texttt{CfgPluginReplacements}
% \url{https://gitlab.desolationredux.com/DesolationREDUX/Server_Files/tree/4e9228c8cf3d240fabedfdd88a7a9055f1425e6f/@DesolationServer/Addons/DesoDB}
% \url{https://gitlab.desolationredux.com/DesolationREDUX/Server_Files/tree/4e9228c8cf3d240fabedfdd88a7a9055f1425e6f/@DesolationServer/Addons/DesoDB} % TODO (Update - ApmsDB)
% \begin{lstlisting}
% \begin{dndtable}[cX][DmgCoral]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment