mirror of
https://github.com/Ragora/T2-ACCM.git
synced 2026-01-19 19:04:46 +00:00
59 lines
1.8 KiB
PHP
59 lines
1.8 KiB
PHP
|
|
////////////////////////////////////////////////////////////////////////////////
|
||
|
|
/// - MAP SUPPORT GAME PACKAGE - ///////////////////////////////////////////////
|
||
|
|
////////////////////////////////////////////////////////////////////////////////
|
||
|
|
/// - By Founder, ZOD and TseTse - /////////////////////////////////////////////
|
||
|
|
////////////////////////////////////////////////////////////////////////////////
|
||
|
|
/// - Version 2.0 - ////////////////////////////////////////////////////////////
|
||
|
|
////////////////////////////////////////////////////////////////////////////////
|
||
|
|
|
||
|
|
package mapGame
|
||
|
|
{
|
||
|
|
function executeMapScripts()
|
||
|
|
{
|
||
|
|
echo("<>>>>> ACTIVATING MAP SUPPORT <<<<<>");
|
||
|
|
echo("<>>>>> VERSION 2.0 <<<<<>");
|
||
|
|
%path = "missions/mapscripts/*.cs";
|
||
|
|
for(%file = findFirstFile( %path ); %file !$= ""; %file = findNextFile( %path ))
|
||
|
|
exec(%file);
|
||
|
|
|
||
|
|
$MapScriptsLoaded = 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
function getRules()
|
||
|
|
{
|
||
|
|
// returns the currently executed folder names seperated by ;
|
||
|
|
$ModPaths = getModPaths();
|
||
|
|
echo($ModPaths);
|
||
|
|
|
||
|
|
// Example Usage (string, start, numChars)
|
||
|
|
//if(getSubStr($ModPaths, 0, 6) $= "base++")
|
||
|
|
// %doSomething = false;
|
||
|
|
|
||
|
|
// $arg is the server startup option of "-mod blah" so this will return "blah"
|
||
|
|
echo($arg);
|
||
|
|
return $arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
function killMapPackage(%package)
|
||
|
|
{
|
||
|
|
deactivatePackage(%package);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
function loadMapSupport()
|
||
|
|
{
|
||
|
|
if($Host::AllowMapScript $= "" || $Host::AllowMapScript == 1)
|
||
|
|
{
|
||
|
|
$Host::AllowMapScript = 1;
|
||
|
|
if(!isActivePackage(mapSupportGame))
|
||
|
|
activatePackage(mapGame);
|
||
|
|
|
||
|
|
if(!$MapScriptsLoaded)
|
||
|
|
executeMapScripts();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
loadMapSupport();
|
||
|
|
|
||
|
|
////////////////////////////////////////////////////////////////////////////////
|