![]() |
#1
|
|||
|
|||
![]()
I need to transfer the same parts of the code, which often use in dll-file in the game. For example the code localization(to send messages) and use of global variables in the hostmission and submission scripts. One file will be used in different scripts.
For example code of my dll-file: Code:
using System; using System.IO; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using maddox.game; using maddox.game.world; using maddox.GP; using part; namespace locfiledll { public class localization : AMission { public static int locText(int number1, int number2) { int result = number1 + number2; return result; } } } Code:
//$reference "P11_folder\P11_localization.dll" using System; using System.IO; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using maddox.game; using maddox.game.world; using maddox.GP; using locfiledll; public class Mission : localization { public override void OnBattleStarted() { base.OnBattleStarted(); MissionNumberListener = -1; int xxx = localization.locText(1, 2); //SendMessageToAll("Расчет из DLL = " + xxx.ToString(), "Chat"); //LOAD MAIN MISSION MAP OBJEKTS //GamePlay.gpPostMissionLoad("missions\\SMP\\Friday on my mind\\submissions\\Map AAA\\Map AAA.mis"); } And can I use this code: [/CODE] My mission script: Code:
//$reference "P11_folder\P11_localization.dll" using System; using System.IO; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using maddox.game; using maddox.game.world; using maddox.GP; using locfiledll; public class Mission : AMission { public override void OnBattleStarted() { base.OnBattleStarted(); MissionNumberListener = -1; int xxx = localization.locText(1, 2); //SendMessageToAll("Расчет из DLL = " + xxx.ToString(), "Chat"); //LOAD MAIN MISSION MAP OBJEKTS //GamePlay.gpPostMissionLoad("missions\\SMP\\Friday on my mind\\submissions\\Map AAA\\Map AAA.mis"); } |
|
|