Need help?
Create a topic in the appropriate section
Don't write everything in the chat!Take a look at the marketplace
There you can buy
everything related to game serversDon't want a ban?
Please read our rules
Don't disturb the order!Sell or buy?
Use services of the guarantor
We will make your deal safe



- 0
-
Similar Content
-
By fedotovyasha
в messages есть такая возможность
<messages> <!-- This is example message for automatic server termination --> <message> <!-- no delay --> <delay>0</delay> <!-- if the value is larger than 0, then flag Repeat is enabled --> <repeat>0</repeat> <!-- if the value is larger than 0, then flag Countdown is enabled, countdown reaches zero in 10 hours --> <deadline>600</deadline> <!-- disable On connect flag --> <onConnect>0</onConnect> <!-- enable Shutdown flag --> <shutdown>1</shutdown> <!-- message itself with placeholders --> <text>Hello, #name will shutdown in #tmin minutes.</text> </message> </messages> Что лучше и эффективнее будет. Писать свой рестартер с помощью Rcon или будет достаточно messages.xml?
-
By BorizzK
Есть класс
class LogClass { private FileHandle File; void LogClass() { Print("::: [LogClass] ::: Init :::"); } void ~LogClass() { Print("::: [LogClass] ::: UnInit :::"); } void Save(string FileName, string String) { private int year, month, day, hour, minute, second; Print("::: [LogClass]: Save: " + FileName); if (!FileExist(FileName)) { File = OpenFile(FileName,FileMode.WRITE); } else { File = OpenFile(FileName, FileMode.APPEND); } if ( File == 0 ) { Print("::: [LogClass]: Can not write FileName: " + FileName); Print("::: [LogClass]: May be disk error, file write protected, file busy or FileMode.WRITE disabled (need to specify option -scrAllowFileWrite in server run parameters for enable FileMode.WRITE."); return; } FPrintln(File, DataBase_GetDate() + "," + DataBase_GetTime() + " : " + String); CloseFile(File); } void Rotate(string FileName, int FileNum) { Print("::: [LogClass]: Rotate: " + FileName); if (!FileExist(FileName)) { Print("::: [LogClass]: Rotate: FileName not exists: " + FileName); return; } else { for ( int i = FileNum; i > 0; i-- ) { Print("::: [LogClass]: Rotate: FileName: " + FileName + "." + i); if (FileExist(FileName + "." + i)) { Print("::: [LogClass]: Rotate: DeleteFile: " + FileName + "." + i); DeleteFile(FileName + "." + i); } if (FileExist(FileName + "." + (i - 1))) { Print("::: [LogClass]: Rotate: CopyFile: " + FileName + "." + (i - 1) + " => " + FileName + "." + i); CopyFile(FileName + "." + (i - 1), FileName + "." + i); } } CopyFile(FileName, FileName + ".0"); DeleteFile(FileName); } } static string DataBase_GetDate() { int year, month, day; GetYearMonthDay(year, month, day); string date = day.ToStringLen(2) + "." + month.ToStringLen(2) + "." + year.ToStringLen(2); return date; } static string DataBase_GetTime() { int hour, minute, second; GetHourMinuteSecond(hour, minute, second); string time = hour.ToStringLen(2) + ":" + minute.ToStringLen(2) + ":" + second.ToStringLen(2); return time; } } Мне нужно им пользоваться функциями из него в нескольких местах
в PlayerBase.c в функциях в классе PlayerBase
в init.c в функция в классе миссии
Вопрос как?
В PlayerBase.c
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\_MOD\\LogClass\\LogClass.c"
Далее в классе
ref LogClass Log = new LogClass();
ну и в функциях
Log.Save{"путь-имя", данные);
Но после последнего обновления 0.63.149.525
В init.c
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\_MOD\\LogClass\\LogClass.c"
приводит к ошибке - Multiple declaration of class "LogClass"
Can't compile mission init script'!
$CurrentDir://mpmissions//dayzOffline.chernarusplus//_MOD//LogClass//LogClass.c(1): Multiple declaration of class 'LogClass'
До этого обновления все было норм
Как быть?
-
By BorizzK
Что такое массивы и тп я в целом знаю, но поскольку на c++ и подобном никогда не писал (только в Дейзе столкнулся), то есть некоторое непонимание некоторых принципов работы с массивами в данном случае
Продположим
обявили массив внутри функции
array<string> stringParam;
// определяем массив текстового типа который живет до завершения работы функции
или
static array<string> stringParam;
// определяем массив текстового типа который сохраняет в себе данные и после завершения работы функции и при следующем
вызове функции содержимое массива останется и может быть использовано внутри функции (повторного обьявления массива не произойдет)
string text = "text";
//записываем содержимое переменной text в элемент массива 0
stringParam.Insert(text);
//записываем содержимое переменной text в элемент массива 1, если переменная text пуста в элемент запишется текст NULL
stringParam.Insert(text, "NULL");
читаем в переменную text элемент массива 1
string text = stringParam.Get(1);
А вот теперь вопрос
Как мне изменить эелемент 1 массива?
stringParam[1] = "блаблабла";
так?
в теории должно быть так
Это вообще возможно?
И еще про функцию возвращающую результат в качестве массива
array<string> FileRead(string FileName)
{
array<string> stringParam;
string line_content;
.....
CloseFile(File);
return stringParam;
}
Все верно?
-
-
Our picks
Кто подскажет где в DAYZ EPOCH 1 0 4 2а включается функция выбор персанажа муж - жен
Edited by DIMA (see edit history)Share this post
Link to post
Share on other sites