![]() |
The use of global variables
Is there a way to use the same variable in the host-mission and submission without using a .txt-file(for save variables)?
For example: In host mission script I have count of planes Code:
int countPlanes = 5; Code:
int countPlanes -= 1; Now I now about this variant - http://www.sukhoi.ru/forum/showthrea...=1#post1766444 There are other alternatives a more simple than this? Maybe new class on dll help on it? |
Yes a Singleton Pattern in a DLL.
http://en.wikipedia.org/wiki/Singleton_pattern Example Singleton (threadsafe) Code:
public sealed class Singleton Code:
//$reference parts/core/MyDll.dll |
Quote:
|
Great, it's work. :)
|
1 Attachment(s)
My dll-file:
Code:
using System; Code:
//$reference "parts\core\smp.dll" other stat. have error Second stat. element in smpSendMSG.MessageToAll - no error. I have error on VS, but script work fine in game. |
No problem by me, do you use a static class with name stat?
if you rename "stat" (singleton) the problem also exist? |
Quote:
|
All times are GMT. The time now is 12:52 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.