0 Members and 1 Guest are viewing this topic.
I would like edited that you script zombie mod, you edited that script zombie mod, they let's edit only that it was possible to write he (it) included (switched) new commend on scripts and off scripts
MMDIR = 'MissionMod'; //Directory name of MissionMod goes hereprocedure setscriptstate(scriptname: string; state: boolean);var newfile, newfiletmp: string;begin newfile := readfile('scripts/' + scriptname + '/Includes.txt'); while newfiletmp <> newfile do begin newfiletmp := newfile; newfile := regexpreplace(iif(state, '\/\/([^\r\n]+)([\r\n])', '(^|[\r\n])([^\r\n/]+)([\r\n]|$)'), newfile, iif(state, '$1$2', '$1//$2$3'), true); end; writefile('scripts/' + scriptname + '/Includes.txt', newfile); command('/recompile ' + script);end;function oncommand(id: byte; text: string): boolean;begin case text of '/on mm' : setscriptstate(MMDIR, true); '/off mm' : setscriptstate(MMDIR, false); end;end;
ConstMMDIR = 'MissionMod'; //Directory name of MissionMod goes hereprocedure setscriptstate(scriptname: string; state: boolean);var newfile, newfiletmp: string;begin newfile := readfile('scripts/' + scriptname + '/Includes.txt'); while newfiletmp <> newfile do begin newfiletmp := newfile; newfile := regexpreplace(iif(state, '\/\/([^\r\n]+)([\r\n])', '(^|[\r\n])([^\r\n/]+)([\r\n]|$)'), newfile, iif(state, '$1$2', '$1//$2$3'), true); end; writefile('scripts/' + scriptname + '/Includes.txt', newfile); command('/recompile ' + scriptname);end;function oncommand(id: byte; text: string): boolean;begin case text of '/on mm' : setscriptstate(MMDIR, true); '/off mm' : setscriptstate(MMDIR, false); end;end;