diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..8156ea5
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,49 @@
+# Change Log
+All notable changes to this project will be documented in this file.
+
+
+## 01.12.2018 23:00
+
+### Fixed
+- No CustomMission is Created anymore this means Init.c File works now (Custom loadout and mods Using this file)
+- This means there should be no incompatibility with any mod now
+
+## 01.12.2018 23:00
+
+### Fixed
+- No CustomMission is Created anymore this means Init.c File works now (Custom loadout and mods Using this file)
+- This means there should be no incompatibility with any mod now
+
+## 29.11.2018 23:00
+
+### Fixed
+- If more then one admin is Online both of them can see Playerlist + Map
+- Teleport Buttons working now on PlayerTab
+
+## 28.11.2018 23:30
+
+### Fixed
+- You can open the menu even if you are not the first one logged in to server :D
+- Map shows all player and there names
+- Playerlist Working
+- Custom Loggin addet but not used much
+- Install Guide Updated
+- In your Profile Folder there is a new folder calld TomatoLogs Uplad contents to pastebin when reporting Bugs
+
+
+## 2018-11-28 0:30am
+### Hot Fix
+
+- UI opens for everyone on the server when Admin opens it
+- Link to https://github.com/Arkensor/DayZCommunityOfflineMode in used Files
+
+## 2018-11-27
+### Signed
+
+Addet bikey you should be able to use the mod without Dissableing verifySignatures now
+
+
+## 2018-11-26
+### Release
+Initial Release
+
diff --git a/DayZ-Sa-Tomato/Keys/SchnitzelPommes.bikey b/DayZ-Sa-Tomato/Keys/SchnitzelPommes.bikey
new file mode 100644
index 0000000..60e4091
Binary files /dev/null and b/DayZ-Sa-Tomato/Keys/SchnitzelPommes.bikey differ
diff --git a/DayZ-Sa-Tomato/Tomato_Profiles/Config/Config.txt b/DayZ-Sa-Tomato/Tomato_Profiles/Config/Config.txt
new file mode 100644
index 0000000..b68d131
--- /dev/null
+++ b/DayZ-Sa-Tomato/Tomato_Profiles/Config/Config.txt
@@ -0,0 +1,18 @@
+Setup = 1
+Horde_Message = 1
+Horde_Message_Location = Horde appeared near {Location}
+Welcome_Message = 0
+Welcome_Message_Join = {Player} just joined the Server
+KillFeed_LogToFile = 0
+KillFeed_Message_Suicide = 0
+KillFeed_Suicide = {Killed} took his own life
+KillFeed_Message_PlayerHand = 0
+KillFeed_ByPlayerHand = {Killed} murdered by {Killer} with his Hands
+KillFeed_Message_PlayerWeapon = 0
+KillFeed_ByPlayerWeapon = {Killed} murdered by {Killer} with Weapon {Weapon} from {Distance}m
+KillFeed_Message_Zombie = 0
+KillFeed_Zombie = {Killed} died by a zombie
+KillFeed_Message_Animal = 0
+KillFeed_Animal = {Killed} died by a Wild Animal
+KillFeed_Message_Unkown = 0
+KillFeed_Unknown = {Killed} died
diff --git a/DayZ-Sa-Tomato/Tomato_Profiles/Config/Players/DoNotDeleteThisFile.txt b/DayZ-Sa-Tomato/Tomato_Profiles/Config/Players/DoNotDeleteThisFile.txt
new file mode 100644
index 0000000..e69de29
diff --git a/DayZ-Sa-Tomato/Tomato_Profiles/Customization/Teleport_Locations.txt b/DayZ-Sa-Tomato/Tomato_Profiles/Customization/Teleport_Locations.txt
new file mode 100644
index 0000000..a302424
--- /dev/null
+++ b/DayZ-Sa-Tomato/Tomato_Profiles/Customization/Teleport_Locations.txt
@@ -0,0 +1,18 @@
+Prison Island = 2651.42 0.0 1395.8
+Mogilevka = 7572.65 0.0 5182.3
+Stary Sobor = 6192.39 0.0 7666.5
+Msta = 11206.6 0.0 5398.70
+Solnichniy = 13436.5 0.0 6158.7
+Chernogorsk = 6350.99 0.0 2666.12
+Elektrogorsk = 10432.1 0.0 2218.56
+Berezino = 12661.4 0.0 9465.03
+Tisy = 1890.45 0.0 13704.6
+Gorka = 9678.94 0.0 8828.93
+Balota = 4546.92 0.0 2416.4
+Vybor = 3916.85 0.0 8795.59
+Severograd = 8318.51 0.0 12743.4
+North West Airfield = 4835.59 0.0 9667.72
+Green Mountain = 3752.08 0.0 6002.94
+Zelenogorsk = 2542.18 0.0 4994.26
+Tisy Military Base = 1599.15 0.0 14166.66
+Pavlovo Military Base = 2047.82 0.0 3293.36
diff --git a/DayZ-Sa-Tomato/Tomato_Profiles/Log/Admin.txt b/DayZ-Sa-Tomato/Tomato_Profiles/Log/Admin.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/DayZ-Sa-Tomato/Tomato_Profiles/Log/Admin.txt
@@ -0,0 +1 @@
+
diff --git a/DayZ-Sa-Tomato/Tomato_Profiles/Log/Debug.txt b/DayZ-Sa-Tomato/Tomato_Profiles/Log/Debug.txt
new file mode 100644
index 0000000..4fe1117
--- /dev/null
+++ b/DayZ-Sa-Tomato/Tomato_Profiles/Log/Debug.txt
@@ -0,0 +1,2 @@
+
+[02.01.2019 21:21] - y
diff --git a/DayZ-Sa-Tomato/Tomato_Profiles/Log/Error.txt b/DayZ-Sa-Tomato/Tomato_Profiles/Log/Error.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/DayZ-Sa-Tomato/Tomato_Profiles/Log/Error.txt
@@ -0,0 +1 @@
+
diff --git a/DayZ-Sa-Tomato/Tomato_Profiles/Log/Info.txt b/DayZ-Sa-Tomato/Tomato_Profiles/Log/Info.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/DayZ-Sa-Tomato/Tomato_Profiles/Log/Info.txt
@@ -0,0 +1 @@
+
diff --git a/DayZ-Sa-Tomato/Tomato_Profiles/Log/Kills.txt b/DayZ-Sa-Tomato/Tomato_Profiles/Log/Kills.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/DayZ-Sa-Tomato/Tomato_Profiles/Log/Kills.txt
@@ -0,0 +1 @@
+
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato.pbo b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato.pbo
new file mode 100644
index 0000000..bac0897
Binary files /dev/null and b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato.pbo differ
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato.pbo.SchnitzelPommes.bisign b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato.pbo.SchnitzelPommes.bisign
new file mode 100644
index 0000000..227fa58
Binary files /dev/null and b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato.pbo.SchnitzelPommes.bisign differ
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/$PREFIX$ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/$PREFIX$
new file mode 100644
index 0000000..6c342f1
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/$PREFIX$
@@ -0,0 +1 @@
+com\DayZ-SA-Tomato
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/$REVISION$ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/$REVISION$
new file mode 100644
index 0000000..56a6051
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/$REVISION$
@@ -0,0 +1 @@
+1
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/DayZ-SA-Tomato.pbo.SchnitzelPommes.bisign b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/DayZ-SA-Tomato.pbo.SchnitzelPommes.bisign
new file mode 100644
index 0000000..20c7c23
Binary files /dev/null and b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/DayZ-SA-Tomato.pbo.SchnitzelPommes.bisign differ
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/config.cpp b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/config.cpp
new file mode 100644
index 0000000..471da7d
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/config.cpp
@@ -0,0 +1,63 @@
+class CfgPatches
+{
+ class DayZSATomato
+ {
+ units[]={};
+ weapons[]={};
+ requiredVersion=0.1;
+ requiredAddons[]=
+ {
+ };
+ };
+};
+class CfgMods
+{
+ class DayZSATomato
+ {
+ dir="DayZ-SA-Tomato";
+ picture="";
+ action="";
+ hideName=1;
+ hidePicture=1;
+ name="DayZ-SA-Tomato";
+ credits="";
+ author="DayZ-SA-Tomato";
+ authorID="0";
+ version="1.0";
+ extra=0;
+ type="mod";
+ dependencies[]=
+ {
+ "Game",
+ "World",
+ "Mission"
+ };
+ class defs
+ {
+ class gameScriptModule
+ {
+ value="";
+ files[]=
+ {
+ "com/DayZ-SA-Tomato/scripts/3_Game"
+ };
+ };
+ class worldScriptModule
+ {
+ value="";
+ files[]=
+ {
+ "com/DayZ-SA-Tomato/scripts/4_World"
+ };
+ };
+ class missionScriptModule
+ {
+ value="";
+ files[]=
+ {
+ "com/DayZ-SA-Tomato/scripts/5_Mission"
+ };
+ };
+ };
+ };
+};
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/3_Game/Moddedconstants.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/3_Game/Moddedconstants.c
new file mode 100644
index 0000000..eddb166
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/3_Game/Moddedconstants.c
@@ -0,0 +1,2 @@
+const int MENU_Admin = 7000;
+const int MENU_AdminMessage = 7001;
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Config/ConfigTypes.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Config/ConfigTypes.c
new file mode 100644
index 0000000..05840cf
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Config/ConfigTypes.c
@@ -0,0 +1,23 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+enum ConfigType
+{
+ false, true, next, custom
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Config/FileConfig.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Config/FileConfig.c
new file mode 100644
index 0000000..d76840c
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Config/FileConfig.c
@@ -0,0 +1,289 @@
+/*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+class FileConfig
+{
+ ref array< ref FileConfig > Children;
+ string ConfigName;
+ ConfigType IsConfigType;
+ string ConfigData;
+ ref FileConfig Parent;
+ void FileConfig( string name, ConfigType type = true, string data = "", ref FileConfig parent = NULL )
+ {
+ ConfigName = name;
+ IsConfigType = type;
+ ConfigData = data;
+ Parent = parent;
+
+ IsConfigType = ConfigType.next;
+ if ( Parent == NULL )
+ {
+ IsConfigType = ConfigType.true;
+ }
+
+ Children = new ref array< ref FileConfig >;
+ }
+
+ void WriteToFile()
+ {
+ array ConfigNames = new array;
+ array ConfigTypes = new array;
+ string type;
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ ConfigNames.Insert(Children[i].ConfigName);
+
+ if(Children[i].IsConfigType == ConfigType.true)
+ {
+ type = "1";
+ }else if(Children[i].IsConfigType == ConfigType.custom)
+ {
+ type = Children[i].ConfigData;
+ }else
+ {
+ type = "0";
+ }
+ ConfigTypes.Insert(type);
+ }
+
+ FileHandle file = OpenFile( GetFileHandler().ConfigFile, FileMode.WRITE );
+
+ if ( file != 0 )
+ {
+
+ for ( int t = 0; t < ConfigNames.Count(); t++ )
+ {
+ string WriteData = ConfigNames[t] + " = " + ConfigTypes[t];
+ FPrintln( file, WriteData );
+ }
+
+ CloseFile(file);
+
+ Print("Wrote Config to File" + GetFileHandler().ConfigFile);
+ } else
+ {
+ Print("Could not open File " + GetFileHandler().ConfigFile + " to Write Config to!");
+ }
+ }
+
+ void ~FileConfig()
+ {
+ //delete Children;
+ }
+
+ bool IsConfig( string Configname )
+ {
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ if ( Children[i].ConfigName == Configname && Children[i].IsConfigType == ConfigType.true)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ string GetConfigData( string Configname )
+ {
+ string ReturnData = "";
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ if ( Children[i].ConfigName == Configname ) //&& Children[i].IsConfigType == ConfigType.custom
+ {
+ ReturnData = Children[i].ConfigData;
+ return ReturnData;
+ }
+ }
+ return ReturnData;
+ }
+
+ void SetConfigType(ConfigType type)
+ {
+
+ IsConfigType = type;
+ //GetFileHandler().RootConfig.WriteToFile()
+
+ }
+
+ void SetConfigData(string data)
+ {
+ ConfigData = data;
+ //GetFileHandler().RootConfig.WriteToFile()
+ }
+
+ void PrintAll()
+ {
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ Print(" ");
+ Print("Printing Child with number " + i);
+ Print("Name = " + Children[i].ConfigName);
+ Print("ConfigType = " + Children[i].IsConfigType);
+ Print("ConfigData = " + Children[i].ConfigData);
+ Print("Parent = " + Children[i].Parent);
+ Print("End Of Child with Number " + i);
+ Print(" ");
+ }
+ }
+
+ void ConfigInitialize()
+ {
+ array ConfigLine = new array;
+ array ConfigStringCut = new array;
+ FileHandle file = OpenFile( GetFileHandler().ConfigFile, FileMode.READ );
+ if ( file != 0 )
+ {
+ Print("ConfigInitialize - File Found");
+ string line;
+
+ while ( FGets( file, line ) > 0 )
+ {
+ ConfigLine.Insert( line );
+ }
+
+ CloseFile( file );
+
+ if(Children.Count() == ConfigLine.Count() )
+ {
+ for ( int i = 0; i < ConfigLine.Count(); i++ )
+ {
+ ConfigStringCut.Clear();
+ ConfigLine[i].Split( " = ", ConfigStringCut );
+ ConfigType type;
+ string configData = "";
+ if(ConfigLine.Count() == Children.Count())
+ {
+ int len = ConfigStringCut[1].LengthUtf8();
+ len = len - 2;
+ string ConfigTypeCut = ConfigStringCut[1].Substring(2, len);
+ if(ConfigTypeCut == "1")
+ {
+ type = ConfigType.true;
+ }else if(ConfigTypeCut == "0")
+ {
+ type = ConfigType.false;
+ }else
+ {
+ type = ConfigType.custom;
+ configData = ConfigTypeCut;
+
+ }
+ }else
+ {
+ if(ConfigStringCut[1] == "= 1")
+ {
+ type = ConfigType.true;
+ }else if(ConfigStringCut[1] == "= 0")
+ {
+ type = ConfigType.false;
+ }else
+ {
+ type = ConfigType.custom;
+ configData = ConfigTypeCut;
+ }
+ }
+ //Function needet TODO !
+ Children[i].SetConfigType(type);
+ Children[i].SetConfigData(configData);
+ }
+ WriteToFile();
+ }else
+ {
+ Print("Config File has Wrong number of Configs recreateing file !");
+ WriteToFile();
+ }
+ } else
+ {
+ Print( "File. " + GetFileHandler().ConfigFile + " Not found Creating new one");
+ WriteToFile();
+ }
+ }
+
+ // void LoadConfig( string ConfigString, ConfigType ConfigTypefunc = ConfigType.next )
+ // {
+
+ // array ConfigStringCut = new array;
+ // ConfigString.Split( " = ", ConfigStringCut );
+
+ // ConfigType type;
+ // if (ConfigStringCut.Count() == 2 ) // Loaded will be 1
+ // {
+ // if ( ConfigStringCut[1].Contains( "1" ) )
+ // {
+ // type = ConfigType.true;
+ // } else if ( ConfigStringCut[1].Contains( "0" ) )
+ // {
+ // type = ConfigType.false;
+ // } else
+ // {
+ // type = ConfigType.false;
+ // }
+ // } else if ( ConfigStringCut.Count() < 2 ) //New One will Be Count 1 make Type what it should be
+ // {
+ // type = ConfigTypefunc;
+
+ // } else {
+ // Print( "LoadConfig Error Given String : " + ConfigString + " and should be Config = 1 ");
+ // return;
+ // }
+
+ // CheckIfNewConfig(ConfigStringCut[0], type);
+
+ // }
+ void RegisterNewconfig(string name, string stype, string configdata = "")
+ {
+ Print("RegisterNewConfig Data = " + configdata)
+ ConfigType type;
+ if(stype == "true"){type = ConfigType.true;}
+ else if(stype == "false"){type = ConfigType.false;}
+ else{type = ConfigType.custom;}
+ CheckIfNewConfig(name, type, configdata);
+ }
+
+ void CheckIfNewConfig( string name, ConfigType type, string configData = "" )
+ {
+ Print("CheckIfNewConfig Data = " + configData)
+ ref FileConfig nChild = NULL;
+
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ if ( name == Children[i].ConfigName )
+ {
+ nChild = Children[i];
+ break;
+ }
+ }
+
+ if ( nChild == NULL )
+ {
+ nChild = new FileConfig( name, type, configData, this );
+ //nChild.IsConfigType = type;
+ // nChild.ConfigData = configData;
+ Children.Insert( nChild );
+ for ( i = 0; i < Children.Count(); i++ )
+ {
+ if(Children[i].ConfigName == name)
+ {
+ Children[i].SetConfigType(type);
+ Children[i].SetConfigData(configData);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/FPPermission.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/FPPermission.c
new file mode 100644
index 0000000..dc4b8d6
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/FPPermission.c
@@ -0,0 +1,269 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato,
+ however this File is Execludet from GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007 since it is
+
+ Originally from DayZ-CommunityOnlineTools
+ Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
+ Created by Jacob-Mango
+ and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
+ which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
+ */
+
+class FPPermission
+{
+ ref FPPermission Parent;
+ ref array< ref FPPermission > Children;
+ string Name;
+ PermissionType Type;
+
+
+ void FPPermission( string name, ref FPPermission parent = NULL )
+ {
+ Name = name;
+ Parent = parent;
+
+ Type = PermissionType.DISALLOW;
+
+ if ( Parent == NULL )
+ {
+ Type = PermissionType.DISALLOW;
+ }
+
+ Children = new ref array< ref FPPermission >;
+ }
+
+ void SetPermissionType(string name, PermissionType type)
+ {
+ Print("Permission");
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ Print("Name 1 = " + Name + " Name 2 = " + name);
+ if(Children[i].Name == name)
+ {
+ Print("Permission Found Changeing");
+ Children[i].SetPermissionInternal(type)
+ return;
+ }
+ }
+
+
+ }
+
+ void SetPermissionInternal(PermissionType type)
+ {
+ Print("Type Set");
+ Type = type;
+ }
+
+ void AddPermission( string inp, PermissionType permType = PermissionType.DISALLOW )
+ {
+ array tokens = new array;
+
+ array spaces = new array;
+ inp.Split( " = ", spaces );
+
+ PermissionType type;
+ for ( int i = 0; i < spaces.Count(); i++ )
+ {Print(spaces[i]);}
+ if (spaces.Count() == 2 )
+ {
+ if ( spaces[1].Contains( "1" ) )
+ {
+ type = PermissionType.ALLOW;
+ } else if ( spaces[1].Contains( "0" ) )
+ {
+ type = PermissionType.DISALLOW;
+ } else
+ {
+ type = PermissionType.DISALLOW;
+ }
+
+ spaces[0].Split( "_", tokens );
+ } else if ( spaces.Count() < 2 )
+ {
+ type = permType;
+
+ inp.Split( "_", tokens );
+ } else {
+ Print( "Warning, permission line improperly formatted! Read as \"" + inp + "\" but meant to be in format \"Perm_Perm {n}\"." );
+ return;
+ }
+
+ int depth = tokens.Find( Name );
+
+ if ( depth > -1 )
+ {
+ AddPermissionInternal( tokens, depth + 1, type );
+ } else
+ {
+ AddPermissionInternal( tokens, 0, type );
+ }
+ }
+
+ private ref FPPermission VerifyAddPermission( string name )
+ {
+ ref FPPermission nChild = NULL;
+
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ if ( name == Children[i].Name )
+ {
+ nChild = Children[i];
+ break;
+ }
+ }
+
+ if ( nChild == NULL )
+ {
+ nChild = new FPPermission( name, this );
+ nChild.Type = PermissionType.DISALLOW;
+
+ Children.Insert( nChild );
+ }
+
+ return nChild;
+ }
+
+ void ToPermArray( ref array< string > output, string prepend = "" )
+ {
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ string serialize = prepend + Children[i].Name;
+ //TODO " = "
+ output.Insert( serialize + " = " + Children[i].Type );
+
+ if ( Children[i].Children.Count() > 0 )
+ {
+ Children[i].ToPermArray( output, serialize + "_" );
+ }
+ }
+ }
+
+ bool HasPermission( string inp )
+ {
+ array tokens = new array;
+ inp.Split( "_", tokens );
+
+ if ( tokens.Count() == 0 ) return false;
+
+ int depth = tokens.Find(Name);
+
+ bool parentDisallowed = false;
+
+ if ( Type == PermissionType.DISALLOW )
+ {
+ parentDisallowed = true;
+ }
+
+ if ( depth > -1 )
+ {
+ return Check( tokens, depth + 1, parentDisallowed );
+ } else
+ {
+ return Check( tokens, 0, parentDisallowed );
+ }
+ }
+
+ bool Check( array tokens, int depth, bool parentDisallowed )
+ {
+ bool ifReturnAs = false;
+
+ if ( Type == PermissionType.ALLOW )
+ {
+ ifReturnAs = true;
+ }
+
+ if ( Type == PermissionType.DISALLOW )
+ {
+ parentDisallowed = true;
+ }
+
+ if ( Type == PermissionType.ALLOW )
+ {
+ parentDisallowed = false;
+ }
+
+ if ( depth < tokens.Count() )
+ {
+ ref FPPermission nChild = NULL;
+
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ if ( Children[i].Name == tokens[depth] )
+ {
+ nChild = Children[i];
+ }
+ }
+
+ if ( nChild )
+ {
+ return nChild.Check( tokens, depth + 1, parentDisallowed );
+ }
+ }
+
+ return ifReturnAs;
+ }
+
+ private ref FPPermission Get( array tokens, int depth )
+ {
+ if ( depth < tokens.Count() )
+ {
+ ref FPPermission nChild = NULL;
+
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ if ( Children[i].Name == tokens[depth] )
+ {
+ nChild = Children[i];
+ }
+ }
+
+ if ( nChild )
+ {
+ return nChild.Get( tokens, depth + 1 );
+ }
+ }
+
+ return this;
+ }
+
+ ref FPPermission GetPermission( string inp )
+ {
+ array tokens = new array;
+ inp.Split( "_", tokens );
+
+ int depth = tokens.Find(Name);
+
+ if ( depth > -1 )
+ {
+ return Get( tokens, depth + 1 );
+ } else
+ {
+ return Get( tokens, 0 );
+ }
+ }
+
+ private void AddPermissionInternal( array tokens, int depth, PermissionType value )
+ {
+ if ( depth < tokens.Count() )
+ {
+ string name = tokens[depth];
+
+ ref FPPermission nChild = VerifyAddPermission( name );
+
+ nChild.AddPermissionInternal( tokens, depth + 1, value );
+ } else {
+ Type = value;
+ }
+ }
+
+
+ void ~FPPermission()
+ {
+ delete Children;
+ }
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/FPPlayer.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/FPPlayer.c
new file mode 100644
index 0000000..6a169ef
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/FPPlayer.c
@@ -0,0 +1,204 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato,
+ however this File is Execludet from GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007 since it is
+
+ Originally from DayZ-CommunityOnlineTools
+ Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
+ Created by Jacob-Mango
+ and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
+ which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
+ */
+
+class FPPlayer
+{
+ ref FPPermission RootPermission;
+
+ PlayerBase PlayerObject;
+ PlayerIdentity IdentityPlayer;
+ ref PlayerDataN Data;
+
+ void FPPlayer(ref PlayerDataN data)
+ {
+ PlayerObject = NULL;
+ Data = data;
+
+ if ( Data == NULL )
+ {
+ Data = new ref PlayerDataN;
+ }
+
+ RootPermission = new ref FPPermission( Data.SSteam64ID );
+
+ }
+
+ void SetPermission(string name, PermissionType type)
+ {
+ Print("FPPlayer");
+ RootPermission.SetPermissionType(name , type)
+ }
+
+ string FileReadyStripName( string name )
+ {
+ name.Replace( "\\", "" );
+ name.Replace( "/", "" );
+ name.Replace( "=", "" );
+ name.Replace( "+", "" );
+
+ return name;
+ }
+
+ bool Load()
+ {
+ string filename = FileReadyStripName( Data.SSteam64ID );
+ Print( "Loading permissions for " + filename );
+ FileHandle file = OpenFile( GetFileHandler().PlayersFolderPath + filename + ".Player", FileMode.READ );
+
+ ref array< string > data = new ref array< string >;
+
+ if ( file != 0 )
+ {
+ string line;
+
+ while ( FGets( file, line ) > 0 )
+ {
+ data.Insert( line );
+ }
+
+ CloseFile( file );
+
+ for ( int i = 0; i < data.Count(); i++ )
+ {
+ AddPermission( data[i] );
+ }
+ } else
+ {
+ Print( "Failed to open the file for the player to read. Attemping to create." );
+
+ Save();
+ return false;
+ }
+
+ return true;
+ }
+
+ bool Save()
+ {
+ string filename = FileReadyStripName( Data.SSteam64ID );
+
+ Print( "Saving permissions for " + filename );
+ FileHandle file = OpenFile( GetFileHandler().PlayersFolderPath + filename + ".Player", FileMode.WRITE );
+ //TODO ??
+ ref array< string > data = ToPermArray();
+
+ if ( file != 0 )
+ {
+ string line;
+
+ for ( int i = 0; i < data.Count(); i++ )
+ {
+ FPrintln( file, data[i] );
+ }
+
+ CloseFile(file);
+
+ Print("Wrote to the players");
+ return true;
+ } else
+ {
+ Print("Failed to open the file for the player for writing.");
+ return false;
+ }
+ }
+
+ void CopyPermissions( ref FPPermission copy )
+ {
+ ref array< string > data = new ref array< string >;
+ copy.ToPermArray( data );
+
+ for ( int i = 0; i < data.Count(); i++ )
+ {
+ AddPermission( data[i] );
+ }
+ }
+
+ ref array< string > ToPermArray()
+ {
+ Data.APermissions.Clear();
+
+ RootPermission.ToPermArray( Data.APermissions );
+
+ return Data.APermissions;
+ }
+
+ void ToPermData()
+ {
+ for ( int i = 0; i < Data.APermissions.Count(); i++ )
+ {
+ AddPermission( Data.APermissions[i] );
+ }
+ }
+
+ bool HasPermission( string fPPermission )
+ {
+ return RootPermission.HasPermission( fPPermission );
+ }
+
+ void AddPermission( string fPPermission, PermissionType type = PermissionType.DISALLOW )
+ {
+ RootPermission.AddPermission( fPPermission, type);
+ }
+
+ void ClearPermissions()
+ {
+ delete RootPermission;
+
+ RootPermission = new ref FPPermission( Data.SSteam64ID, NULL );
+ }
+
+ void UpdatePlayerDataN()
+ {
+ if ( IdentityPlayer == NULL ) return;
+
+ Data.IPingMin = IdentityPlayer.GetPingMin();
+ Data.IPingMax = IdentityPlayer.GetPingMax();
+ Data.IPingAvg = IdentityPlayer.GetPingAvg();
+
+ Data.SSteam64ID = IdentityPlayer.GetPlainId();
+ Data.SGUID = IdentityPlayer.GetId();
+ Data.SName = IdentityPlayer.GetName();
+
+ if ( PlayerObject == NULL ) return;
+
+ PlayerDataN.Load( Data, PlayerObject );
+ }
+
+ void NewData( ref PlayerDataN newData )
+ {
+ Data = newData;
+ }
+
+ void ~FPPlayer()
+ {
+ delete RootPermission;
+ }
+
+ string GetGUID()
+ {
+ return Data.SGUID;
+ }
+
+ string GetSteam64ID()
+ {
+ return Data.SSteam64ID;
+ }
+
+ string GetName()
+ {
+ return Data.SName;
+ }
+
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/PermissionSystem.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/PermissionSystem.c
new file mode 100644
index 0000000..3a40496
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/PermissionSystem.c
@@ -0,0 +1,108 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato,
+ however this File is Execludet from GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007 since it is
+
+ Originally from DayZ-CommunityOnlineTools
+ Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
+ Created by Jacob-Mango
+ and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
+ which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
+ */
+static ref FPPlayer ClientAuthPlayer;
+
+static ref array< ref FPPlayer > SELECTED_PLAYERS;
+
+ref array< ref FPPlayer > GetSelectedPlayers()
+{
+ if ( SELECTED_PLAYERS == NULL )
+ {
+ SELECTED_PLAYERS = new ref array< ref FPPlayer >;
+ }
+ return SELECTED_PLAYERS;
+}
+
+bool PlayerAlreadySelected( ref FPPlayer player )
+{
+ int position = GetSelectedPlayers().Find( player );
+
+ return position > -1;
+}
+
+int RemoveSelectedPlayer( ref FPPlayer player )
+{
+ int position = GetSelectedPlayers().Find( player );
+
+ if ( position > -1 )
+ {
+ GetSelectedPlayers().Remove( position );
+ }
+
+ return position;
+}
+
+int AddSelectedPlayer( ref FPPlayer player )
+{
+ int position = GetSelectedPlayers().Find( player );
+
+ if ( position > -1 )
+ return position;
+
+ return GetSelectedPlayers().Insert( player );
+}
+
+ref PlayerDataN SerializePlayer( ref FPPlayer player )
+{
+ player.ToPermArray();
+
+ return player.Data;
+}
+
+ref FPPlayer DeserializePlayer( ref PlayerDataN data )
+{
+ return GetFileHandler().GetPlayer( data );
+}
+
+array< ref PlayerDataN > SerializePlayers( ref array< ref FPPlayer > players )
+{
+ array< ref PlayerDataN > output = new array< ref PlayerDataN >;
+
+ for ( int i = 0; i < players.Count(); i++)
+ {
+ output.Insert( SerializePlayer( players[i] ) );
+ }
+
+ return output;
+}
+
+array< ref FPPlayer > DeserializePlayers( ref array< ref PlayerDataN > players )
+{
+ array< ref FPPlayer > output = new array< ref FPPlayer >;
+
+ for ( int i = 0; i < players.Count(); i++)
+ {
+ output.Insert( DeserializePlayer( players[i] ) );
+ }
+
+ return output;
+}
+
+ref array< string > SerializePlayersGUID( array< ref FPPlayer > players )
+{
+ ref array< string > output = new ref array< string >;
+
+ for ( int i = 0; i < players.Count(); i++)
+ {
+ output.Insert( players[i].GetGUID() );
+ }
+
+ return output;
+}
+
+array< ref FPPlayer > DeserializePlayersGUID( ref array< string > guids )
+{
+ return GetFileHandler().GetPlayers( guids );
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/PermissionType.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/PermissionType.c
new file mode 100644
index 0000000..03fcdcd
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/PermissionType.c
@@ -0,0 +1,19 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato,
+ however this File is Execludet from GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007 since it is
+
+ Originally from DayZ-CommunityOnlineTools
+ Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
+ Created by Jacob-Mango
+ and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
+ which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
+ */
+
+enum PermissionType
+{
+ DISALLOW, ALLOW
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/PlayerData.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/PlayerData.c
new file mode 100644
index 0000000..a592e03
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Player/PlayerData.c
@@ -0,0 +1,81 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato,
+ however this File is Execludet from GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007 since it is
+
+ Originally from DayZ-CommunityOnlineTools
+ Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
+ Created by Jacob-Mango
+ and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
+ which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
+ */
+
+// STORE ALL PLAYERS DATA HERE FOR OUTSIDE NETWORK BUBBLE!
+
+class PlayerDataN
+{
+ string SName;
+ string SGUID;
+ string SSteam64ID;
+
+ int IPingMax;
+ int IPingMin;
+ int IPingAvg;
+
+ ref array< string > ARoles;
+ ref array< string > APermissions;
+
+ vector VPosition;
+ vector VDirection;
+ vector VOrientation;
+
+ float FHealth;
+ float FBlood;
+ float FShock;
+
+ int IBloodStatType;
+
+ float FEnergy;
+ float FWater;
+
+ float FHeatComfort;
+
+ float FWet;
+ float FTremor;
+ float FStamina;
+
+ int Kills;
+ int TotalKills;
+
+ int ILifeSpanState;
+ bool BBloodyHands;
+
+ void PlayerDataN()
+ {
+ ARoles = new ref array< string >;
+ APermissions = new ref array< string >;
+ }
+
+ static void Load( out PlayerDataN data, ref PlayerBase player )
+ {
+ data.VPosition = player.GetPosition();
+ data.VDirection = player.GetDirection();
+ data.VOrientation = player.GetOrientation();
+
+ data.FHealth = player.GetHealth( "GlobalHealth","Health" );
+ data.FBlood = player.GetHealth( "GlobalHealth", "Blood" );
+ data.FShock = player.GetHealth( "GlobalHealth", "Shock" );
+ data.IBloodStatType = player.GetStatBloodType().Get();
+ data.FEnergy = player.GetStatEnergy().Get();
+ data.FWater = player.GetStatWater().Get();
+ data.FHeatComfort = player.GetStatHeatComfort().Get();
+ data.FWet = player.GetStatWet().Get();
+ data.FTremor = player.GetStatTremor().Get();
+ data.FStamina = player.GetStatStamina().Get();
+ data.ILifeSpanState = player.GetLifeSpanState();
+ data.BBloodyHands = player.HasBloodyHands();
+ }
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Tp_Locations/FileTeleport.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Tp_Locations/FileTeleport.c
new file mode 100644
index 0000000..7916de4
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Tp_Locations/FileTeleport.c
@@ -0,0 +1,187 @@
+/*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+class FileTeleport
+{
+ ref array< ref FileTeleport > Children;
+ string LocationName;
+ vector LocationPos;
+ bool ok = false;
+ ref FileTeleport Parent;
+ void FileTeleport( string name, ref FileTeleport parent = NULL, vector pos = Vector.Zero())
+ {
+ if(parent == NULL)
+ {
+ ok = true;
+ }
+ LocationName = name;
+ LocationPos = pos;
+ Parent = parent;
+ //Print("Teleport Location = " + LocationName + " LocationPos = " + LocationPos);
+ GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
+ Children = new ref array< ref FileTeleport >;
+ }
+
+ void AddNewLocation(string PosName, vector AdminPos)
+ {
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ if ( PosName == Children[i].LocationName )
+ {
+ return;
+ }
+ }
+ //PosName = stringParam.param1;
+
+ vector PosOut;
+ PosOut = Vector(AdminPos[0], 0.0, AdminPos[2]);
+ string stringout = PosOut.ToString(false);
+ AddToFile(PosName, stringout);
+ Load();
+
+ }
+
+ void AddToFile(string name, string pos)
+ {
+ FileHandle file = OpenFile( GetFileHandler().TeleportFile, FileMode.APPEND );
+ if ( file != 0 )
+ {
+ FPrintln(file, name + " = " + pos);
+ }
+ CloseFile(file);
+ }
+
+ void AddChilds(string name, vector pos)
+ {
+ ref FileTeleport nChild = NULL;
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ if ( name == Children[i].LocationName )
+ {
+ nChild = Children[i];
+ break;
+ }
+ }
+
+ if ( nChild == NULL )
+ {
+ nChild = new FileTeleport( name, this, pos);
+
+ Children.Insert( nChild );
+ }
+
+ }
+
+ void Load()
+ {
+ Children.Clear();
+ FileHandle file = OpenFile( GetFileHandler().TeleportFile, FileMode.READ );
+ if ( file != 0 )
+ {
+ string line, LocationNameNew;
+ vector LocationPosNew;
+ array TeleportLine = new array;
+ array TeleportLineCut = new array;
+ array TeleportPositions = new array;
+ float X, Y;
+ while ( FGets( file, line ) > 0 )
+ {
+ TeleportLineCut.Clear();
+ TeleportPositions.Clear();
+ line.Split(" = ", TeleportLineCut);
+ int len = TeleportLineCut[1].LengthUtf8();
+ len = len - 2;
+ string LocationPosPreNew = TeleportLineCut[1].Substring(2, len);
+ LocationPosPreNew.Split(" ", TeleportPositions);
+ X = TeleportPositions[0].ToFloat();
+ Y = TeleportPositions[2].ToFloat();
+
+ LocationPosNew = Vector(X, 0.0, Y);
+ LocationNameNew = TeleportLineCut[0];
+
+ NewTeleport(LocationNameNew, LocationPosNew);
+
+ }
+ CloseFile(file);
+ }
+ }
+
+ void NewTeleport(string name, vector loc)
+ {
+ ref FileTeleport nChild = NULL;
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ if ( name == Children[i].LocationName )
+ {
+ nChild = Children[i];
+ break;
+ }
+
+ }
+ if ( nChild == NULL )
+ {
+ nChild = new FileTeleport( name, this, loc);
+ Children.Insert( nChild );
+ }
+ }
+
+ void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
+ {
+ if(ok)
+ {
+ int ListCount = 0;
+ PlayerBase Admin;
+ //PlayerIdentity AdminIdentity;
+
+ switch(rpc_type)
+ {
+ case M_RPCs.M_Admin_Menu_Teleport_Write:
+ //Param1 stringParam;
+ string PosName;
+ vector AdminPos;
+ ctx.Read(PosName);
+ ctx.Read(AdminPos);
+ Print("");
+ Print("Adding Pos");
+ Print(PosName);
+ Print(AdminPos);
+ for ( int i = 0; i < Children.Count(); i++ )
+ {
+ if ( PosName == Children[i].LocationName )
+ {
+ return;
+ }
+ }
+ //PosName = stringParam.param1;
+ if ( GetGame().IsServer() )
+ {
+ vector PosOut;
+ PosOut = Vector(AdminPos[0], 0.0, AdminPos[2]);
+ string stringout = PosOut.ToString(false);
+ AddToFile(PosName, stringout);
+ Load();
+ }
+ break;
+
+
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Tp_Locations/TeleportData.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Tp_Locations/TeleportData.c
new file mode 100644
index 0000000..e1c25ae
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/FileHandeling/Tp_Locations/TeleportData.c
@@ -0,0 +1,91 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+class TeleportData
+{
+ ref array [ Locations
+ string LocationName;
+ vector LocationPos;
+ ref FileTeleport Parent;
+
+ void TeleportData(ref FileTeleport parent = NULL)
+ {
+ Print("TeleportData");
+
+ GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
+ Parent = parent
+ }
+
+
+ void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
+ {
+ PlayerBase Admin;
+ switch(rpc_type)
+ {
+ // case M_RPCs.M_Admin_Menu_Teleport_RequestData:
+ // GetFileHandler().LoadTeleport();
+ // if ( GetGame().IsServer() )
+ // {
+ // ref array< string > LocationNT = new ref array< string >;
+ // ref array< vector > LocationP = new ref array< vector >;
+ // PlayerIdentity AdminIdentity;
+ // Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
+ // if ( Admin != NULL)
+ // {
+ // AdminIdentity = Admin.GetIdentity();
+ // for ( int t = 0; t < GetFileHandler().RootTeleport.Children.Count(); t++ )
+ // {
+ ////string name = GetFileHandler().RootTeleport.Children[t].LocationName;
+ // vector pos = GetFileHandler().RootTeleport.Children[t].LocationPos;
+ // string name = GetFileHandler().RootTeleport.Children[t].LocationName;
+
+ // LocationNT.Insert(name);
+
+ // LocationP.Insert(pos);
+
+ // }
+ // Print("Server - Teleport Data Rpc Sent");
+ // ScriptRPC TListDst = new ScriptRPC();
+ // TListDst.Write(LocationNT);
+ // TListDst.Write(LocationP);
+ // TListDst.Send(NULL, M_RPCs.M_Admin_Menu_Teleport_ReciveData, false, AdminIdentity);
+ // }
+ // }
+
+ // if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ // {
+
+ // }
+ // break;
+ }
+ }
+
+
+}
+ref TeleportData Tomato_TeleportData;
+
+ref TeleportData GetTeleportData()
+{
+ if( !Tomato_TeleportData )
+ {
+ Tomato_TeleportData = new ref TeleportData();
+ }
+
+ return Tomato_TeleportData;
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/LogSystem/DeathHandler.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/LogSystem/DeathHandler.c
new file mode 100644
index 0000000..ed074e9
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/LogSystem/DeathHandler.c
@@ -0,0 +1,296 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+class DeathHandler
+{
+ string KillFile = "$profile:\\Dayz-Sa-Tomato\\Log\\Kills.txt";
+
+ PlayerBase KPlayerBase;
+ PlayerIdentity KPlayerIdentity;
+ string KName;
+ vector KPos;
+ int Dist;
+ EntityAI KW;
+ ItemBase KWItemBase;
+ string KWName;
+
+
+ PlayerBase VPlayerBase;
+ PlayerIdentity VPlayerIdentity;
+ string VName;
+ vector VPos;
+
+ string OutMessage;
+
+ void DeathHandler()
+ {
+
+ }
+
+ void log(string log)
+ {
+ if ( GetGame().IsServer() )
+ {
+ if(FileExist(KillFile))
+ {
+ FileHandle file = OpenFile(KillFile, FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ }else
+ {
+ MakeDirectory(KillFile);
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ Print("Could not create Folder/File " + KillFile);
+ }
+ }
+ }
+
+ string LineIn()
+ {
+ int year, month, day, hour, minute, second;
+ GetYearMonthDay(year, month, day);
+ GetHourMinuteSecond(hour, minute, second);
+ string date = day.ToStringLen(2) + "." + month.ToStringLen(2) + "." + year.ToStringLen(4) + " " + hour.ToStringLen(2) + ":" + minute.ToStringLen(2);
+ string LineIn = "[" + date + "] - ";
+ return LineIn;
+ }
+ void ConnectHandler(PlayerIdentity player)
+ {
+ string msg;
+ if (GetFileHandler().IsConfig("Welcome_Message"))
+ {
+ msg = GetMessage(GetFileHandler().GetConfig("Welcome_Message_Join"), VName);
+ int count = msg.Replace("{Player}", player.GetName());
+ GetGame().ChatPlayer(0, msg);
+ }
+ }
+ void KilledHandler(Object killer, PlayerBase pbKilled)
+ {
+ KPlayerBase = NULL;
+ // Victim
+ VPlayerBase = PlayerBase.Cast(pbKilled);
+ VPlayerIdentity = VPlayerBase.GetIdentity();
+ VName = VPlayerIdentity.GetName();
+
+ OutMessage = "";
+
+ IsMan(killer);
+ SelectKillType();
+ IsAnimal(killer);
+ Send();
+
+ }
+
+ void Send()
+ {
+ if (OutMessage != "")
+ {
+ GetGame().ChatPlayer(0, OutMessage);
+ }
+ }
+
+ void IsAnimal(Object killer)
+ {
+ if (killer.IsKindOf("AnimalBase"))
+ {
+ if (GetFileHandler().IsConfig("KillFeed_Message_Animal"))
+ {
+ OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_Animal"), VName);
+ }
+ }
+ else if (killer.IsKindOf("ZombieBase"))
+ {
+ if (GetFileHandler().IsConfig("KillFeed_Message_Zombie")) //TODO
+ {
+ OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_Zombie"), VName);
+ }
+ }
+ else
+ {
+ if (GetFileHandler().IsConfig("KillFeed_Message_Unknown"))
+ {
+ OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_Unknown"), VName);
+ }
+ }
+
+ }
+
+ void SelectKillType()
+ {
+ if (KPlayerBase)
+ {
+ if (VPlayerBase == KPlayerBase)
+ {
+ if (GetFileHandler().IsConfig("KillFeed_Message_Suicide"))
+ {
+ OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_Suicide"), VName);
+ }
+
+ }
+ else
+ {
+
+ KPlayerIdentity = NULL;
+ KPlayerIdentity = KPlayerBase.GetIdentity();
+ KName = KPlayerIdentity.GetName();
+ KPos = KPlayerBase.GetPosition();
+ VPos = VPlayerBase.GetPosition();
+ Dist = vector.Distance(VPos, KPos);
+ KW = KPlayerBase.GetHumanInventory().GetEntityInHands();
+
+ if (KW.IsItemBase())
+ {
+ KWItemBase = ItemBase.Cast(KW);
+ KWName = KWItemBase.GetDisplayName();
+
+ if (KPlayerBase.GetDisplayName() == KWName)
+ {
+ if(GetFileHandler().IsConfig("KillFeed_LogToFile"))
+ {
+ string Lmessage = GetMessage(GetFileHandler().GetConfig("KillFeed_ByPlayerHand"), VName, KName)
+ log(Lmessage);
+ }
+
+ if (GetFileHandler().IsConfig("KillFeed_Message_PlayerHand"))
+ {
+ OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_ByPlayerHand"), VName, KName);
+ }
+
+ }
+ else
+ {
+ if(GetFileHandler().IsConfig("KillFeed_LogToFile"))
+ {
+ Lmessage = GetMessage(GetFileHandler().GetConfig("KillFeed_ByPlayerWeapon"), VName, KName, KWName, Dist.ToString())
+ log(Lmessage);
+ }
+
+ if (GetFileHandler().IsConfig("KillFeed_Message_PlayerWeapon")
+ {
+ OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_ByPlayerWeapon"), VName, KName, KWName, Dist.ToString());
+ }
+
+
+ }
+ }
+ else
+ {
+ }
+ }
+ }
+ }
+
+
+ void IsMan(Object killer)
+ {
+ if (killer.IsMan())
+ {
+ if (killer.IsKindOf("SurvivorBase"))
+ {
+ KPlayerBase = PlayerBase.Cast(killer);
+ }
+ }
+ else
+ {
+
+ if (killer.IsItemBase())
+ {
+ KWItemBase = ItemBase.Cast(killer);
+ KPlayerBase = PlayerBase.Cast(KWItemBase.GetHierarchyRootPlayer());
+ }
+ }
+ }
+
+ void KilledHandlerOld(Object killer, PlayerBase pbKilled)
+ {
+ string Killername;
+ string Killedname;
+ SurvivorBase sbKilled = SurvivorBase.Cast(pbKilled);
+ if (killer.IsMan()) {
+
+ Man manKiller = Man.Cast(killer);
+
+ if (sbKilled.GetPFullName() == manKiller.GetIdentity().GetName()) {
+
+ string KilledBySuicide = GetFileHandler().GetConfig("KillFeed_Suicide");
+ Killedname = sbKilled.GetPFullName();
+ GetGame().ChatPlayer( 0, GetMessage(KilledBySuicide, Killedname));
+ // TL.all(GetMessage(KilledBySuicide, Killedname));
+ // TL.all(sbKilled.GetPFullName() + " took his own life");
+
+ } else
+ {
+ SurvivorBase sbKiller = SurvivorBase.Cast(killer);
+ string KilledByPlayer = GetFileHandler().GetConfig("KillFeed_ByPlayer");
+ Killername = sbKiller.GetPFullName();
+ Killedname = sbKilled.GetPFullName();
+ GetGame().ChatPlayer( 0, GetMessage(KilledByPlayer, Killedname , Killername));
+ // TL.all(GetMessage(KilledByPlayer, Killedname, Killername));
+ }
+ } else
+ {
+ string KilledByBleed = GetFileHandler().GetConfig("KillFeed_Bleeding_Zombie");
+ Killedname = sbKilled.GetPFullName();
+ GetGame().ChatPlayer( 0, GetMessage(KilledByBleed, Killedname));
+ // TL.all(GetMessage(KilledByBleed, Killedname));
+ }
+ }
+
+ string GetMessage(string input, string killed, string killer = "" , string weap = "", string dist = "")
+ {
+ int count = input.Replace("{Killed}", killed);
+ if(killer != "")
+ {
+ count = input.Replace("{Killer}", killer);
+ }
+
+ if(weap != "")
+ {
+ count = input.Replace("{Weapon}", weap);
+ }
+
+ if(dist != "")
+ {
+ count = input.Replace("{Distance}", dist);
+ }
+
+
+ return input;
+ }
+
+}
+
+// ref DeathHandler Tomato_DeathHandler;
+
+// ref DeathHandler GetDeathHandler()
+// {
+ // if( !Tomato_DeathHandler )
+ // {
+ // Tomato_DeathHandler = new ref DeathHandler();
+ // }
+
+ // return Tomato_DeathHandler;
+// }
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/LogSystem/LogHandler.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/LogSystem/LogHandler.c
new file mode 100644
index 0000000..4856ad8
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/LogSystem/LogHandler.c
@@ -0,0 +1,435 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+
+class LogHandler
+{
+ string LogFolderPath = GetFileHandler().LogFolderPath;
+
+
+ string LineIn()
+ {
+ int year, month, day, hour, minute, second;
+ GetYearMonthDay(year, month, day);
+ GetHourMinuteSecond(hour, minute, second);
+ string date = day.ToStringLen(2) + "." + month.ToStringLen(2) + "." + year.ToStringLen(4) + " " + hour.ToStringLen(2) + ":" + minute.ToStringLen(2);
+ string LineIn = "[" + date + "] - ";
+ return LineIn;
+ }
+
+
+ void LogHandler()
+ {
+ GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
+ }
+
+ ref PlayerBase GetPlayerBaseByName(string name)
+ {
+
+ array players = new array;
+
+ PlayerBase selectedPlayer;
+ PlayerIdentity selectedIdentity;
+
+ GetGame().GetPlayers( players );
+ for ( int a = 0; a < players.Count(); ++a )
+ {
+ selectedPlayer = PlayerBase.Cast(players.Get(a));
+ selectedIdentity = selectedPlayer.GetIdentity();
+ if ( selectedIdentity.GetName() == name )
+ {
+ return selectedPlayer;
+ }
+ }
+ return selectedPlayer;
+ }
+
+ ref PlayerIdentity GetIdent(string name)
+ {
+
+ array players = new array;
+
+ PlayerBase selectedPlayer;
+ PlayerIdentity selectedIdentity;
+
+ GetGame().GetPlayers( players );
+ for ( int a = 0; a < players.Count(); ++a )
+ {
+ selectedPlayer = PlayerBase.Cast(players.Get(a));
+ selectedIdentity = selectedPlayer.GetIdentity();
+ if ( selectedIdentity.GetName() == name )
+ {
+ return selectedIdentity;
+ }
+ }
+ return selectedIdentity;
+ }
+
+ void status(PlayerIdentity ident, string msg)
+ {
+ GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_MessageStatus, new Param1( msg ), false, ident );
+ }
+
+ void playern(PlayerIdentity ident, string msg)
+ {
+ Param1 Msgparam = new Param1( msg );
+ GetGame().RPCSingleParam(NULL , ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, ident);
+ }
+
+ void player(PlayerIdentity ident, string msg)
+ {
+ if ( GetGame().IsServer() )
+ {
+ GetGame().RPCSingleParam(NULL, M_RPCs.M_Admin_Message, new Param1(msg), true, ident);
+ }else{
+ GetGame().GetMission().OnEvent(ChatMessageEventTypeID, new ChatMessageEventParams(0, "", msg, ""));
+
+ }
+ }
+
+ void playerSetup()
+ {
+ if ( GetGame().IsServer() )
+ {
+
+ }else{
+ GetGame().RPCSingleParam(NULL, M_RPCs.M_Admin_Message_Setup, new Param1(""), true, NULL);
+ }
+ }
+
+ void all(string msg)
+ {
+ if ( GetGame().IsServer() )
+ {
+
+ ref array< Man > allPlayers = new ref array< Man >;
+ GetGame().GetWorld().GetPlayerList(allPlayers);
+ foreach( Man man : allPlayers )
+ {
+ PlayerBase playerBase = PlayerBase.Cast(man);
+ playerBase.RPCSingleParam(ERPCs.RPC_USER_ACTION_MESSAGE, new Param1(msg), false, playerBase.GetIdentity());
+ }
+ }else{
+ ScriptRPC Rpc = new ScriptRPC();
+ Rpc.Write(msg);
+ Rpc.Send(NULL, M_RPCs.M_Admin_Log_all, true, NULL);
+ }
+ }
+
+ void allWhite(string msg)
+ {
+ if ( GetGame().IsServer() )
+ {
+
+ GetGame().ChatPlayer(0, msg);
+ }else{
+ ScriptRPC Rpc = new ScriptRPC();
+ Rpc.Write(msg);
+ Rpc.Send(NULL, M_RPCs.M_Admin_Log_all_White, true, NULL);
+ }
+ }
+
+
+ void cons(string log)
+ {
+ if ( GetGame().IsServer() )
+ {
+ Debug.Log(log)
+ }else{
+ ScriptRPC Rpc = new ScriptRPC();
+ Rpc.Write(log);
+ Rpc.Send(NULL, M_RPCs.M_Admin_Log_con, true, NULL);
+ }
+ }
+
+
+ void dbug(string log)
+ {
+ if ( GetGame().IsServer() )
+ {
+ if(FileExist(LogFolderPath))
+ {
+ FileHandle file = OpenFile(LogFolderPath + "Debug.txt", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ }else
+ {
+ MakeDirectory(LogFolderPath);
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ Print("Could not create Folder/File " + LogFolderPath + "Debug.txt");
+ }
+ }else
+ {
+ ScriptRPC Rpc = new ScriptRPC();
+ Rpc.Write(log);
+ Rpc.Send(NULL, M_RPCs.M_Admin_Menu_Log_Debug, true, NULL);
+ }
+ }
+
+ void kill(string log)
+ {
+ if ( GetGame().IsServer() )
+ {
+ if(FileExist(LogFolderPath))
+ {
+ FileHandle file = OpenFile(LogFolderPath + "Kills.txt", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ }else
+ {
+ MakeDirectory(LogFolderPath);
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ Print("Could not create Folder/File " + LogFolderPath + "Kills.txt");
+ }
+ }else
+ {
+ ScriptRPC Rpc = new ScriptRPC();
+ Rpc.Write(log);
+ Rpc.Send(NULL, M_RPCs.M_Admin_Menu_Log_Debug, true, NULL);
+ }
+ }
+
+
+
+
+ void admin(string log)
+ {
+ if ( GetGame().IsServer() )
+ {
+ if(FileExist(LogFolderPath))
+ {
+ FileHandle file = OpenFile(LogFolderPath + "Admin.txt", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ }else{
+ MakeDirectory(LogFolderPath + "Admin.txt");
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ }
+ }else
+ {
+ ScriptRPC Rpc = new ScriptRPC();
+ Rpc.Write(log);
+ Rpc.Send(NULL, M_RPCs.M_Admin_Menu_Log_Admin, true, NULL);
+ }
+ }
+
+ void error(string log)
+ {
+ if ( GetGame().IsServer() )
+ {
+ if(FileExist(LogFolderPath))
+ {
+ FileHandle file = OpenFile(LogFolderPath + "Error.txt", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ }else{
+ MakeDirectory(LogFolderPath + "Error.txt");
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ Print("Could not create Folder/File " + LogFolderPath + "Error.txt");
+ }
+ }else
+ {
+ ScriptRPC Rpc = new ScriptRPC();
+ Rpc.Write(log);
+ Rpc.Send(NULL, M_RPCs.M_Admin_Log_error, true, NULL);
+ }
+ }
+
+ void info(string log)
+ {
+ if ( GetGame().IsServer() )
+ {
+ if(FileExist(LogFolderPath))
+ {
+ FileHandle file = OpenFile(LogFolderPath + "Info.txt", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ }else{
+ MakeDirectory(LogFolderPath + "Info.txt");
+ if (file != 0)
+ {
+ FPrintln(file, LineIn() + log);
+ CloseFile(file);
+ }
+ Print("Could not create Folder/File " + LogFolderPath + "Info.txt");
+ }
+ }else
+ {
+ ScriptRPC Rpc = new ScriptRPC();
+ Rpc.Write(log);
+ Rpc.Send(NULL, M_RPCs.M_Admin_Log_info, true, NULL);
+ }
+ }
+
+ void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
+ {
+ string msg;
+ string player;
+ switch(rpc_type)
+ {
+ case M_RPCs.M_Admin_Message:
+ Param1< string > specParams;
+ ctx.Read( specParams );
+ if ( GetGame().IsClient() )
+ {
+ player(sender, specParams.param1);
+ }
+
+ break;
+
+ case M_RPCs.M_Admin_Message_Setup:
+ //ctx.Read( specParams );
+ if ( GetGame().IsServer() )
+ {
+ if(GetFileHandler().IsConfig("Setup"))
+ {
+ if(GetFileHandler().HasPermission("Admin", sender))
+ {
+ player(sender, "Admin Set Menu Should open !")
+ }else{
+ player(sender,"Admin not set type /opme and try again")
+ }
+ }
+
+ }
+
+ break;
+
+ case M_RPCs.M_Admin_Log_info:
+ ctx.Read( msg );
+ if ( GetGame().IsServer() )
+ {
+ if(GetFileHandler().HasPermission("Admin", sender))
+ {
+ info(msg);
+ }
+ }
+ break;
+
+ case M_RPCs.M_Admin_Log_error:
+ ctx.Read( msg );
+ if ( GetGame().IsServer() )
+ {
+ if(GetFileHandler().HasPermission("Admin", sender))
+ {
+ error(msg);
+ }
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_Log_Admin:
+ ctx.Read( msg );
+ if ( GetGame().IsServer() )
+ {
+ if(GetFileHandler().HasPermission("Admin", sender))
+ {
+ admin(msg);
+ }
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_Log_Debug:
+ ctx.Read( msg );
+ if ( GetGame().IsServer() )
+ {
+ if(GetFileHandler().HasPermission("Admin", sender))
+ {
+ dbug(msg);
+ }
+ }
+ break;
+
+ case M_RPCs.M_Admin_Log_con:
+ ctx.Read( msg );
+ if ( GetGame().IsServer() )
+ {
+ if(GetFileHandler().HasPermission("Admin", sender))
+ {
+ cons(msg);
+ }
+ }
+ break;
+
+ case M_RPCs.M_Admin_Log_all:
+ ctx.Read( msg );
+ if ( GetGame().IsServer() )
+ {
+ if(GetFileHandler().HasPermission("Admin", sender))
+ {
+ all(msg);
+ }
+ }
+ break;
+
+ case M_RPCs.M_Admin_Log_all_White:
+ ctx.Read( msg );
+ if ( GetGame().IsServer() )
+ {
+ if(GetFileHandler().HasPermission("Admin", sender))
+ {
+ allWhite(msg);
+ }
+ }
+ break;
+ }
+ }
+}
+
+ref LogHandler Tomato_LogHandler;
+
+ref LogHandler TL()
+{
+ if( !Tomato_LogHandler )
+ {
+ Tomato_LogHandler = new ref LogHandler();
+ }
+
+ return Tomato_LogHandler;
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/M_RPCs.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/M_RPCs.c
new file mode 100644
index 0000000..878795c
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/M_RPCs.c
@@ -0,0 +1,111 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+enum M_RPCs
+{
+ M_SPAWN_OBJECT = 7000;
+ M_SET_GODMODE = 7001;
+ M_SET_CAM = 7002;
+ M_TELEPORT = 7003;
+ M_Admin_Menu = 7004;
+ M_Admin_Menu_OK = 7005;
+ M_Admin_Menu_Spawn_Ground = 7006;
+ M_Admin_Menu_Spawn_Cursor = 7007;
+ M_Admin_Menu_Spawn_Inventory = 7008;
+ M_Admin_Menu_Heal = 7009;
+ M_Admin_Menu_Strip = 7010;
+ M_Admin_Menu_TpTo = 7011;
+ M_Admin_Menu_TpMe = 7012;
+ M_Admin_Menu_TpAllMe = 7013;
+ M_Admin_Menu_Spawn_Car = 7014;
+ M_Admin_Menu_Day = 7015;
+ M_Admin_Menu_Night = 7016;
+ M_Admin_Menu_Car_Refill = 7017;
+ M_Admin_Menu_TpToPos = 7018;
+ M_Admin_Menu_Kill = 7019;
+ M_Admin_Menu_SpWear = 7020;
+ M_Admin_Menu_Spawn_ItemPrev = 7021;
+ M_Admin_Menu_Spawn_ItemPrev_ok = 7022;
+ M_Admin_Menu_KillAll = 7023;
+ M_Admin_Menu_StripAll = 7024;
+ M_Admin_Menu_HealAll = 7025;
+ M_Admin_Menu_Stamina_Enable = 7026;
+ M_Admin_Menu_Stamina_Dissable = 7027;
+ M_Admin_Menu_PM = 7028;
+ M_Admin_Menu_Map_Player = 7029;
+ M_Admin_Menu_Map_Player_Request = 7030;
+ M_Admin_Menu_Player_Health_Request = 7031;
+ M_Admin_Menu_Player_Health = 7032;
+ M_Admin_Menu_Player_Stamina_Request = 7033;
+ M_Admin_Menu_Player_Stamina_ok = 7034;
+ M_Admin_Menu_Log_Info = 7035;
+ M_Admin_Menu_Player_List_Request = 7036;
+ M_Admin_Menu_Player_List = 7037;
+ M_Admin_Menu_Log_Debug = 7038;
+ M_Admin_Menu_Log_Admin = 7039;
+ M_Admin_Menu_Log_RPC = 7040;
+ M_Admin_Menu_Message = 7041;
+ M_Admin_Menu_Teleport_List_Request = 7042;
+ M_Admin_Menu_Teleport_List = 7043;
+ M_Admin_Menu_TpMeToPos = 7044;
+ M_Admin_Menu_TpMeToPosVec = 7045;
+ M_Admin_Menu_Player_List_Clear = 7046;
+ M_Admin_Menu_Teleport_RequestData = 7047;
+ M_Admin_Menu_Teleport_ReciveData = 7048;
+ M_Admin_Menu_Teleport_Write = 7049;
+ M_Admin_Player_UpdatePlayers = 7050;
+ M_Admin_Player_RemovePlayer = 7051;
+ M_Admin_Player_UpdatePlayer = 7052;
+ M_Admin_Player_SetHealth = 7053;
+ M_Admin_Player_SetBlood = 7054;
+ M_Admin_Player_SetEnergy = 7055;
+ M_Admin_Player_SetWater = 7056;
+ M_Admin_Player_SetShock = 7057;
+ M_Admin_Player_SetHeatComfort = 7058;
+ M_Admin_Player_SetWet = 7059;
+ M_Admin_Player_SetTremor = 7060;
+ M_Admin_Player_SetStamina = 7061;
+ M_Admin_Player_SetLifeSpanState = 7062;
+ M_Admin_Player_SetBloodyHands = 7063;
+ M_Admin_Player_KickTransport = 7064;
+ M_Admin_Player_RepairTransport = 7065;
+ M_Admin_Player_TeleportToMe = 7066;
+ M_Admin_Player_TeleportMeTo = 7067;
+ M_Admin_SpectatePlayer = 7068;
+ M_Admin_Player_GodMode = 7069;
+ M_Admin_SetConfigs = 7070;
+ M_Admin_KickPlayer = 7071;
+ M_Admin_BanPlayer = 7072;
+ M_Admin_Log_con = 7073;
+ M_Admin_Log_all = 7074;
+ M_Admin_Log_all_White = 7075;
+ M_Admin_Log_error = 7076;
+ M_Admin_Log_info = 7077;
+ M_Admin_Log_player = 7078;
+ M_Admin_Delete_Object = 7079;
+ M_SET_CAM_Spectate = 7080;
+ M_Admin_Horde = 7081;
+ M_Admin_Message = 7082;
+ M_Admin_Message_Setup = 7083;
+ M_Admin_Menu_MessageBox = 7084;
+ M_Admin_Menu_MessageStatus = 7085;
+ M_Admin_Menu_Teleport_Write_Pre = 7086;
+
+
+}
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/MiscGameplayFunctions.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/MiscGameplayFunctions.c
new file mode 100644
index 0000000..9d2d4ab
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/MiscGameplayFunctions.c
@@ -0,0 +1,4 @@
+static float GetWaterMetabolicSpeed(int movement_speed)
+{
+ return 0.0;
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/ModdedClasses/EmoteManager.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/ModdedClasses/EmoteManager.c
new file mode 100644
index 0000000..52bb843
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/ModdedClasses/EmoteManager.c
@@ -0,0 +1,28 @@
+
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+modded class EmoteManager
+{
+ override void LogSuicide()
+ {
+ m_Player.issic(true);
+ super.LogSuicide();
+ }
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/ModdedClasses/PlayerBase.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/ModdedClasses/PlayerBase.c
new file mode 100644
index 0000000..3c60f47
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/ModdedClasses/PlayerBase.c
@@ -0,0 +1,84 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+modded class PlayerBase
+{
+ ref FPPlayer authentiPlayer;
+
+ ref DeathHandler m_DeathHandler;
+
+ override void OnConnect()
+ {
+ m_DeathHandler = new ref DeathHandler;
+ // TL().cons("Player connected: " + this.ToString());
+ ref SurvivorBase m_SurBase = SurvivorBase.Cast(this);
+ m_SurBase.SetPID(this.GetIdentity().GetPlainId());
+ m_SurBase.SetPFullName(this.GetIdentity().GetName());
+
+ // NEW STATS API
+ // StatRegister("playtime");
+ // StatRegister("dist");
+
+ Debug.Log("Player connected:"+this.ToString(),"Connect");
+ m_DeathHandler.ConnectHandler(this.GetIdentity());
+ // NEW STATS API
+ StatRegister("playtime");
+ StatRegister("dist");
+
+ m_PlayerOldPos = GetPosition();
+ if( m_AnalyticsTimer )
+ m_AnalyticsTimer.Run( 60, this, "UpdatePlayerMeasures", null, true );
+
+ }
+ override void EEKilled( Object killer )
+ {
+ PlayerBase Killer_Playerbase; // Killer PlayerBase
+ m_DeathHandler.KilledHandler(killer, this);
+
+ if( GetBleedingManagerServer() ) delete GetBleedingManagerServer();
+
+
+
+ // kill character in database
+ if (GetHive())
+ {
+ GetHive().CharacterKill(this);
+ }
+
+ // disable voice communication
+ GetGame().EnableVoN(this, false);
+
+
+
+ GetSymptomManager().OnPlayerKilled();
+
+ super.EEKilled(killer);
+ }
+
+ bool selfkill = false;
+ void issic(bool Yep)
+ {
+ selfkill = Yep;
+ }
+
+ bool CanBeDeleted()
+ {
+ return IsAlive() && !IsRestrained() && !IsUnconscious();
+ }
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/ModdedClasses/SurvivorBase.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/ModdedClasses/SurvivorBase.c
new file mode 100644
index 0000000..b6e5a62
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/ModdedClasses/SurvivorBase.c
@@ -0,0 +1,45 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+
+modded class SurvivorBase
+{
+ private string PID = "empty";
+ private string PFullName = "empty";
+
+ string GetPID()
+ {
+ return PID;
+ }
+
+ void SetPID(string IdentityID)
+ {
+ PID = IdentityID;
+ }
+
+ string GetPFullName()
+ {
+ return PFullName;
+ }
+
+ void SetPFullName(string name)
+ {
+ PFullName = name;
+ }
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/Modules/FileHandler.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/Modules/FileHandler.c
new file mode 100644
index 0000000..da04162
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/Modules/FileHandler.c
@@ -0,0 +1,482 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+class FileHandler
+{
+ //Main Folder
+ string MainFolder = "$profile:\\Tomato_Profiles";
+ string MainFolderPath = "$profile:\\Tomato_Profiles\\";
+ //Config Folder and Files
+ string ConfigFolder = MainFolderPath + "Config";
+ string ConfigFolderPath = MainFolderPath + "Config\\";
+ string ConfigFile = ConfigFolderPath + "Config.txt";
+ //Players Folder
+ string PlayersFolderPath = ConfigFolderPath + "Players\\";
+ //Log Folder and Files
+ string LogFolder = MainFolderPath + "Log";
+ string LogFolderPath = MainFolderPath + "Log\\";
+ string LErrorFile = LogFolderPath + "Error.txt";
+ string LDebugFile = LogFolderPath + "Debug.txt";
+ string LInfoFile = LogFolderPath + "Info.txt";
+ string LAdminFile = LogFolderPath + "Admin.txt";
+ string LKillsFile = LogFolderPath + "Kills.txt";
+ //Customization Folder and Files
+ string CustomizationFolder = MainFolderPath + "Customization";
+ string CustomizationFolderPath = MainFolderPath + "Customization\\";
+ string TeleportFile = CustomizationFolderPath + "Teleport_Locations.txt";
+ bool IsExit = false;
+ ref FileConfig RootConfig;
+ ref FileTeleport RootTeleport;
+ //ref FilePlayers RootPlayers;
+
+ // NEW BEGINN
+ ref array< ref FPPlayer > FPPlayers;
+ ref FPPermission RootPermission;
+ // NEW END
+
+
+
+
+ void FileHandler()
+ {
+ RootConfig = new ref FileConfig( "ROOT" );
+ RootTeleport = new ref FileTeleport( "ROOT" );
+ //RootPlayers = new ref FilePlayers( "ROOT" );
+
+ // NEW BEGINN
+ FPPlayers = new ref array< ref FPPlayer >;
+ RootPermission = new ref FPPermission( "ROOT" );
+ // NEW END
+
+ }
+
+ // NEW BEGINN
+
+ void SetPermission(string perm, PermissionType type, string id) //Identity.GetID()
+ {
+ Print("FileHandler");
+ for ( int i = 0; i < FPPlayers.Count(); i++ )
+ {
+ if ( FPPlayers[i].GetGUID() == id )
+ {
+ Print("FileHanddler Player Founf");
+ FPPlayers[i].SetPermission(perm , type);
+ //return FPPlayers[i].HasPermission( fPPermission );
+ }
+ }
+ }
+
+ array< ref FPPlayer > GetPlayers( ref array< string > guids = NULL )
+ {
+ if ( guids == NULL )
+ {
+ return FPPlayers;
+ }
+
+ array< ref FPPlayer > tempArray = new array< ref FPPlayer >;
+
+ for ( int i = 0; i < guids.Count(); i++ )
+ {
+ for ( int k = 0; k < FPPlayers.Count(); k++ )
+ {
+ if ( guids[i] == FPPlayers[k].GetGUID() )
+ {
+ tempArray.Insert( FPPlayers[k] );
+ }
+ }
+ }
+
+ return tempArray;
+ }
+
+ void SetPlayers( ref array< ref FPPlayer > players )
+ {
+ FPPlayers.Clear();
+
+ // This doesn't work??? wtf
+ //FPPlayers.Copy( players );
+
+ for ( int i = 0; i < players.Count(); i++ )
+ {
+ FPPlayers.Insert( players[i] );
+ }
+ }
+
+ void AddPlayers( ref array< ref FPPlayer > players )
+ {
+ for ( int i = 0; i < players.Count(); i++ )
+ {
+ FPPlayers.Insert( players[i] );
+ }
+ }
+
+ void RegisterPermission( string fPPermission, PermissionType type = PermissionType.DISALLOW )
+ {
+ RootPermission.AddPermission( fPPermission, type );
+ }
+
+ ref array< string > ToPermArray()
+ {
+ ref array< string > data = new ref array< string >;
+ RootPermission.ToPermArray( data );
+ return data;
+ }
+
+ ref FPPermission GetRootPermission()
+ {
+ return RootPermission;
+ }
+
+ bool HasPermission( string fPPermission, PlayerIdentity player = NULL )
+ {
+ if ( !GetGame().IsMultiplayer() ) return true;
+
+ if ( player == NULL )
+ {
+ if ( ClientAuthPlayer == NULL )
+ {
+ return true;
+ }
+
+ return ClientAuthPlayer.HasPermission( fPPermission );
+ }
+
+ for ( int i = 0; i < FPPlayers.Count(); i++ )
+ {
+ if ( FPPlayers[i].GetGUID() == player.GetId() )
+ {
+ return FPPlayers[i].HasPermission( fPPermission );
+ }
+ }
+
+ return false;
+ }
+
+ ref FPPlayer PlayerJoined( PlayerIdentity player )
+ {
+ ref PlayerDataN data = new ref PlayerDataN;
+
+ if ( player )
+ {
+ data.SName = player.GetName();
+ data.SGUID = player.GetId();
+ data.SSteam64ID = player.GetPlainId();
+ } else
+ {
+ data.SName = "Offline Mode";
+ data.SGUID = "N/A";
+ }
+
+ ref FPPlayer auPlayer = new ref FPPlayer( data );
+
+ auPlayer.IdentityPlayer = player;
+
+ auPlayer.CopyPermissions( RootPermission );
+
+ auPlayer.Load();
+
+ FPPlayers.Insert( auPlayer );
+
+ return auPlayer;
+ }
+
+ void PlayerLeft( PlayerIdentity player )
+ {
+ ref PlayerDataN PData = new ref PlayerDataN;
+ if ( player == NULL ) return;
+
+ for ( int i = 0; i < FPPlayers.Count(); i++ )
+ {
+ ref FPPlayer auPlayer = FPPlayers[i];
+
+ if ( auPlayer.GetSteam64ID() == player.GetPlainId() )
+ {
+ auPlayer.Save();
+
+ if ( GetGame().IsServer() && GetGame().IsMultiplayer() )
+ {
+ PData = SerializePlayer( auPlayer );
+ ScriptRPC Adding = new ScriptRPC();
+ Adding.Write(PData);
+ Adding.Send(NULL, M_RPCs.M_Admin_Player_RemovePlayer, true, NULL);
+ //GetRPCManager().SendRPC( "PermissionsFramework", "RemovePlayer", new Param1< ref PlayerDataN >( SerializePlayer( auPlayer ) ), true );
+ }
+
+ FPPlayers.Remove( i );
+ break;
+ }
+ }
+ }
+
+ // void DebugPrint()
+ // {
+ // Print( "Printing all authenticated players!" );
+ // for ( int i = 0; i < FPPlayers.Count(); i++ )
+ // {
+ // FPPlayers[i].DebugPrint();
+ // }
+ // }
+
+ ref FPPlayer GetPlayerByGUID( string guid )
+ {
+ ref FPPlayer auPlayer = NULL;
+
+ for ( int i = 0; i < FPPlayers.Count(); i++ )
+ {
+ if ( FPPlayers[i].GetGUID() == guid )
+ {
+ auPlayer = FPPlayers[i];
+ break;
+ }
+ }
+
+ if ( auPlayer == NULL )
+ {
+ ref PlayerDataN data = new ref PlayerDataN;
+
+ data.SGUID = guid;
+
+ auPlayer = new ref FPPlayer( data );
+
+ FPPlayers.Insert( auPlayer );
+ }
+
+ return auPlayer;
+ }
+
+ ref FPPlayer GetPlayerByIdentity( PlayerIdentity ident )
+ {
+ if ( ident == NULL ) return NULL;
+
+ ref FPPlayer auPlayer = NULL;
+
+ for ( int i = 0; i < FPPlayers.Count(); i++ )
+ {
+ if ( FPPlayers[i].GetGUID() == ident.GetId() )
+ {
+ auPlayer = FPPlayers[i];
+ break;
+ }
+ }
+
+ if ( auPlayer == NULL )
+ {
+ auPlayer = PlayerJoined( ident );
+ }
+
+ return auPlayer
+ }
+
+ ref FPPlayer GetPlayer( ref PlayerDataN data )
+ {
+ if ( data == NULL ) return NULL;
+
+ ref FPPlayer auPlayer = NULL;
+
+ for ( int i = 0; i < FPPlayers.Count(); i++ )
+ {
+ if ( FPPlayers[i].GetGUID() == data.SGUID )
+ {
+ auPlayer = FPPlayers[i];
+ break;
+ }
+ }
+
+ if ( auPlayer == NULL )
+ {
+ auPlayer = new ref FPPlayer( data );
+
+ FPPlayers.Insert( auPlayer );
+ }
+
+ auPlayer.NewData( data );
+
+ auPlayer.ToPermData();
+
+ return auPlayer;
+ }
+
+ // NEW END
+ void AddLocation(string PosName, vector AdminPos)
+ {
+ RootTeleport.AddNewLocation(PosName, AdminPos)
+ }
+ void LoadTeleport()
+ {
+ RootTeleport.Load();
+ }
+
+ void RegisterNewconfig( string CfgName , string type, string data = "")
+ {
+ Print("RegisterNewconfig Data = " + data)
+ RootConfig.RegisterNewconfig( CfgName, type , data);
+ }
+
+ void PrintAllConfigs()
+ {
+ RootConfig.PrintAll();
+ }
+
+ void ConfigInitialize()
+ {
+ RootConfig.ConfigInitialize();
+ }
+
+
+ bool IsConfig( string CfgName)
+ {
+ bool iscfg = false;
+ iscfg = RootConfig.IsConfig(CfgName);
+ return iscfg;
+ }
+
+ string GetConfig( string CfgName)
+ {
+ string getConf = "";
+ getConf = RootConfig.GetConfigData(CfgName);
+ return getConf;
+ }
+
+ void CheckAndCreateFiles()
+ {
+ Print("DayZ-Sa-Tomato Checking File system");
+ CheckFolder(MainFolder);
+ CheckFolder(ConfigFolder);
+ CheckFolder(CustomizationFolder);
+ CheckFolder(LogFolder);
+
+ CheckFile(LKillsFile);
+ CheckFile(TeleportFile);
+ CheckFile(LErrorFile);
+ CheckFile(LDebugFile);
+ CheckFile(LInfoFile);
+ CheckFile(LAdminFile);
+ }
+
+
+
+ void CheckFile(string File)
+ {
+ if(FileExist(File))
+ {
+ Print("FileHandler : File " + File + " found!");
+ }else
+ {
+ FileHandle file = OpenFile(File, FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, "");
+ CloseFile(file);
+ }
+ if(FileExist(File))
+ {
+ if(File == TeleportFile)
+ {
+ CreateTeleportFile();
+ }else
+ {
+ Print("FileHandler : File " + File + " Created");
+ }
+ }
+ }
+ }
+
+ void SetConfigType(string name, string stype)
+ {
+ ConfigType type
+ if(stype == "true"){type = ConfigType.true;}
+ else if (stype == "false"){type = ConfigType.false;}
+ else if (stype == "custom"){type = ConfigType.custom;}
+
+ for ( int i = 0; i < RootConfig.Children.Count(); i++ )
+ {
+ if ( name == RootConfig.Children[i].ConfigName )
+ {
+ RootConfig.Children[i].SetConfigType(type);
+ }
+ }
+
+ RootConfig.WriteToFile();
+ }
+
+ void SetConfigData(string name, string data)
+ {
+ for ( int i = 0; i < RootConfig.Children.Count(); i++ )
+ {
+ if ( name == RootConfig.Children[i].ConfigName )
+ {
+ RootConfig.Children[i].SetConfigData(data);
+ }
+ }
+ RootConfig.WriteToFile();
+ }
+
+ void CheckFolder(string Folder)
+ {
+ if(FileExist(Folder))
+ {
+ Print("FileHandler : Folder " + Folder + " found!");
+ }else
+ {
+ MakeDirectory(Folder);
+ if(FileExist(Folder))
+ {
+ Print("FileHandler : Folder " + Folder + " Created");
+ }
+ }
+ }
+
+ void CreateTeleportFile()
+ {
+ FileHandle file = OpenFile(TeleportFile, FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, "Prison Island = 2651.42 0.0 1395.8");
+ FPrintln(file, "Mogilevka = 7572.65 0.0 5182.3");
+ FPrintln(file, "Stary Sobor = 6192.39 0.0 7666.5");
+ FPrintln(file, "Msta = 11206.6 0.0 5398.70");
+ FPrintln(file, "Solnichniy = 13436.5 0.0 6158.7");
+ FPrintln(file, "Chernogorsk = 6350.99 0.0 2666.12");
+ FPrintln(file, "Elektrogorsk = 10432.1 0.0 2218.56");
+ FPrintln(file, "Berezino = 12661.4 0.0 9465.03");
+ FPrintln(file, "Tisy = 1890.45 0.0 13704.6");
+ FPrintln(file, "Gorka = 9678.94 0.0 8828.93");
+ FPrintln(file, "Balota = 4546.92 0.0 2416.4");
+ FPrintln(file, "Vybor = 3916.85 0.0 8795.59");
+ FPrintln(file, "Severograd = 8318.51 0.0 12743.4");
+ FPrintln(file, "North West Airfield = 4835.59 0.0 9667.72");
+ FPrintln(file, "Green Mountain = 3752.08 0.0 6002.94");
+ FPrintln(file, "Zelenogorsk = 2542.18 0.0 4994.26");
+ FPrintln(file, "Tisy Military Base = 1599.15 0.0 14166.66");
+ FPrintln(file, "Pavlovo Military Base = 2047.82 0.0 3293.36");
+ CloseFile(file);
+ }
+ }
+}
+ref FileHandler Tomato_FileHandler;
+
+ref FileHandler GetFileHandler()
+{
+ if( !Tomato_FileHandler )
+ {
+ Tomato_FileHandler = new ref FileHandler();
+ }
+
+ return Tomato_FileHandler;
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/M_MissionGameplay.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/M_MissionGameplay.c
new file mode 100644
index 0000000..cd62514
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/M_MissionGameplay.c
@@ -0,0 +1,151 @@
+/*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+modded class MissionGameplay
+{
+ protected ref PermissionBase m_PermissionBase;
+ ref DevTeleport devTeleport;
+ ref LogHandler m_LogHandler;
+ // ref AdminMenuGui m_AdminMenuGui;
+ ref DevCam devCam;
+ ref AdminMenu adminMenu;
+ ref TeleportData Tdata;
+ ref AdminMenuManager adminMenuManager;
+ bool isSpectating = false;
+ bool MenuOpen = false;
+
+ void MissionGameplay()
+ {
+ Print( " Mission Gameplay Constructor ");
+ m_LogHandler = new ref LogHandler();
+ // m_AdminMenuGui = new ref AdminMenuGui();
+ // m_PermissionBase = new ref PermissionBase;
+ devTeleport = new DevTeleport();
+ devCam = new DevCam();
+ adminMenu = new AdminMenu();
+ adminMenuManager = new AdminMenuManager();
+ Tdata = new TeleportData();
+ }
+
+ void ~MissionGameplay()
+ {
+ delete Tdata;
+ delete m_LogHandler;
+ delete adminMenuManager;
+ delete adminMenu;
+ // delete m_PermissionBase;
+ }
+
+ override void OnInit()
+ {
+ super.OnInit();
+
+ Print( " Mission Gameplay ");
+ }
+
+ // override void OnMissionStart()
+ // {
+
+ // super.OnMissionStart();
+ // m_PermissionBase.OnStart();
+ // GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Player_UpdatePlayers, new Param1( "" ), false, NULL );
+ // }
+
+ override void OnMissionFinish()
+ {
+ // m_PermissionBase.OnFinish();
+ GetGame().GetUIManager().CloseMenu( MENU_INGAME );
+ super.OnMissionFinish();
+ }
+
+
+
+ // override void OnUpdate( float timeslice )
+ // {
+ // super.OnUpdate( timeslice );
+ // m_PermissionBase.OnUpdate( timeslice );
+ // }
+
+
+
+ override void OnKeyPress (int key )
+ {
+ super.OnKeyPress( key );
+ PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
+ if ( key == KeyCode.KC_N )
+ {
+ adminMenuManager.Teleport();
+ if ( GetGame().IsClient() )
+ {
+ }
+ }
+
+ if ( key == KeyCode.KC_DELETE )
+ {
+ if(adminMenuManager.Spectate)
+ {
+ adminMenuManager.CamSpectate(adminMenuManager.Spectate, "", false, vector.Zero, false);
+ adminMenuManager.Spectate = !adminMenuManager.Spectate;
+ return;
+ }
+
+ if(isSpectating)
+ {
+ adminMenuManager.CamTeleport( isSpectating, vector.Zero, false );
+ isSpectating = !isSpectating;
+ }
+
+ }
+
+ if ( key == KeyCode.KC_INSERT )
+ {
+ if(adminMenuManager.Spectate)
+ {
+ adminMenuManager.CamSpectate(adminMenuManager.Spectate, "", true, GetCursorPos(), false );
+ adminMenuManager.Spectate = !adminMenuManager.Spectate;
+ return;
+ }
+ adminMenuManager.CamTeleport( isSpectating, GetCursorPos() );
+ isSpectating = !isSpectating;
+ }
+ if ( key == KeyCode.KC_M )
+ {
+ if(GetGame().IsClient() || !GetGame().IsMultiplayer())
+ {
+ if ( player )
+ {
+ //GetGame().GetMission().OnEvent(ChatMessageEventTypeID, new ChatMessageEventParams(0, "", "DayZ-Sa-Tomato", ""));
+ Widget widget = g_Game.GetUIManager().GetWidgetUnderCursor();
+ // Print("TL funx");
+ // TL().playerSetup();
+ adminMenuManager.MenuOpen();
+ }
+ }
+ }
+ }
+}
+
+//Mission CreateCustomMission(string path)
+// {
+ // if ( GetGame().IsServer() && GetGame().IsMultiplayer() ) {
+ // return new CustomMission(); // this always runs because createcustommission isnt a client side function
+ // }
+ // return new MissionGameplay();
+// }
+//class, function, params
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/M_MissionServer.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/M_MissionServer.c
new file mode 100644
index 0000000..0ce30f2
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/M_MissionServer.c
@@ -0,0 +1,392 @@
+/*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+modded class MissionServer
+{
+ protected ref PermissionBase m_PermissionBase;
+ protected ref ConfigModule m_ConfigModule;
+ protected ref TeleportModule m_TeleportModule;
+ protected ref FileHandler m_FileHandler;
+ protected ref HordeModule m_HordeModule;
+ protected bool m_bLoaded;
+ //ref LogHandler m_LogHandler;
+ ref DevTeleport devTeleport;
+ ref AdminMenu adminMenu;
+ ref DevCam devCam;
+ ref TeleportData Tdata;
+ ref ChatModules m_ChatModule;
+ //admin list
+ ref PlayerModule PModule;
+ PlayerBase Admin = NULL;
+ void MissionServer()
+ {
+ //m_LogHandler = new ref LogHandler();
+ m_FileHandler = new ref FileHandler();
+ m_HordeModule = new ref HordeModule();
+ m_PermissionBase = new ref PermissionBase;
+ m_ConfigModule = new ref ConfigModule;
+ m_ChatModule = new ref ChatModules;
+ m_TeleportModule = new ref TeleportModule;
+ Print( "Dayz-Sa-Tomato initialized .." );
+ devTeleport = new DevTeleport();
+ PModule = new PlayerModule();
+ adminMenu = new AdminMenu();
+ devCam = new DevCam();
+ //Tdata = new TeleportData();
+ }
+
+ void ~MissionServer()
+ {
+
+ delete PModule;
+ delete adminMenu;
+ delete m_PermissionBase;
+ Print( "CommunityOfflineServer::~CommunityOfflineServer()" );
+ }
+
+
+
+ override void OnEvent(EventType eventTypeId, Param params)
+ {
+ super.OnEvent(eventTypeId,params);
+ //PlayerIdentity identity;
+ switch(eventTypeId)
+ {
+ case ChatMessageEventTypeID:
+ Print("Chat Event");
+ ChatMessageEventParams chat_params = ChatMessageEventParams.Cast(params);
+ //chat_params.param1 == 0 &&
+ if (chat_params.param2 != "") //trigger only when channel is Global == 0 and Player Name does not equal to null
+ {
+ Param4 request_info = new Param4(chat_params.param1, chat_params.param2, chat_params.param3, chat_params.param4);
+ GetChatModule().ChatHandler(request_info); //Send the param to Admintools
+ }
+ break;
+ }
+ }
+
+
+ override void TickScheduler(float timeslice)
+ {
+ GetGame().GetWorld().GetPlayerList(m_Players);
+ if( m_Players.Count() == 0 ) return;
+ for(int i = 0; i < SCHEDULER_PLAYERS_PER_TICK; i++)
+ {
+ if(m_currentPlayer >= m_Players.Count() )
+ {
+ m_currentPlayer = 0;
+ }
+
+ PlayerBase currentPlayer = PlayerBase.Cast(m_Players.Get(m_currentPlayer));
+ string PlayerName;
+ PlayerIdentity PlayerIdent;
+ string PlayerSteam64ID;
+ vector PlayerPos;
+
+ PlayerIdent = currentPlayer.GetIdentity();
+ PlayerName = PlayerIdent.GetName();
+ PlayerSteam64ID = PlayerIdent.GetPlainId();
+ PlayerPos = currentPlayer.GetPosition();
+ currentPlayer.OnTick();
+
+ if(GetFileHandler().HasPermission("DisableStamina", PlayerIdent)
+ {
+ currentPlayer.GetStaminaHandler().SyncStamina(1000,1000);
+ currentPlayer.GetStatStamina().Set(currentPlayer.GetStaminaHandler().GetStaminaCap());
+ }
+
+ m_currentPlayer++;
+
+
+ }
+ }
+
+ void SendPosTOAdmins()
+ {
+ int m_currentPlayer1;
+ array players = new array;
+ GetGame().GetPlayers( players );
+
+ for (int i = 0; i < players.Count(); ++i)
+ {
+ if(m_currentPlayer1 >= m_Players.Count() )
+ {
+ m_currentPlayer1 = 0;
+ }
+ PlayerBase currentPlayer = PlayerBase.Cast(m_Players.Get(m_currentPlayer1));
+ string PlayerName;
+ PlayerIdentity PlayerIdent;
+ string PlayerSteam64ID;
+ PlayerIdent = currentPlayer.GetIdentity();
+ PlayerName = PlayerIdent.GetName();
+ PlayerSteam64ID = PlayerIdent.GetPlainId();
+ vector pos;
+
+ pos = currentPlayer.GetPosition();
+ //SendPosToAdmins(PlayerName, pos);
+ m_currentPlayer1++;
+
+ int m_currentPlayer2;
+ array players1 = new array;
+ GetGame().GetPlayers( players1 );
+
+ for (int i1 = 0; i1 < players1.Count(); ++i1)
+ {
+ if(m_currentPlayer2 >= m_Players.Count() )
+ {
+ m_currentPlayer2 = 0;
+ }
+ PlayerBase currentPlayer1 = PlayerBase.Cast(m_Players.Get(m_currentPlayer2));
+ string AdminPlayerName1;
+ PlayerIdentity AdminIdent1;
+ string PlayerSteam64ID1;
+ AdminIdent1 = currentPlayer1.GetIdentity();
+ AdminPlayerName1 = AdminIdent1.GetName();
+ PlayerSteam64ID1 = AdminIdent1.GetPlainId();
+ if (GetFileHandler().HasPermission("Admin", AdminIdent1))
+ {
+ ScriptRPC PPos = new ScriptRPC();
+ PPos.Write(PlayerName);
+ PPos.Write(pos);
+ PPos.Send(NULL, M_RPCs.M_Admin_Menu_Map_Player, false, AdminIdent1);
+ }
+ m_currentPlayer2++;
+ }
+
+
+ }
+ }
+
+
+ PlayerBase IsAdminID(string name, PlayerIdentity ID )
+ {
+ GetGame().GetWorld().GetPlayerList(m_Players);
+ array players = new array;
+ GetGame().GetPlayers( players );
+ PlayerIdentity CurIdent;
+ string id;
+ int Count = 0;
+ for (int i = 0; i < players.Count(); ++i)
+ {
+ PlayerBase currentPlayer = PlayerBase.Cast(m_Players.Get(i));
+ CurIdent = currentPlayer.GetIdentity();
+ if(GetFileHandler().HasPermission("Admin", ID) && CurIdent.GetName() == name )
+ {
+ Admin = currentPlayer;
+ break;
+ }else
+ {
+ Admin = NULL;
+ }
+ Count ++;
+ }
+ return Admin;
+ }
+
+ ref Man GetPlayerFromIdentity( PlayerIdentity identity )
+ {
+ foreach( ref Man manBase : m_Players )
+ {
+ if ( manBase.GetIdentity().GetPlayerId() == identity.GetPlayerId() )
+ {
+ return manBase;
+ }
+ }
+ return NULL;
+ }
+
+ override void OnInit()
+ {
+ super.OnInit();
+ m_ConfigModule.Init();
+ m_TeleportModule.Init();
+
+ }
+
+ override void OnMissionStart()
+ {
+ super.OnMissionStart();
+
+ m_PermissionBase.OnStart();
+ }
+
+ override void OnMissionFinish()
+ {
+ m_PermissionBase.OnFinish();
+
+ super.OnMissionFinish();
+ }
+
+ override void OnPreloadEvent(PlayerIdentity identity, out bool useDB, out vector pos, out float yaw, out int queueTime)
+ {
+ super.OnPreloadEvent( identity, useDB, pos, yaw, queueTime );
+ GetFileHandler().GetPlayerByIdentity( identity );
+ }
+
+ override void InvokeOnConnect( PlayerBase player, PlayerIdentity identity)
+ {
+ super.InvokeOnConnect( player, identity );
+ GetFileHandler().GetPlayerByIdentity( identity );
+
+ GetGame().SelectPlayer( identity, player );
+ }
+
+ override void InvokeOnDisconnect( PlayerBase player )
+ {
+ GetFileHandler().PlayerLeft( player.GetIdentity() );
+
+ super.InvokeOnDisconnect( player );
+ }
+
+ void OnMissionLoaded()
+ {
+
+ }
+
+ override void OnUpdate( float timeslice )
+ {
+ super.OnUpdate( timeslice );
+
+ //m_PermissionBase.OnUpdate( timeslice );
+ }
+
+ void CLogInfo(string log)
+ {
+ int year, month, day, hour, minute, second;
+ GetYearMonthDay(year, month, day);
+ GetHourMinuteSecond(hour, minute, second);
+
+ string date = day.ToStringLen(2) + "." + month.ToStringLen(2) + "." + year.ToStringLen(4) + " " + hour.ToStringLen(2) + ":" + minute.ToStringLen(2);
+ Print(log);
+ if(FileExist("$profile:\\TomatoLog"))
+ {
+ FileHandle file = OpenFile("$profile:\\TomatoLog\\Info.log", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, "[" + date + "] - " + log);
+ CloseFile(file);
+ }
+ }else{
+ MakeDirectory("$profile:\\TomatoLog");
+ FileHandle file2 = OpenFile("$profile:\\TomatoLog\\Info.log", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, "[" + date + "] - " + log);
+ CloseFile(file);
+ }
+ }
+ }
+
+ void CLogRPC(string log)
+ {
+ int year, month, day, hour, minute, second;
+ GetYearMonthDay(year, month, day);
+ GetHourMinuteSecond(hour, minute, second);
+
+ string date = day.ToStringLen(2) + "." + month.ToStringLen(2) + "." + year.ToStringLen(4) + " " + hour.ToStringLen(2) + ":" + minute.ToStringLen(2);
+ Print(log);
+ if(FileExist("$profile:\\TomatoLog"))
+ {
+ FileHandle file = OpenFile("$profile:\\TomatoLog\\RPC.log", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, "[" + date + "] - " + log);
+ CloseFile(file);
+ }
+ }else{
+ MakeDirectory("$profile:\\TomatoLog");
+ FileHandle file2 = OpenFile("$profile:\\TomatoLog\\RPC.log", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, "[" + date + "] - " + log);
+ CloseFile(file);
+ }
+ }
+ }
+
+ void CLogStartup(string log)
+ {
+ int year, month, day, hour, minute, second;
+ GetYearMonthDay(year, month, day);
+ GetHourMinuteSecond(hour, minute, second);
+
+ string date = day.ToStringLen(2) + "." + month.ToStringLen(2) + "." + year.ToStringLen(4) + " " + hour.ToStringLen(2) + ":" + minute.ToStringLen(2);
+ Print(log);
+ if(FileExist("$profile:\\TomatoLog"))
+ {
+ FileHandle file = OpenFile("$profile:\\TomatoLog\\Startup.log", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, "[" + date + "] - " + log);
+ CloseFile(file);
+ }
+ }else{
+ MakeDirectory("$profile:\\TomatoLog");
+ FileHandle file2 = OpenFile("$profile:\\TomatoLog\\Startup.log", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, "[" + date + "] - " + log);
+ CloseFile(file);
+ }
+ }
+ }
+
+ void CLogDebug(string log)
+ {
+ int year, month, day, hour, minute, second;
+ GetYearMonthDay(year, month, day);
+ GetHourMinuteSecond(hour, minute, second);
+
+ string date = day.ToStringLen(2) + "." + month.ToStringLen(2) + "." + year.ToStringLen(4) + " " + hour.ToStringLen(2) + ":" + minute.ToStringLen(2);
+ Print(log);
+ if(FileExist("$profile:\\TomatoLog"))
+ {
+ FileHandle file = OpenFile("$profile:\\TomatoLog\\Debug.log", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, "[" + date + "] - " + log);
+ CloseFile(file);
+ }
+ }else{
+ MakeDirectory("$profile:\\TomatoLog");
+ FileHandle file2 = OpenFile("$profile:\\TomatoLog\\Debug.log", FileMode.APPEND);
+ if (file != 0)
+ {
+ FPrintln(file, "[" + date + "] - " + log);
+ CloseFile(file);
+ }
+ }
+ }
+
+
+ // void InitHive()
+ // {
+ // Hive oHive = GetHive();
+
+ // if( !oHive )
+ // {
+ // oHive = CreateHive();
+ // }
+
+ // if( oHive )
+ // {
+ // oHive.InitOffline();
+ // }
+ // }
+}
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/core/KeyMouseBinding.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/core/KeyMouseBinding.c
new file mode 100644
index 0000000..86f943d
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/core/KeyMouseBinding.c
@@ -0,0 +1,245 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+ Originally from DayZCommunityOfflineMode
+ Link : https://github.com/Arkensor/DayZCommunityOfflineMode
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+class KeyMouseBinding
+{
+ const int KB_EVENT_PRESS = 0;
+ const int KB_EVENT_RELEASE = 1;
+ const int KB_EVENT_HOLD = 2;
+
+ const int MB_EVENT_PRESS = 0;
+ const int MB_EVENT_CLICK = 1;
+ const int MB_EVENT_RELEASE = 2;
+ const int MB_EVENT_DOUBLECLICK = 3;
+ const int MB_EVENT_DRAG = 4;
+ const int MB_EVENT_HOLD = 5;
+
+ protected typename m_Object;
+ protected ref map m_KeyBinds;
+ protected ref map m_MouseBinds;
+ protected string m_strCallbackFunction;
+ protected string m_strShortcut;
+ protected string m_strDescription;
+ protected bool canUseInMenu;
+
+ void KeyMouseBinding( typename object, string callback, string shortcut, string description, bool menu = false )
+ {
+ m_Object = object;
+ m_KeyBinds = new map< int, int >;
+ m_MouseBinds = new map< int, int >;
+
+ m_strCallbackFunction = callback;
+ m_strShortcut = shortcut;
+ m_strDescription = description;
+
+ canUseInMenu = menu;
+ }
+
+ bool canUseInMenu()
+ {
+ return canUseInMenu;
+ }
+
+ bool Check()
+ {
+ bool k_m_Pressed = true;
+ for ( int kb = 0; kb < m_KeyBinds.Count(); ++kb )
+ {
+ int keyCode = m_KeyBinds.GetKey(kb);
+ int keyEvent = m_KeyBinds.Get(keyCode);
+
+ if ( keyEvent == KB_EVENT_RELEASE )
+ { // Skip checking for release keys
+ continue;
+ }
+ if ( KeyState( keyCode ) == 0 )
+ {
+ k_m_Pressed = false;
+ }
+ }
+
+ for ( int mb = 0; mb < m_MouseBinds.Count(); ++mb )
+ {
+ int mouseButton = m_MouseBinds.GetKey(mb);
+ int mouseEvent = m_MouseBinds.Get(mouseButton);
+
+ if ( mouseEvent == MB_EVENT_RELEASE || mouseEvent == MB_EVENT_CLICK || mouseEvent == MB_EVENT_DOUBLECLICK || mouseButton == MouseState.WHEEL || mouseEvent == MB_EVENT_DRAG )
+ {
+ continue; // Skip checking for release buttons, click or double click, or mouse drag/wheel (handled else where)
+ }
+ if ( !(GetMouseState( mouseButton ) & MB_PRESSED_MASK ) )
+ {
+ k_m_Pressed = false;
+ }
+ }
+ return k_m_Pressed;
+ }
+
+ bool IsRecurring() // Recurring if both mouse or keys are hold, drag OR wheel
+ {
+ bool recurring = true;
+
+ for ( int kb = 0; kb < m_KeyBinds.Count(); ++kb )
+ {
+ int keyCode = m_KeyBinds.GetKey(kb);
+ int keyEvent = m_KeyBinds.Get(keyCode);
+
+
+ if ( keyEvent != KB_EVENT_HOLD )
+ {
+ return false; // a key is found that is not hold or drag. so it should not be recurring
+ }
+ }
+
+ for ( int mb = 0; mb < m_MouseBinds.Count(); ++mb )
+ {
+ int mouseButton = m_MouseBinds.GetKey(mb);
+ int mouseEvent = m_MouseBinds.Get(mouseButton);
+
+ if ( mouseEvent != MB_EVENT_DRAG && mouseEvent != MB_EVENT_HOLD && mouseButton != MouseState.WHEEL )
+ {
+ return false;
+ }
+ }
+
+
+ return recurring;
+ }
+
+ bool IsHold()
+ {
+ bool release = false;
+
+ for ( int kb = 0; kb < GetKeyBinds().Count(); ++kb)
+ {
+ int keyCode = m_KeyBinds.GetKey(kb);
+ int keyEvent = m_KeyBinds.Get(keyCode);
+
+ if ( keyEvent == KB_EVENT_RELEASE )
+ {
+
+ }
+ }
+
+ return ( m_KeyBinds.GetKeyByValue(KB_EVENT_RELEASE) || m_MouseBinds.GetKeyByValue(MB_EVENT_RELEASE) );
+ }
+
+ bool HasKeyEvent( int key_Event )
+ {
+ for ( int kb = 0; kb < GetKeyBinds().Count(); ++kb)
+ {
+ int keyCode = m_KeyBinds.GetKey(kb);
+ int keyEvent = m_KeyBinds.Get(keyCode);
+
+ if ( keyEvent == key_Event )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ bool ContainsKey( int key )
+ {
+ return m_KeyBinds.Contains( key );
+ }
+
+ bool ContainsButton( int button )
+ {
+ return m_MouseBinds.Contains( button );
+ }
+
+ bool ContainsKeyEvent( int key, int key_Event )
+ {
+ int kc = -1;
+ for ( int kb = 0; kb < GetKeyBinds().Count(); ++kb)
+ {
+ int keyCode = m_KeyBinds.GetKey(kb);
+ int keyEvent = m_KeyBinds.Get(keyCode);
+
+ if ( keyCode == key && keyEvent == key_Event )
+ {
+ kc = keyCode;
+ }
+ }
+
+ return kc > -1;
+ }
+
+ bool ContainsButtonEvent( int button, int button_Event )
+ {
+ int m = -1;
+ for ( int mb = 0; mb < GetMouseBinds().Count(); ++mb)
+ {
+ int mouseBind = m_MouseBinds.GetKey(mb);
+ int mouseEvemt = m_MouseBinds.Get(mouseBind);
+
+ if ( mouseBind == button && mouseEvemt == button_Event )
+ {
+ m = mouseBind;
+ }
+ }
+
+ return m > -1;
+ }
+
+ void AddKeyBind( int key, int key_event )
+ {
+ m_KeyBinds.Insert( key, key_event );
+ }
+
+ void AddMouseBind( int button, int mouse_event )
+ {
+ m_MouseBinds.Insert( button, mouse_event );
+ }
+
+ ref map GetKeyBinds()
+ {
+ return m_KeyBinds;
+ }
+
+ ref map GetMouseBinds()
+ {
+ return m_MouseBinds;
+ }
+
+ typename GetObject()
+ {
+ return m_Object;
+ }
+
+ string GetShortcut()
+ {
+ return m_strShortcut;
+ }
+
+ string GetDescription()
+ {
+ return m_strDescription;
+ }
+
+ string GetCallBackFunction()
+ {
+ return m_strCallbackFunction;
+ }
+
+}
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/core/StaticFunctions.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/core/StaticFunctions.c
new file mode 100644
index 0000000..98da41e
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/core/StaticFunctions.c
@@ -0,0 +1,454 @@
+ /*
+ DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
+ Copyright (C) 2018 DayZ-SA-Tomato
+
+ This file is part of DayZ SA Tomato.
+ Originally from DayZCommunityOfflineMode
+ Link : https://github.com/Arkensor/DayZCommunityOfflineMode
+
+ DayZ SA Tomato is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ DayZ SA Tomato is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DayZ SA Tomato. If not, see .
+ */
+static string FormatFloat( float value, int decimals )
+{
+ string result = "";
+ array output = new array;
+
+ value.ToString().Split(".", output);
+
+ if ( output.Count() == 0 ) return value.ToString();
+
+ if ( decimals == 0 ) return output.Get(0);
+
+ string right = output.Get(1).Substring(0, decimals);
+ result = output.Get(0) + "." + right;
+
+ return result;
+}
+
+static string VectorToString( vector vec )
+{
+ string result = vec.ToString();
+ result.Replace( "<", "" );
+ result.Replace( ">", "" );
+ result.Replace( ",", "" );
+
+ return result;
+}
+
+static string VectorToString( vector vec, int decimals )
+{
+ string result = "";
+ result = FormatFloat(vec[0], decimals) + "|" + FormatFloat(vec[1], decimals) + "|" + FormatFloat(vec[2], decimals);
+
+ return result;
+}
+
+static TStringArray GetChildrenFromBaseClass( string strConfigName, string strBaseClass )
+{
+ string child_name = "";
+ int count = GetGame().ConfigGetChildrenCount ( strConfigName );
+ TStringArray class_names = new TStringArray;
+
+ for (int p = 0; p < count; p++)
+ {
+ GetGame().ConfigGetChildName ( strConfigName, p, child_name );
+
+ if ( GetGame().IsKindOf(child_name, strBaseClass ) && ( child_name != strBaseClass ) )
+ {
+ class_names.Insert(child_name);
+ }
+ }
+
+ return class_names;
+}
+
+static TVectorArray GetSpawnPoints()
+{
+ return { "15135.1 0 13901.1", "15017.8 0 13892.4", "14887.1 0 14547.9", "14749.7 0 13248.7",
+ "14697.6 0 13418.4", "14537.3 0 14755.7", "14415.3 0 14025.2", "14338.0 0 12859.5",
+ "14263.8 0 12748.7", "14172.2 0 12304.9", "14071.4 0 12033.3", "14054.9 0 11341.3",
+ "14017.8 0 2959.1", "13905.5 0 12489.7", "13852.4 0 11686.0", "13846.6 0 12050.0",
+ "13676.0 0 12262.1", "13617.4 0 12759.8", "13610.1 0 11223.6", "13594.3 0 4064.0",
+ "13587.8 0 6026.5", "13571.1 0 3056.8", "13552.6 0 4653.7", "13529.9 0 3968.3",
+ "13520.8 0 4223.7", "13504.0 0 5004.5", "13476.7 0 6136.3", "13441.6 0 5262.2",
+ "13426.6 0 5747.3", "13416.8 0 11840.4", "13400.8 0 4120.7", "13395.8 0 5902.8",
+ "13385.0 0 3946.6", "13374.4 0 6454.3", "13367.1 0 10837.1", "13366.3 0 4906.0",
+ "13337.1 0 5120.8", "13326.7 0 5489.1", "13312.7 0 6771.1", "13288.7 0 11415.1",
+ "13261.6 0 11785.2", "13171.6 0 6534.8", "13159.8 0 5401.7", "13155.2 0 5475.2",
+ "13084.9 0 7938.6", "13056.8 0 4848.5", "13048.1 0 8357.6", "13048.1 0 3867.7",
+ "12991.7 0 7287.1", "12983.0 0 5539.1", "12978.9 0 9727.8", "12950.2 0 5226.7",
+ "12942.1 0 8393.1", "12891.5 0 3673.9", "12628.7 0 10495.2", "12574.3 0 3592.8",
+ "12566.3 0 6682.6", "12465.2 0 8009.0", "12354.5 0 3480.0", "13262.8 0 7225.8" };
+}
+
+static TStringArray WorkingZombieClasses()
+{
+ return { "ZmbM_HermitSkinny_Base","ZmbM_HermitSkinny_Beige","ZmbM_HermitSkinny_Black","ZmbM_HermitSkinny_Green",
+ "ZmbM_HermitSkinny_Red","ZmbM_FarmerFat_Base","ZmbM_FarmerFat_Beige","ZmbM_FarmerFat_Blue","ZmbM_FarmerFat_Brown",
+ "ZmbM_FarmerFat_Green","ZmbF_CitizenANormal_Base","ZmbF_CitizenANormal_Beige","ZmbF_CitizenANormal_Brown",
+ "ZmbF_CitizenANormal_Blue","ZmbM_CitizenASkinny_Base","ZmbM_CitizenASkinny_Blue","ZmbM_CitizenASkinny_Brown",
+ "ZmbM_CitizenASkinny_Grey","ZmbM_CitizenASkinny_Red","ZmbM_CitizenBFat_Base","ZmbM_CitizenBFat_Blue","ZmbM_CitizenBFat_Red",
+ "ZmbM_CitizenBFat_Green","ZmbF_CitizenBSkinny_Base","ZmbF_CitizenBSkinny","ZmbM_PrisonerSkinny_Base","ZmbM_PrisonerSkinny",
+ "ZmbM_FirefighterNormal_Base","ZmbM_FirefighterNormal","ZmbM_FishermanOld_Base","ZmbM_FishermanOld_Blue","ZmbM_FishermanOld_Green",
+ "ZmbM_FishermanOld_Grey","ZmbM_FishermanOld_Red","ZmbM_JournalistSkinny_Base","ZmbM_JournalistSkinny","ZmbF_JournalistNormal_Base",
+ "ZmbF_JournalistNormal_Blue","ZmbF_JournalistNormal_Green","ZmbF_JournalistNormal_Red","ZmbF_JournalistNormal_White",
+ "ZmbM_ParamedicNormal_Base","ZmbM_ParamedicNormal_Blue","ZmbM_ParamedicNormal_Green","ZmbM_ParamedicNormal_Red",
+ "ZmbM_ParamedicNormal_Black","ZmbF_ParamedicNormal_Base","ZmbF_ParamedicNormal_Blue","ZmbF_ParamedicNormal_Green",
+ "ZmbF_ParamedicNormal_Red","ZmbM_HikerSkinny_Base","ZmbM_HikerSkinny_Blue","ZmbM_HikerSkinny_Green","ZmbM_HikerSkinny_Yellow",
+ "ZmbF_HikerSkinny_Base","ZmbF_HikerSkinny_Blue","ZmbF_HikerSkinny_Grey","ZmbF_HikerSkinny_Green","ZmbF_HikerSkinny_Red",
+ "ZmbM_HunterOld_Base","ZmbM_HunterOld_Autumn","ZmbM_HunterOld_Spring","ZmbM_HunterOld_Summer","ZmbM_HunterOld_Winter",
+ "ZmbF_SurvivorNormal_Base","ZmbF_SurvivorNormal_Blue","ZmbF_SurvivorNormal_Orange","ZmbF_SurvivorNormal_Red",
+ "ZmbF_SurvivorNormal_White","ZmbM_SurvivorDean_Base","ZmbM_SurvivorDean_Black","ZmbM_SurvivorDean_Blue","ZmbM_SurvivorDean_Grey",
+ "ZmbM_PolicemanFat_Base","ZmbM_PolicemanFat","ZmbF_PoliceWomanNormal_Base","ZmbF_PoliceWomanNormal","ZmbM_PolicemanSpecForce_Base",
+ "ZmbM_PolicemanSpecForce","ZmbM_SoldierNormal_Base","ZmbM_SoldierNormal","ZmbM_usSoldier_normal_Base",
+ "ZmbM_usSoldier_normal_Woodland","ZmbM_usSoldier_normal_Desert","ZmbM_CommercialPilotOld_Base","ZmbM_CommercialPilotOld_Blue",
+ "ZmbM_CommercialPilotOld_Olive","ZmbM_CommercialPilotOld_Brown","ZmbM_CommercialPilotOld_Grey","ZmbM_PatrolNormal_Base",
+ "ZmbM_PatrolNormal_PautRev","ZmbM_PatrolNormal_Autumn","ZmbM_PatrolNormal_Flat","ZmbM_PatrolNormal_Summer","ZmbM_JoggerSkinny_Base",
+ "ZmbM_JoggerSkinny_Blue","ZmbM_JoggerSkinny_Green","ZmbM_JoggerSkinny_Red","ZmbF_JoggerSkinny_Base","ZmbF_JoggerSkinny_Blue",
+ "ZmbF_JoggerSkinny_Brown","ZmbF_JoggerSkinny_Green","ZmbF_JoggerSkinny_Red","ZmbM_MotobikerFat_Base","ZmbM_MotobikerFat_Beige",
+ "ZmbM_MotobikerFat_Black","ZmbM_MotobikerFat_Blue","ZmbM_VillagerOld_Base","ZmbM_VillagerOld_Blue","ZmbM_VillagerOld_Green",
+ "ZmbM_VillagerOld_White","ZmbM_SkaterYoung_Base","ZmbM_SkaterYoung_Blue","ZmbM_SkaterYoung_Brown","ZmbM_SkaterYoung_Green",
+ "ZmbM_SkaterYoung_Grey","ZmbF_SkaterYoung_Base","ZmbF_SkaterYoung_Brown","ZmbF_SkaterYoung_Striped","ZmbF_SkaterYoung_Violet",
+ "ZmbF_DoctorSkinny_Base","ZmbF_DoctorSkinny","ZmbF_BlueCollarFat_Base","ZmbF_BlueCollarFat_Blue","ZmbF_BlueCollarFat_Green",
+ "ZmbF_BlueCollarFat_Red","ZmbF_BlueCollarFat_White","ZmbF_MechanicNormal_Base","ZmbF_MechanicNormal_Beige","ZmbF_MechanicNormal_Green",
+ "ZmbF_MechanicNormal_Grey","ZmbF_MechanicNormal_Orange","ZmbM_MechanicSkinny_Base","ZmbM_MechanicSkinny_Blue","ZmbM_MechanicSkinny_Grey",
+ "ZmbM_MechanicSkinny_Green","ZmbM_MechanicSkinny_Red","ZmbM_ConstrWorkerNormal_Base","ZmbM_ConstrWorkerNormal_Beige",
+ "ZmbM_ConstrWorkerNormal_Black","ZmbM_ConstrWorkerNormal_Green","ZmbM_ConstrWorkerNormal_Grey","ZmbM_HeavyIndustryWorker_Base",
+ "ZmbM_HeavyIndustryWorker","ZmbM_OffshoreWorker_Base","ZmbM_OffshoreWorker_Green","ZmbM_OffshoreWorker_Orange","ZmbM_OffshoreWorker_Red",
+ "ZmbM_OffshoreWorker_Yellow","ZmbF_NurseFat_Base","ZmbF_NurseFat","ZmbM_HandymanNormal_Base","ZmbM_HandymanNormal_Beige",
+ "ZmbM_HandymanNormal_Blue","ZmbM_HandymanNormal_Green","ZmbM_HandymanNormal_Grey","ZmbM_HandymanNormal_White","ZmbM_DoctorFat_Base",
+ "ZmbM_DoctorFat","ZmbM_Jacket_Base","ZmbM_Jacket_beige","ZmbM_Jacket_black","ZmbM_Jacket_blue","ZmbM_Jacket_bluechecks",
+ "ZmbM_Jacket_brown","ZmbM_Jacket_greenchecks","ZmbM_Jacket_grey","ZmbM_Jacket_khaki","ZmbM_Jacket_magenta","ZmbM_Jacket_stripes",
+ "ZmbF_PatientOld_Base","ZmbF_PatientOld","ZmbM_PatientSkinny_Base","ZmbM_PatientSkinny","ZmbF_ShortSkirt_Base","ZmbF_ShortSkirt_beige",
+ "ZmbF_ShortSkirt_black","ZmbF_ShortSkirt_brown","ZmbF_ShortSkirt_green","ZmbF_ShortSkirt_grey","ZmbF_ShortSkirt_checks",
+ "ZmbF_ShortSkirt_red","ZmbF_ShortSkirt_stripes","ZmbF_ShortSkirt_white","ZmbF_ShortSkirt_yellow","ZmbF_VillagerOld_Base",
+ "ZmbF_VillagerOld_Blue","ZmbF_VillagerOld_Green","ZmbF_VillagerOld_Red","ZmbF_VillagerOld_White","ZmbM_Soldier","ZmbM_SoldierAlice",
+ "ZmbM_SoldierHelmet","ZmbM_SoldierVest","ZmbM_SoldierAliceHelmet","ZmbM_SoldierVestHelmet","ZmbF_MilkMaidOld_Base",
+ "ZmbF_MilkMaidOld_Beige","ZmbF_MilkMaidOld_Black","ZmbF_MilkMaidOld_Green","ZmbF_MilkMaidOld_Grey","ZmbM_priestPopSkinny_Base",
+ "ZmbM_priestPopSkinny","ZmbM_ClerkFat_Base","ZmbM_ClerkFat_Brown","ZmbM_ClerkFat_Grey","ZmbM_ClerkFat_Khaki","ZmbM_ClerkFat_White",
+ "ZmbF_Clerk_Normal_Base","ZmbF_Clerk_Normal_Blue","ZmbF_Clerk_Normal_White","ZmbF_Clerk_Normal_Green","ZmbF_Clerk_Normal_Red" };
+}
+
+static set< Object > GetObjectsAt( vector from, vector to, Object ignore = NULL, float radius = 0.5, Object with = NULL )
+{
+ vector contact_pos;
+ vector contact_dir;
+ int contact_component;
+
+ set< Object > geom = new set< Object >;
+ set< Object > view = new set< Object >;
+
+ DayZPhysics.RaycastRV( from, to, contact_pos, contact_dir, contact_component, geom, with, ignore, false, false, ObjIntersectGeom, radius );
+ DayZPhysics.RaycastRV( from, to, contact_pos, contact_dir, contact_component, view, with, ignore, false, false, ObjIntersectView, radius );
+
+ if ( geom.Count() > 0 )
+ {
+ return geom;
+ }
+ if ( view.Count() > 0 )
+ {
+ return view;
+ }
+ return NULL;
+}
+
+static Object GetPointerObject( Object ignore = NULL, float radius = 0.5, Object with = NULL )
+{
+ vector dir = GetGame().GetPointerDirection();
+
+ vector from = GetGame().GetCurrentCameraPosition();
+
+ vector to = from + ( dir * 10000 );
+
+ auto objs = GetObjectsAt( from, to, ignore, radius, with );
+
+ if( objs.Count() > 0 )
+ {
+ return objs[ 0 ];
+ }
+
+ return NULL;
+}
+
+static Object GetCursorObject()
+{
+ vector rayStart = GetGame().GetCurrentCameraPosition();
+ vector rayEnd = rayStart + GetGame().GetCurrentCameraDirection() * 10000;
+
+ auto objs = GetObjectsAt( rayStart, rayEnd );
+
+ if( objs.Count() > 0 )
+ {
+ return objs[ 0 ];
+ }
+
+ return NULL;
+}
+
+static vector GetPointerPos()
+{
+ if ( !GetPlayer() )
+ {
+ return "0 0 0";
+ }
+
+ vector dir = GetGame().GetPointerDirection();
+
+ vector from = GetGame().GetCurrentCameraPosition();
+
+ vector to = from + ( dir * 10000 );
+
+ vector rayStart = from;
+ vector rayEnd = to;
+ vector hitPos;
+ vector hitNormal;
+ int hitComponentIndex;
+ DayZPhysics.RaycastRV(rayStart, rayEnd, hitPos, hitNormal, hitComponentIndex, NULL, NULL, GetPlayer());
+
+ return hitPos;
+}
+
+static vector GetCursorPos()
+{
+ if ( !GetPlayer() )
+ {
+ return "0 0 0";
+ }
+
+ vector rayStart = GetGame().GetCurrentCameraPosition();
+ vector rayEnd = rayStart + GetGame().GetCurrentCameraDirection() * 10000;
+ vector hitPos;
+ vector hitNormal;
+ int hitComponentIndex;
+ DayZPhysics.RaycastRV(rayStart, rayEnd, hitPos, hitNormal, hitComponentIndex, NULL, NULL, GetPlayer());
+
+ return hitPos;
+}
+
+
+
+static Weapon GetWeaponInHands()
+{
+ Weapon weapon_in_hands;
+ if( GetPlayer() && GetPlayer().GetItemInHands() ) Class.CastTo(weapon_in_hands, GetPlayer().GetItemInHands());
+
+ return weapon_in_hands;
+}
+
+static MissionBase GetMission()
+{
+ return MissionBase.Cast( GetGame().GetMission() );
+}
+
+static void SetFreezePlayer( ref PlayerBase player, bool freeze )
+{
+ player.GetInputController().OverrideMovementSpeed( freeze, 0 );
+ player.GetInputController().OverrideAimChangeX( freeze, 0 );
+ player.GetInputController().OverrideAimChangeY( freeze, 0 );
+}
+
+static MissionServer GetServerMission()
+{
+ return MissionServer.Cast( GetGame().GetMission() );
+}
+
+static ref PlayerBase GetPlayer()
+{
+ return PlayerBase.Cast(GetGame().GetPlayer());
+}
+
+static bool SHIFT()
+{
+ return( ( KeyState( KeyCode.KC_LSHIFT ) > 0 ) || ( KeyState( KeyCode.KC_RSHIFT ) > 0 ) );
+}
+
+static bool CTRL()
+{
+ return( ( KeyState( KeyCode.KC_LCONTROL ) > 0 ) || ( KeyState( KeyCode.KC_RCONTROL ) > 0 ) );
+}
+
+static bool ALT()
+{
+ return( ( KeyState( KeyCode.KC_LMENU ) > 0 ) || ( KeyState( KeyCode.KC_RMENU ) > 0 ) );
+}
+
+static bool WINKEY()
+{
+ return( ( KeyState( KeyCode.KC_LWIN ) > 0 ) || ( KeyState( KeyCode.KC_RWIN ) > 0 ) );
+}
+
+static ZombieBase SpawnInfected(vector pos)
+{
+ return ZombieBase.Cast(GetGame().CreateObject( WorkingZombieClasses().GetRandomElement(), pos, false, true ));
+}
+
+/*
+static Weapon_Base CreateWeapon( PlayerBase oPlayer )
+{
+ Weapon_Base oWpn = Weapon_Base.Cast(oPlayer.GetInventory().CreateInInventory( "M4A1_Black" ));
+ oWpn.GetInventory().CreateAttachment( "M4_Suppressor" );
+ oWpn.GetInventory().CreateAttachment( "M4_RISHndgrd_Black" );
+ oWpn.GetInventory().CreateAttachment( "M4_MPBttstck_Black" );
+ oWpn.GetInventory().CreateAttachment( "ACOGOptic" );
+
+ return oWpn;
+}
+*/
+
+static Weapon_Base CreateWeapon( PlayerBase oPlayer, string sWeapon )
+{
+ Weapon_Base oWpn = Weapon_Base.Cast(oPlayer.GetInventory().CreateInInventory( sWeapon ));
+ oWpn.GetInventory().CreateAttachment( "PistolSuppressor" );
+ EntityAI optic = oWpn.GetInventory().CreateAttachment( "ReflexOptic" );
+ optic.GetInventory().CreateAttachment("Battery9V");
+
+ return oWpn;
+}
+
+static Magazine LoadMag( PlayerBase oPlayer, Weapon_Base oWpn )
+{
+ Magazine oMag = Magazine.Cast(oPlayer.GetInventory().CreateInInventory( "Mag_UMP_25Rnd" ));
+ oPlayer.GetWeaponManager().AttachMagazine( oMag );
+
+ return oMag;
+}
+
+static PlayerBase CreateCustomDefaultCharacter()
+{
+ PlayerBase oPlayer = PlayerBase.Cast( GetGame().CreatePlayer( NULL, GetGame().CreateRandomPlayer(), GetSpawnPoints().GetRandomElement(), 0, "NONE") );
+
+ EntityAI item = NULL;
+
+ item = oPlayer.GetInventory().CreateInInventory( "AviatorGlasses" );
+ item = oPlayer.GetInventory().CreateInInventory( "MilitaryBeret_UN" );
+ item = oPlayer.GetInventory().CreateInInventory( "M65Jacket_Black" );
+ item = oPlayer.GetInventory().CreateInInventory( "PlateCarrierHolster" );
+ item = oPlayer.GetInventory().CreateInInventory( "TacticalGloves_Black" );
+ item = oPlayer.GetInventory().CreateInInventory( "HunterPants_Autumn" );
+ item = oPlayer.GetInventory().CreateInInventory( "MilitaryBoots_Black" );
+ item = oPlayer.GetInventory().CreateInInventory( "AliceBag_Camo" );
+
+ item = oPlayer.GetInventory().CreateInInventory( "Mag_UMP_25Rnd" );
+
+ Weapon_Base oWpn = CreateWeapon(oPlayer, "UMP45");
+ LoadMag(oPlayer, oWpn);
+
+ oPlayer.LocalTakeEntityToHands( oWpn );
+ oPlayer.SetQuickBarEntityShortcut( oWpn, 0, true );
+
+ return oPlayer;
+}
+
+static string FileAttributeToString( FileAttr attr )
+{
+ string fileType = "";
+ if ( attr & FileAttr.DIRECTORY )
+ {
+ fileType = fileType + "DIRECTORY";
+ }
+ if ( attr & FileAttr.HIDDEN )
+ {
+ fileType = fileType + "HIDDEN";
+ }
+ if ( attr & FileAttr.READONLY )
+ {
+ fileType = fileType + "READONLY";
+ }
+ if ( attr & FileAttr.INVALID )
+ {
+ fileType = fileType + "INVALID";
+ }
+ return fileType;
+}
+
+static vector SnapToGround(vector pos)
+{
+ float pos_x = pos[0];
+ float pos_z = pos[2];
+ float pos_y = GetGame().SurfaceY( pos_x, pos_z );
+ vector tmp_pos = Vector( pos_x, pos_y, pos_z );
+ tmp_pos[1] = tmp_pos[1] + pos[1];
+
+ return tmp_pos;
+}
+
+static bool m_GodMode; // move these to player saves? Edit: Jacob says "yes"
+static bool m_OldAiming;
+static bool bc_Visible;
+
+static void SnapToGroundNew( Object object )
+{
+ vector pos = object.GetPosition();
+ pos[1] = GetGame().SurfaceY(pos[0], pos[2]);
+
+ vector clippingInfo[2];
+ vector objectBBOX[2];
+
+ object.GetCollisionBox( objectBBOX );
+ object.ClippingInfo( clippingInfo );
+
+ //float clipY = objectBBOX[1][1] / 2.0//- clippingInfo[0][1];
+ //pos[1] = pos[1] + objectBBOX[1][1] - clipY;
+ pos[1] = pos[1] + clippingInfo[1][1] / 2.0;//objectBBOX[0][1] - clipY
+
+ object.SetPosition(pos);
+
+ ForceTargetCollisionUpdate( object );
+}
+
+static void ForceTargetCollisionUpdate( Object oObj )
+{
+ if ( !oObj ) return;
+
+ vector roll = oObj.GetOrientation();
+ roll [ 2 ] = roll [ 2 ] - 1;
+ oObj.SetOrientation( roll );
+ roll [ 2 ] = roll [ 2 ] + 1;
+ oObj.SetOrientation( roll );
+}
+
+static void ToggleCursor()
+{
+ if ( GetGame().GetInput().HasGameFocus( INPUT_DEVICE_MOUSE ) )
+ {
+ GetGame().GetInput().ChangeGameFocus( 1 );
+ GetGame().GetUIManager().ShowUICursor( true );
+ }
+ else
+ {
+ GetGame().GetUIManager().ShowUICursor( false );
+ GetGame().GetInput().ResetGameFocus();
+ }
+}
+
+/*
+ Token types:
+ 0 - error, no token
+ 1 - defined token (special characters etc. . / * )
+ 2 - quoted string. Quotes are removed -> TODO
+ 3 - alphabetic string
+ 4 - number
+ 5 - end of line -> TODO
+*/
+static bool CheckStringType( string str, int type )
+{
+ for(int i = 0; i.
+ */
+class AdminMenu //extends UIScriptedMenu
+{
+ protected ref map m_TPLocations;
+ //ref UIScriptedMenu adminMenuGui;
+ //ref AdminMenuGui m_adMenu;
+ //ref AdminMenuMessage m_adMenuMessage;
+ //ref AdminMenuGuiMap m_map;
+ PlayerBase Admin;
+ PlayerIdentity AdminIdentity;
+ string AdminUID;
+ //ref AdminMenuManager AMenuM;
+ ref array m_Players;
+ //ref LogHandler m_LogHandler;
+
+
+
+
+ void AdminMenu()
+ {
+ GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
+ //m_LogHandler = new ref LogHandler();
+ //adminMenuMain = new AdminMenuMain();
+ }
+
+ void ~AdminMenu()
+ {
+ //delete AMenuM;
+ //delete m_adMenu;
+ //delete m_LogHandler;
+ }
+
+ void Message (string strMessage)
+ {
+ Param1 Msgparam1;
+ Msgparam1 = new Param1( strMessage );
+ GetGame().RPCSingleParam(Admin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam1, true, AdminIdentity);
+ }
+
+ void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
+ {
+ array players = new array;
+ GetGame().GetPlayers( players );
+ PlayerIdentity selectedIdentity;
+ PlayerBase selectedPlayer;
+ string strMessage;
+ Param1 Msgparam;
+ string PlayerName;
+ string cData;
+ ItemBase oItem = NULL;
+ PlayerIdentity AdminIdent;
+ string status;
+ bool ai = false;
+ int Count = 0;
+
+ int quantity = 0;
+ string text = "";
+
+
+
+ switch(rpc_type)
+ {
+
+ case (int)M_RPCs.M_Admin_Menu:
+ if ( GetGame().IsServer() )
+ {
+ Admin = GetServerMission().IsAdminID(sender.GetName(), sender);
+ if ( Admin != NULL)
+ {
+ AdminIdentity = Admin.GetIdentity();
+ AdminUID = AdminIdentity.GetId();
+ GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_OK, new Param1( "Test" ), false, AdminIdentity );
+ }
+ }
+ break;
+
+ case (int)M_RPCs.M_Admin_Menu_MessageBox:
+ Param1 MenuMessagep;
+ ctx.Read( MenuMessagep );
+ string MenuMessage = MenuMessagep.param1;
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ //GetAdminMenuManager.MessageMenu(MenuMessage);
+ // UIScriptedMenu adminMenuMessage = NULL;
+ // adminMenuMessage = new AdminMenuMessage(MenuMessage);
+
+ // if ( g_Game.GetUIManager().GetMenu() == NULL )
+ // {
+ // g_Game.GetUIManager().ShowScriptedMenu( adminMenuGui, NULL );
+ // }
+
+ // if ( g_Game.GetUIManager().IsMenuOpen(7001) )
+ // {
+ // g_Game.GetUIManager().CloseMenu(7001);
+ // g_Game.GetUIManager().ShowScriptedMenu( adminMenuMessage, NULL );
+ // }else{
+ // g_Game.GetUIManager().ShowScriptedMenu( adminMenuMessage, NULL );
+ // }
+ }
+ break;
+
+
+
+ case (int)M_RPCs.M_Admin_Menu_OK:
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ //UIScriptedMenu adminMenuGui = NULL;
+ //adminMenuGui = new AdminMenuGui();
+ UIScriptedMenu adminMenuGui = NULL;
+ adminMenuGui = new AdminMenuGui();
+ if ( g_Game.GetUIManager().GetMenu() == NULL )
+ {
+ g_Game.GetUIManager().ShowScriptedMenu( adminMenuGui, NULL );
+ }
+
+
+ // if ( g_Game.GetUIManager().IsMenuOpen(7000) )
+ // {
+ // if(!AMenuM.CanClose)
+ // {
+ // return;
+ // }
+
+
+ // g_Game.GetUIManager().HideScriptedMenu(adminMenuGui);
+
+ //g_Game.GetUIManager().Back();
+
+ // g_Game.GetUIManager().CloseMenu(7000);
+ // g_Game.GetUIManager().CloseAll();
+ // delete adminMenuGui;
+ //GetGame().GetUIManager().Back();
+
+
+ // }else{
+ // UIScriptedMenu adminMenuGui = NULL;
+ // adminMenuGui = new ref AdminMenuGui();
+ // g_Game.GetUIManager().ShowScriptedMenu( adminMenuGui, NULL );
+ // AMenuM.CanClose = true;
+ // }
+ }
+ break;
+
+ case (int)M_RPCs.M_Admin_Menu_Teleport_Write_Pre:
+ if ( GetGame().IsServer())
+ {
+ Print("Pos Pre");
+ string PosNamet;
+ ctx.Read(PosNamet);
+ Admin = GetServerMission().IsAdminID(sender.GetName(), sender);
+ if ( Admin != NULL)
+ {
+ vector TLLPos = Admin.GetPosition();
+ // ScriptRPC Addingpos = new ScriptRPC();
+ // Addingpos.Write(PosNamet);
+ // Addingpos.Write(TLLPos);
+ // Print("Pos RPC");
+ // Addingpos.Send(NULL, M_RPCs.M_Admin_Menu_Teleport_Write, false, NULL);
+ GetFileHandler().AddLocation(PosNamet, TLLPos)
+ }
+ }
+ break;
+
+ case M_RPCs.M_Admin_Delete_Object:
+ Param1]