View Single Post
  #1  
Old 05-21-2012, 11:10 AM
podvoxx podvoxx is offline
Approved Member
 
Join Date: Feb 2010
Posts: 190
Default How add user dll

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;
        }
    }
}
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 : 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");       
    }
In this code I have error on game(Exception). How I can use method localization.locText()?

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");       
    }
Maybe someone has a ready example of a simple dll?
Reply With Quote