diff --git a/DayZ-Sa-Tomato/Config/Admins.txt b/DayZ-Sa-Tomato/Config/Admins.txt
new file mode 100644
index 0000000..f6e81e1
--- /dev/null
+++ b/DayZ-Sa-Tomato/Config/Admins.txt
@@ -0,0 +1,3 @@
+76561198017833573
+76561198134309775
+76561198065995341
diff --git a/DayZ-Sa-Tomato/Config/Test.txt b/DayZ-Sa-Tomato/Config/Test.txt
new file mode 100644
index 0000000..d012d14
--- /dev/null
+++ b/DayZ-Sa-Tomato/Config/Test.txt
@@ -0,0 +1 @@
+TestString
\ No newline at end of file
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..a99948d
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/$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/PBOPREFIX.txt b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/PBOPREFIX.txt
new file mode 100644
index 0000000..c822bc2
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/PBOPREFIX.txt
@@ -0,0 +1,6 @@
+///'scripts.pbo' from Mikero's dos tools, dll version 5.66///
+prefix=com\DayZ-SA-Tomato
+revision=1
+Pbo Type is: Arma Unknown pbo typ (no config).
+Sha: '5CAF7A50CB0D1CACBB90A6A0DA4EFC47B8998E0D'
+////////////
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..0e071a0
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/config.cpp
@@ -0,0 +1,10 @@
+class CfgPatches
+{
+ class DayZSATomato
+ {
+ units[]={};
+ weapons[]={};
+ requiredVersion=0.1;
+ requiredAddons[]={};
+ };
+};
\ No newline at end of file
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/COMCam.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/COMCam.c
new file mode 100644
index 0000000..8c2c77f
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/COMCam.c
@@ -0,0 +1,265 @@
+modded class DayZSpectator
+{
+ protected float forwardVelocity;
+ protected float strafeVelocity;
+ protected float altitudeVelocity;
+
+ protected float yawVelocity;
+ protected float pitchVelocity;
+
+ protected float m_CamDrag = 0.95;
+
+ protected float m_CamFOV = 1.0; // default FOV
+ protected float m_TargetFOV = 1.0;
+ protected float m_TargetRoll;
+ protected float m_DistanceToObject;
+ protected bool m_FollowTarget = false;
+ protected bool m_FreezePlayer = false;
+ protected bool m_OrbitalCam = false;
+ protected bool m_FreezeCam = false;
+
+ protected bool m_FreezeMouse = false;
+
+ static float CAMERA_FOV = 1.0;
+ static float CAMERA_TARGETFOV = 1.0;
+ static float CAMERA_FOV_SPEED_MODIFIER = 6.0;
+ static float CAMERA_SPEED = 2.0;
+ static float CAMERA_MAXSPEED = 1.0;
+ static float CAMERA_VELDRAG;
+ static float CAMERA_MSENS = 0.8; // acceleration
+ static float CAMERA_SMOOTH = 0.8; // drag
+
+ static bool CAMERA_DOF = false;
+ static bool CAMERA_AFOCUS = true;
+ static float CAMERA_BLUR = 0.0; // modified via ui
+ static float CAMERA_FLENGTH = 50.0; // modified via ui
+ static float CAMERA_FNEAR = 50.0; // modified via ui
+ static float CAMERA_FDIST = 0.0;
+ static float CAMERA_DOFFSET = 0.0;
+
+ static float CAMERA_SMOOTH_BLUR = 0.0;
+
+ protected vector m_CamOffset;
+
+ protected Object m_Target;
+ protected vector m_TargetPos; // Static position
+
+ protected float m_CurrentSmoothBlur;
+
+ override void EOnFrame(IEntity other, float timeSlice)
+ {
+ // zoom camera
+ int i = GetMouseState( MouseState.WHEEL );
+
+ if ( i != 0 )
+ {
+ if ( CTRL() )
+ {
+ vector ori = GetOrientation();
+ m_TargetRoll = ori[2] - Math.RAD2DEG * i*0.06;
+ }
+ else
+ {
+ m_TargetFOV-=i*0.06; // invert
+ if ( m_TargetFOV < 0.01 )
+ {
+ m_TargetFOV = 0.01;
+ }
+ }
+ }
+
+ if ( m_CamFOV != m_TargetFOV )
+ {
+ m_CamFOV = Math.Lerp( m_CamFOV, m_TargetFOV, timeSlice*CAMERA_FOV_SPEED_MODIFIER );
+ SetFOV( m_CamFOV );
+ }
+
+ vector oldOrient = GetOrientation();
+ if ( oldOrient[2] != m_TargetRoll )
+ {
+ oldOrient[2] = Math.Lerp( oldOrient[2], m_TargetRoll, timeSlice*CAMERA_FOV_SPEED_MODIFIER );
+ SetOrientation( oldOrient );
+ }
+
+ // Camera movement
+ Input input = GetGame().GetInput();
+
+ if ( !m_FreezeCam )
+ {
+ float forward = input.GetAction(UAMoveForward) - input.GetAction(UAMoveBack); // -1, 0, 1
+ float strafe = input.GetAction(UATurnRight) - input.GetAction(UATurnLeft);
+
+ float altitude = input.GetAction(UACarShiftGearUp) - input.GetAction(UACarShiftGearDown);
+ altitudeVelocity = altitudeVelocity + altitude * CAMERA_SPEED * timeSlice;
+
+ Math.Clamp( altitudeVelocity, -CAMERA_MAXSPEED, CAMERA_MAXSPEED);
+ vector up = vector.Up * altitudeVelocity;
+
+ vector direction = GetDirection();
+ vector directionAside = vector.Up * direction;
+
+ altitudeVelocity *= m_CamDrag;
+
+ vector oldPos = GetPosition();
+
+ forwardVelocity = forwardVelocity + forward * CAMERA_SPEED * timeSlice;
+ strafeVelocity = strafeVelocity + strafe * CAMERA_SPEED * timeSlice;
+
+ Math.Clamp ( forwardVelocity, -CAMERA_MAXSPEED, CAMERA_MAXSPEED);
+ Math.Clamp ( strafeVelocity, -CAMERA_MAXSPEED, CAMERA_MAXSPEED);
+
+ vector forwardChange = forwardVelocity * direction;
+ vector strafeChange = strafeVelocity * directionAside;
+
+ forwardVelocity *= m_CamDrag;
+ strafeVelocity *= m_CamDrag;
+
+ vector newPos = oldPos + forwardChange + strafeChange + up;
+
+ float surfaceY = GetGame().SurfaceY( newPos[0], newPos[2] ) + 0.25;
+ if ( newPos[1] < surfaceY )
+ {
+ newPos[1] = surfaceY;
+ }
+
+ SetPosition(newPos);
+ }
+
+ if ( !m_FreezeMouse )
+ {
+ float yawDiff = input.GetAction(UAAimHeadLeft) - input.GetAction(UAAimHeadRight);
+ float pitchDiff = input.GetAction(UAAimHeadDown) - input.GetAction(UAAimHeadUp);
+
+ yawVelocity = yawVelocity + yawDiff * CAMERA_MSENS;
+ pitchVelocity = pitchVelocity + pitchDiff * CAMERA_MSENS; // 0.8
+
+ vector newOrient = oldOrient;
+
+ Math.Clamp ( yawVelocity, -1.5, 1.5);
+ Math.Clamp ( pitchVelocity, -1.5, 1.5);
+
+ newOrient[0] = newOrient[0] - Math.RAD2DEG * yawVelocity * timeSlice;
+ newOrient[1] = newOrient[1] - Math.RAD2DEG * pitchVelocity * timeSlice;
+
+ yawVelocity *= CAMERA_SMOOTH; // drag 0.9
+ pitchVelocity *= CAMERA_SMOOTH;
+
+ if( newOrient[1] < -89 )
+ newOrient[1] = -89;
+ if( newOrient[1] > 89 )
+ newOrient[1] = 89;
+
+ SetOrientation( newOrient );
+ }
+
+
+ // Camera targetting
+ float dist = 0.0;
+ vector from = GetGame().GetCurrentCameraPosition();
+
+ if ( m_Target )
+ {
+ vector targetPos;
+
+ if ( m_Target.IsInherited( SurvivorBase ) )
+ {
+ targetPos = GetTargetCenter();
+ }
+ else
+ {
+ vector pos = m_Target.GetPosition();
+ pos[1] = GetGame().SurfaceY(pos[0], pos[2]);
+
+ vector clippingInfo;
+ vector objectBBOX;
+
+ m_Target.GetCollisionBox(objectBBOX);
+
+ pos[1] = (pos[1] - objectBBOX[1] + clippingInfo[1] - objectBBOX[1]) + 1.5;
+
+ targetPos = pos;
+ }
+
+ if ( m_OrbitalCam )
+ {
+ LookAt( targetPos );
+ }
+
+ dist = vector.Distance( from, targetPos );
+
+ if ( m_FollowTarget )
+ {
+ if ( m_DistanceToObject == 0.0 )
+ {
+ m_DistanceToObject = vector.Distance(GetTargetCenter(), GetPosition());
+ m_CamOffset = vector.Direction( GetTargetCenter() , GetPosition() );
+ m_CamOffset.Normalize();
+ }
+
+ if ( m_OrbitalCam )
+ {
+ direction = vector.Direction( GetTargetCenter() , GetPosition() );
+ direction.Normalize();
+ newPos = GetTargetCenter() + ( direction * m_DistanceToObject );
+ }
+ else
+ {
+ newPos = GetTargetCenter() + ( m_CamOffset * m_DistanceToObject );
+ }
+
+ SetPosition( newPos );
+ dist = m_DistanceToObject;
+ }
+ }
+ else if ( m_TargetPos != vector.Zero )
+ {
+ LookAt( m_TargetPos ); // auto orbital
+ dist = vector.Distance( from, m_TargetPos );
+ }
+
+ if ( CAMERA_DOF ) // DOF enabled
+ {
+ if ( CAMERA_AFOCUS && !m_Target ) //auto focus
+ {
+ vector to = from + (GetGame().GetCurrentCameraDirection() * 9999);
+ vector contact_pos;
+
+ DayZPhysics.RaycastRV( from, to, contact_pos, NULL, NULL, NULL , NULL, NULL, false, false, ObjIntersectIFire);
+ dist = vector.Distance( from, contact_pos );
+ }
+ if ( dist > 0 ) CAMERA_FDIST = dist;
+
+ PPEffects.OverrideDOF(true, CAMERA_FDIST, CAMERA_FLENGTH, CAMERA_FNEAR, CAMERA_BLUR, CAMERA_DOFFSET);
+ }
+ }
+
+ vector GetTargetCenter()
+ {
+ vector targetPosition;
+
+ if ( m_Target.IsInherited( SurvivorBase ))
+ {
+ targetPosition = m_Target.GetPosition();
+ targetPosition[1] = targetPosition[1] + 1.5;
+ }
+ else
+ {
+ targetPosition = m_Target.GetPosition();
+ targetPosition[1] = GetGame().SurfaceY(targetPosition[0], targetPosition[2]);
+
+ vector clippingInfo;
+ vector objectBBOX;
+
+ m_Target.GetCollisionBox(objectBBOX);
+
+ targetPosition[1] = (targetPosition[1] - objectBBOX[1] + clippingInfo[1] - objectBBOX[1]) + 1.5;
+ }
+
+ return targetPosition;
+ }
+}
+
+static bool CTRL() // static functions arent scope global?
+{
+ return( ( KeyState( KeyCode.KC_LCONTROL ) > 0 ) || ( KeyState( KeyCode.KC_RCONTROL ) > 0 ) );
+}
\ No newline at end of file
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..7d9779b
--- /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/5_Mission/M_MissionG.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/M_MissionG.c
new file mode 100644
index 0000000..a870c9e
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/M_MissionG.c
@@ -0,0 +1,98 @@
+/*
+ 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
+{
+ ref DevTeleport devTeleport;
+ ref DevCam devCam;
+ ref AdminMenu adminMenu;
+ ref AdminMenuManager adminMenuManager;
+ //ref AdminMenuMain AdminMenumain;
+
+ bool isSpectating = false;
+ bool MenuOpen = false;
+ void MissionGameplay()
+ {
+ Print( " Mission Gameplay Constructor ");
+
+ devTeleport = new DevTeleport();
+ devCam = new DevCam();
+ adminMenu = new AdminMenu();
+ adminMenuManager = new AdminMenuManager();
+ }
+
+ override void OnInit()
+ {
+ super.OnInit();
+
+ Print( " Mission Gameplay ");
+ }
+
+ override void OnMissionStart()
+ {
+ super.OnMissionStart();
+
+ Widget welcomeMenu = GetGame().GetWorkspace().CreateWidgets( "DZ\\DayZ-SA-Tomato\\scripts\\5_Mission\\core\\WelcomeMenu.layout", NULL );
+ //welcomeMenu.Show(true);
+
+ GetGame().GetCallQueue( CALL_CATEGORY_GUI ).CallLater( welcomeMenu.Show, 5000, false, false );
+ }
+
+
+ override void OnKeyRelease( int key )
+ {
+ super.OnKeyRelease( key );
+ PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
+ if ( key == KeyCode.KC_N )
+ {
+ adminMenuManager.Teleport();
+ if ( GetGame().IsClient() )
+ {
+ }
+ }
+
+ if ( key == KeyCode.KC_INSERT )
+ {
+
+ //devCam.SendRPC( isSpectating, GetCursorPos() );
+ adminMenuManager.CamTeleport( isSpectating, GetCursorPos() );
+
+ isSpectating = !isSpectating;
+ }
+ if ( key == KeyCode.KC_M )
+ {
+ if(GetGame().IsClient() || !GetGame().IsMultiplayer())
+ {
+ if ( player )
+ {
+ adminMenuManager.MenuOpen();
+ }
+ }
+ }
+ }
+}
+
+Mission CreateCustomMission(string path)
+{
+ if ( GetGame().IsServer() && GetGame().IsMultiplayer() ) {
+ return new CommunityOfflineServer(); // 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_RPCs.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/M_RPCs.c
new file mode 100644
index 0000000..a532b6b
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/M_RPCs.c
@@ -0,0 +1,57 @@
+/*
+ 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;
+}
diff --git a/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/core/CommunityOfflineServer.c b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/core/CommunityOfflineServer.c
new file mode 100644
index 0000000..b2b9542
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/core/CommunityOfflineServer.c
@@ -0,0 +1,355 @@
+/*
+ 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 CommunityOfflineServer : MissionServer
+{
+ protected bool m_bLoaded;
+ ref DevTeleport devTeleport;
+ ref DevCam devCam;
+ ref AdminMenu adminMenu;
+ protected float m_LogInTimerLength = 1;
+ //admin list
+ PlayerBase Admin = null;
+ protected ref map m_AdminList;
+ static ref map m_StaminaList;
+ protected string m_AdminListPath = "$CurrentDir:\\DayZ-SA-Tomato\\Config\\";
+ void CommunityOfflineServer()
+ {
+ Print( "CommunityOfflineServer::CommunityOfflineServer()" );
+ m_bLoaded = false;
+ devTeleport = new DevTeleport();
+ devCam = new DevCam();
+ adminMenu = new AdminMenu();
+ }
+
+ void ~CommunityOfflineServer()
+ {
+ Print( "CommunityOfflineServer::~CommunityOfflineServer()" );
+ }
+
+
+ //Create Mags And Custom Guns
+ void addMags(PlayerBase player, string mag_type, int count)
+ {
+ if (count < 1)
+ return;
+
+ EntityAI mag;
+
+ for (int i = 0; i < count; i++) {
+ mag = player.GetInventory().CreateInInventory(mag_type);
+ }
+
+ player.SetQuickBarEntityShortcut(mag, 1, true);
+ }
+ EntityAI SVD(int ground, PlayerBase player)
+ {
+ EntityAI item;
+ ItemBase itemBs
+ vector NewPosition;
+ vector OldPosition;
+ if (ground == 1)
+ {
+ OldPosition = player.GetPosition();
+ NewPosition[0] = OldPosition[0] + 1.5;
+ NewPosition[1] = OldPosition[1] + 0.1;
+ NewPosition[2] = OldPosition[2] + 1.5;
+ EntityAI gun = GetGame().CreateObject( "SVD", NewPosition, false, true );
+ gun.GetInventory().CreateAttachment("PSO1Optic");
+ gun.GetInventory().CreateAttachment("ImprovisedSuppressor");
+ gun.GetInventory().CreateAttachment("GhillieAtt_Tan");
+ }else
+ {
+ EntityAI gun1 = player.GetHumanInventory().CreateInHands("SVD");
+ gun1.GetInventory().CreateAttachment("PSO1Optic");
+ gun1.GetInventory().CreateAttachment("ImprovisedSuppressor");
+ gun1.GetInventory().CreateAttachment("GhillieAtt_Tan");
+ addMags(player, "Mag_SVD_10Rnd", 3);
+ }
+ return gun;
+}
+
+ override void OnEvent(EventType eventTypeId, Param params)
+ {
+ super.OnEvent(eventTypeId,params);
+
+
+ }
+
+
+ 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 (m_StaminaList.Contains(PlayerName))
+ {
+ currentPlayer.GetStaminaHandler().SyncStamina(1000,1000);
+ currentPlayer.GetStatStamina().Set(currentPlayer.GetStaminaHandler().GetStaminaCap());
+
+ }
+
+ if (IsAdmin(PlayerName, PlayerSteam64ID ))
+ {
+ currentPlayer.GetStaminaHandler().SyncStamina(1000,1000);
+ currentPlayer.GetStatStamina().Set(currentPlayer.GetStaminaHandler().GetStaminaCap());
+ }
+
+ m_currentPlayer++;
+
+
+ }
+ }
+
+ void SendPosTOAdmins()
+ {
+ array players = new array;
+ GetGame().GetPlayers( players );
+
+ for (int i = 0; i < players.Count(); ++i)
+ {
+
+ PlayerBase currentPlayer = players.Get(i);
+ string PlayerName;
+ PlayerIdentity PlayerIdent;
+ string PlayerSteam64ID;
+ PlayerName = PlayerIdent.GetName()
+ PlayerIdent = currentPlayer.GetIdentity();
+ PlayerSteam64ID = PlayerIdent.GetPlainId();
+ vector pos;
+
+ pos = currentPlayer.GetPosition()
+
+ SendPosToAdmins(PlayerName, pos)
+
+
+ }
+ }
+ void SendPosToAdmins(string PlayerName, vector pos)
+ {
+ array players = new array;
+ GetGame().GetPlayers( players );
+
+ for (int i = 0; i < players.Count(); ++i)
+ {
+ PlayerBase currentPlayer = players.Get(i);
+ string AdminPlayerName;
+ PlayerIdentity AdminIdent;
+ string PlayerSteam64ID;
+ AdminPlayerName = AdminIdent.GetName()
+ AdminIdent = currentPlayer.GetIdentity();
+ PlayerSteam64ID = AdminIdent.GetPlainId();
+ if (IsAdmin(AdminPlayerName, PlayerSteam64ID ))
+ {
+ ScriptRPC PPos = new ScriptRPC();
+ PPos.Write(PlayerName);
+ PPos.Write(pos);
+ PPos.Send(NULL, M_RPCs.M_Admin_Menu_Map_Player, false, AdminIdent);
+ }
+ }
+ }
+ void AddStamina(string name)
+ {
+ m_StaminaList.Insert(name, "null");
+ }
+
+ void RemoveStamina(string name)
+ {
+ m_StaminaList.Remove(m_StaminaList.GetKeyByValue(name));
+ }
+ bool StaminaContains(string name)
+ {
+ if (m_StaminaList.Contains(name))
+ {
+ return true;
+ }
+ return false;
+ }
+
+
+
+ bool IsAdmin( string name, string ID )
+ {
+ array players = new array;
+ GetGame().GetPlayers( players );
+ for (int i = 0; i < players.Count(); ++i)
+ {
+ if (players.Get(i).GetIdentity().GetName() == name && m_AdminList.Contains(ID))
+ {
+ return true;
+ }
+ return false;
+ }
+ return false;
+ }
+
+ PlayerBase IsAdminID(string name, string ID )
+ {
+ array players = new array;
+ GetGame().GetPlayers( players );
+ for (int i = 0; i < players.Count(); ++i)
+ {
+ if (players.Get(i).GetIdentity().GetName() == name && m_AdminList.Contains(ID))
+ {
+ Admin = players.Get(i);
+ //AdminIdentity = Admin.GetIdentity();
+ //AdminUID = AdminIdentity.GetPlainId();
+ return Admin;
+ }
+ return Admin;
+ }
+ return Admin; // temp true
+ }
+
+ ref Man GetPlayerFromIdentity( PlayerIdentity identity )
+ {
+ foreach( ref Man manBase : m_Players )
+ {
+ Print( "Getter: " + manBase + " : " + manBase.GetIdentity().GetName() + " : " + manBase.GetIdentity().GetId() + ":" + manBase.GetIdentity().GetPlainId());
+ if ( manBase.GetIdentity().GetPlayerId() == identity.GetPlayerId() )
+ {
+ return manBase;
+ }
+ }
+ return NULL;
+ }
+
+ override void OnInit()
+ {
+ super.OnInit();
+ SetupWeather();
+
+ //Admin list Insert from text
+ m_AdminList = new map; //UID, name
+ m_StaminaList = new map; //UID, name
+ FileHandle AdminUIDSFile = OpenFile(m_AdminListPath + "Admins.txt", FileMode.READ);
+ if (AdminUIDSFile != 0)
+ {
+ string line_content = "";
+ while ( FGets(AdminUIDSFile,line_content) > 0 )
+ {
+ m_AdminList.Insert(line_content,"null"); //UID , NAME
+ Print("Adding Admin: "+ line_content + " To the Admin List!");
+ }
+ CloseFile(AdminUIDSFile);
+ }
+
+ }
+
+ override void OnMissionStart()
+ {
+ super.OnMissionStart();
+
+
+ }
+
+ override void OnMissionFinish()
+ {
+
+
+ super.OnMissionFinish();
+ }
+
+ void OnMissionLoaded()
+ {
+
+ }
+
+ override void OnUpdate( float timeslice )
+ {
+ super.OnUpdate( timeslice );
+
+ if( !m_bLoaded && !GetDayZGame().IsLoading() )
+ {
+ m_bLoaded = true;
+ OnMissionLoaded();
+ }
+ }
+
+ static void SetupWeather()
+ {
+ //Offical DayZ SA weather code
+ Weather weather = g_Game.GetWeather();
+
+ weather.GetOvercast().SetLimits( 0.0 , 2.0 );
+ weather.GetRain().SetLimits( 0.0 , 2.0 );
+ weather.GetFog().SetLimits( 0.0 , 2.0 );
+
+ weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.0 );
+ weather.GetRain().SetForecastChangeLimits( 0.0, 0.0 );
+ weather.GetFog().SetForecastChangeLimits( 0.0, 0.0 );
+
+ weather.GetOvercast().SetForecastTimeLimits( 1800 , 1800 );
+ weather.GetRain().SetForecastTimeLimits( 600 , 600 );
+ weather.GetFog().SetForecastTimeLimits( 600 , 600 );
+
+ weather.GetOvercast().Set( 0.0, 0, 0 );
+ weather.GetRain().Set( 0.0, 0, 0 );
+ weather.GetFog().Set( 0.0, 0, 0 );
+
+ weather.SetWindMaximumSpeed( 50 );
+ weather.SetWindFunctionParams( 0, 0, 1 );
+ }
+
+ override void OnPreloadEvent(PlayerIdentity identity, out bool useDB, out vector pos, out float yaw, out int queueTime)
+ {
+ if (GetHive())
+ {
+ queueTime = m_LogInTimerLength;
+ }
+ else
+ {
+ queueTime = m_LogInTimerLength;
+ }
+}
+
+
+ void InitHive()
+ {
+ Hive oHive = GetHive();
+
+ if( !oHive )
+ {
+ oHive = CreateHive();
+ }
+
+ if( oHive )
+ {
+ oHive.InitOffline();
+ }
+ }
+}
\ No newline at end of file
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..285c45d
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/core/KeyMouseBinding.c
@@ -0,0 +1,243 @@
+ /*
+ 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 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..875f4de
--- /dev/null
+++ b/DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/5_Mission/core/StaticFunctions.c
@@ -0,0 +1,452 @@
+ /*
+ 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 .
+ */
+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 CommunityOfflineServer GetServerMission()
+{
+ return CommunityOfflineServer.Cast( GetGame().GetMission() );
+}
+
+static ref PlayerBase GetPlayer()
+{
+ return 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 AdminMenuGui m_adMenu;
+ ref AdminMenuGuiMap m_map;
+ PlayerBase Admin;
+ PlayerIdentity AdminIdentity;
+ string AdminUID;
+
+ void AdminMenu()
+ {
+ GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
+ //adminMenuMain = new AdminMenuMain();
+ }
+
+ 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;
+ bool ai = false;
+
+ int quantity = 0;
+ string text = "";
+
+
+
+ switch(rpc_type)
+ {
+
+ case (int)M_RPCs.M_Admin_Menu:
+ if ( GetGame().IsServer() )
+ {
+ Print("Admin Menu RPC");
+ //GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu, new Param1( GetCursorPos() ), false, NULL );
+ // permission check - server mission file
+
+ Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+ Print("Admin Menu sender name : " + sender.GetName() + "PlainID : " + sender.GetPlainId());
+ AdminIdentity = Admin.GetIdentity();
+ AdminUID = AdminIdentity.GetPlainId();
+ GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_OK, new Param1( "Test" ), false, NULL );
+ }
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ // UIScriptedMenu adminMenuGui = NULL;
+ // adminMenuGui = new AdminMenuGui();
+ // if ( g_Game.GetUIManager().GetMenu() == NULL )
+ // {
+ // g_Game.GetUIManager().ShowScriptedMenu( adminMenuGui, NULL );
+ // }
+ }
+ break;
+
+ case (int)M_RPCs.M_Admin_Menu_OK:
+ Print("Admin Menu OK RPC");
+ if ( GetGame().IsServer() )
+ {
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ UIScriptedMenu adminMenuGui = NULL;
+ adminMenuGui = new AdminMenuGui();
+ if ( g_Game.GetUIManager().GetMenu() == NULL )
+ {
+ g_Game.GetUIManager().ShowScriptedMenu( adminMenuGui, NULL );
+ }
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_Spawn_Ground:
+ //read stuff
+ string GroundN_Item; //ItemName
+ string GroundN_ai; //ai Bool
+ string QuantityItem; //Textbox
+ ctx.Read(GroundN_Item);
+ ctx.Read(GroundN_ai);
+ ctx.Read(QuantityItem);
+
+ if (GroundN_ai == "true")
+ {
+ ai = true;
+ }
+ if ( GetGame().IsServer() )
+ {
+ Admin = GetServerMission().IsAdminID( sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+
+ EntityAI oObj = GetGame().CreateObject( GroundN_Item, Admin.GetPosition(), false, ai );
+ //obEditor.addObject( oObj );
+ if ( oObj.IsInherited( ItemBase ) )
+ {
+ oItem = ( ItemBase ) oObj;
+ SetupSpawnedItem( oItem, oItem.GetMaxHealth(), 1 );
+
+ quantity = 0;
+ text = QuantityItem;
+ text.ToUpper();
+ //TODO ?? Check IsInherited EntetyAI
+ if (text == "MAX")
+ {
+ quantity = oItem.GetQuantityMax();
+ } else
+ {
+ quantity = text.ToInt();
+ }
+ oItem.SetQuantity(quantity);
+ return;
+ }
+ }
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_Spawn_ItemPrev:
+ //read stuff
+ string ItemPrev_Item; //ItemName
+ ctx.Read(ItemPrev_Item);
+
+ if ( GetGame().IsServer() )
+ {
+ Admin = GetServerMission().IsAdminID( sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+
+ EntityAI oObjp = GetGame().CreateObject( ItemPrev_Item, vector.Zero, false, false );
+ //obEditor.addObject( oObj );
+
+ GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Spawn_ItemPrev_ok, new Param1( oObjp ), false, NULL );
+
+
+
+
+ }
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ }
+ break;
+
+
+
+ case M_RPCs.M_Admin_Menu_Spawn_Inventory:
+ //read stuff
+ string Inventory_Item; //ItemName
+ string Inventory_ai; //ai Bool
+ string Inventory_QuantityItem; //Textbox
+ ctx.Read(Inventory_Item);
+ ctx.Read(Inventory_ai);
+ ctx.Read(Inventory_QuantityItem);
+
+ if (Inventory_ai == "true")
+ {
+ ai = true;
+ }
+ if ( GetGame().IsServer() )
+ {
+ Admin = GetServerMission().IsAdminID( sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+
+
+
+ EntityAI oInvItem = Admin.GetInventory().CreateInInventory( Inventory_Item );
+ oInvItem.SetHealth( oInvItem.GetMaxHealth() );
+ if ( oInvItem.IsInherited( ItemBase ) )
+ {
+ oItem = ( ItemBase ) oObj;
+ SetupSpawnedItem( oItem, oItem.GetMaxHealth(), 1 );
+ quantity = 0;
+ text = Inventory_QuantityItem;
+ text.ToUpper();
+ if (text == "MAX")
+ {
+ quantity = oItem.GetQuantityMax();
+ } else
+ {
+ quantity = text.ToInt();
+ }
+ oItem.SetQuantity(quantity);
+ return;
+ }
+
+
+
+
+
+ }
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_Spawn_Cursor:
+ //read stuff
+ string Cursor_Item; //ItemName
+ vector Cursor_Pos //Vector Postition
+ string Cursor_ai; //ai Bool
+ string Cursor_QuantityItem; //Textbox
+ ctx.Read(Cursor_Item);
+ ctx.Read(Cursor_Pos);
+ ctx.Read(Cursor_ai);
+ ctx.Read(Cursor_QuantityItem);
+ if (Cursor_ai == "true")
+ {
+ ai = true;
+ }
+ if ( GetGame().IsServer() )
+ {
+ Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+ EntityAI oCursorObj = GetGame().CreateObject( Cursor_Item, Cursor_Pos, false, ai );
+ //obEditor.addObject( oCursorObj );
+
+ if ( oCursorObj.IsInherited( ItemBase ) )
+ {
+ oItem = ( ItemBase ) oCursorObj;
+ SetupSpawnedItem( oItem, oItem.GetMaxHealth(), 1 );
+
+ quantity = 0;
+ text = Cursor_QuantityItem;
+ text.ToUpper();
+
+ if (text == "MAX")
+ {
+ quantity = oItem.GetQuantityMax();
+ } else
+ {
+ quantity = text.ToInt();
+ }
+ oItem.SetQuantity(quantity);
+ oCursorObj.PlaceOnSurface();
+ return;
+ }
+
+ }
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_Heal:
+ if ( GetGame().IsServer() )
+ {
+
+ Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+ //AdminIdentity = Admin.GetIdentity();
+ //AdminUID = AdminIdentity.GetPlainId();
+ Print(AdminUID);
+ Admin.SetHealth( Admin.GetMaxHealth( "", "" ) );
+ Admin.SetHealth( "","Blood", Admin.GetMaxHealth( "", "Blood" ) );
+ Admin.GetStatEnergy().Add(250);
+ Admin.GetStatWater().Add(250);
+ Admin.SetBleedingBits(0);
+ }
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_Strip:
+ string item;
+ Param1 stringParam;
+ ctx.Read( stringParam );
+ PlayerName = stringParam.param1;
+ if ( GetGame().IsServer() )
+ {
+ Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+ for ( int a = 0; a < players.Count(); ++a )
+ {
+ selectedPlayer = players.Get(a);
+ selectedIdentity = selectedPlayer.GetIdentity();
+ if ( selectedIdentity.GetName() == PlayerName )
+ {
+ selectedPlayer.RemoveAllItems();
+ }
+ }
+ }
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_TpTo:
+ ctx.Read( stringParam );
+ PlayerName = stringParam.param1;
+ if ( GetGame().IsServer() )
+ {
+ Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+ for ( int z = 0; z < players.Count(); ++z )
+ {
+ selectedPlayer = players.Get(z);
+ selectedIdentity = selectedPlayer.GetIdentity();
+ if ( selectedIdentity.GetName() == PlayerName )
+ {
+ selectedPlayer.SetPosition(Admin.GetPosition());
+
+ Msgparam = new Param1( "You were teleported by the admin!" );
+ GetGame().RPCSingleParam(Admin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, selectedIdentity);
+
+ strMessage = "Player " + PlayerName + " was teleported to your location!";
+ Msgparam = new Param1( strMessage );
+ GetGame().RPCSingleParam(Admin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, AdminIdentity);
+ }
+ }
+ }
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_TpMe:
+ ctx.Read( stringParam );
+ PlayerName = stringParam.param1;
+ if ( GetGame().IsServer() )
+ {
+ Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+ for ( int zm = 0; zm < players.Count(); ++zm )
+ {
+ if ( players.Get(zm).GetIdentity().GetName() == PlayerName )
+ {
+ Admin.SetPosition(players.Get(zm).GetPosition());
+ }
+ }
+ }
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_TpAllMe:
+ if ( GetGame().IsServer() )
+ {
+ Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+ int tpCount = TeleportAllPlayersTo(Admin);
+ string msgc = "All " + tpCount.ToString() + " Players Teleported to my POS!";
+ Msgparam = new Param1( msgc );
+ GetGame().RPCSingleParam(Admin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, AdminIdentity);
+ }
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_Spawn_Car:
+ if ( GetGame().IsServer() )
+ {
+ Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+ Car MyNiva;
+ vector position = Admin.GetPosition();
+ float adminHeading = MiscGameplayFunctions.GetHeadingAngle(Admin);
+ vector posModifier = Vector(-(3 * Math.Sin(adminHeading)), 0, 3 * Math.Cos(adminHeading));
+
+ MyNiva = Car.Cast(GetGame().CreateObject( "OffroadHatchback", position + posModifier, false, true, true ));
+ MyNiva.GetInventory().CreateAttachment("HatchbackHood");
+ MyNiva.GetInventory().CreateAttachment("HatchbackTrunk");
+ MyNiva.GetInventory().CreateAttachment("HatchbackDoors_CoDriver");
+ MyNiva.GetInventory().CreateAttachment("HatchbackWheel");
+ MyNiva.GetInventory().CreateAttachment("HatchbackWheel");
+ MyNiva.GetInventory().CreateAttachment("HatchbackWheel");
+ MyNiva.GetInventory().CreateAttachment("HatchbackWheel");
+ MyNiva.GetInventory().CreateAttachment("SparkPlug");
+ MyNiva.GetInventory().CreateAttachment("EngineBelt");
+ MyNiva.GetInventory().CreateAttachment("CarBattery");
+
+ MyNiva.Fill( CarFluid.FUEL, MyNiva.GetFluidCapacity( CarFluid.FUEL ) );
+ MyNiva.Fill( CarFluid.OIL, MyNiva.GetFluidCapacity( CarFluid.OIL ) );
+ MyNiva.Fill( CarFluid.BRAKE, MyNiva.GetFluidCapacity( CarFluid.BRAKE ) );
+ MyNiva.Fill( CarFluid.COOLANT, MyNiva.GetFluidCapacity( CarFluid.COOLANT ) );
+
+ }
+ }
+
+ if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
+ {
+ }
+ break;
+
+ case M_RPCs.M_Admin_Menu_Car_Refill:
+ if ( GetGame().IsServer() )
+ {
+ Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
+ if ( Admin != null )
+ {
+ ref array