Advertisement
sasaa86

sasaa.c

Dec 7th, 2018
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 17.77 KB | None | 0 0
  1. //! include sasaa.c to init.c
  2. //! #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\sasaa.c"
  3.  
  4.  
  5.  
  6. class CustomMission: MissionServer{
  7.    
  8.     override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName){
  9.         Entity playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");
  10.         Class.CastTo(m_player, playerEnt);
  11.         GetGame().SelectPlayer(identity, m_player);
  12.         return m_player;
  13.     }
  14.    
  15.     void SetRandomHealth(EntityAI itemEnt){
  16.         int rndHlt = Math.RandomInt(70,100);
  17.         itemEnt.SetHealth("","",rndHlt);
  18.     }
  19.    
  20.     override void OnInit(){
  21.         GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(NumPLayersOnServer, 300000, true);      // 5 minutes
  22.        
  23.        
  24.        
  25.      // ############################## Bridge ##################################
  26.     Object obj;
  27.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12999.700195 -7.890600 3284.985596");
  28.     obj.SetOrientation("55.999985 0.000000 0.000000");
  29.     obj.SetPosition("12999.700195 -7.890600 3284.985596");
  30.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12988.517578 -7.890600 3301.570557");
  31.     obj.SetOrientation("55.999985 0.000000 0.000000");
  32.     obj.SetPosition("12988.517578 -7.890600 3301.570557");
  33.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12977.330078 -7.890600 3318.156250");
  34.     obj.SetOrientation("56.000000 0.000000 0.000000");
  35.     obj.SetPosition("12977.330078 -7.890600 3318.156250");
  36.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12966.149414 -7.890600 3334.729980");
  37.     obj.SetOrientation("56.000000 0.000000 0.000000");
  38.     obj.SetPosition("12966.149414 -7.890600 3334.729980");
  39.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12954.969727 -7.890600 3351.300049");
  40.     obj.SetOrientation("56.000000 0.000000 0.000000");
  41.     obj.SetPosition("12954.969727 -7.890600 3351.300049");
  42.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12943.798828 -7.890600 3367.870117");
  43.     obj.SetOrientation("56.000000 0.000000 0.000000");
  44.     obj.SetPosition("12943.798828 -7.890600 3367.870117");
  45.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12932.620117 -7.890600 3384.443604");
  46.     obj.SetOrientation("56.000000 0.000000 0.000000");
  47.     obj.SetPosition("12932.620117 -7.890600 3384.443604");
  48.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12921.450195 -7.890600 3401.000000");
  49.     obj.SetOrientation("56.000000 0.000000 0.000000");
  50.     obj.SetPosition("12921.450195 -7.890600 3401.000000");
  51.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12910.259766 -7.890600 3417.581055");
  52.     obj.SetOrientation("56.000000 0.000000 0.000000");
  53.     obj.SetPosition("12910.259766 -7.890600 3417.581055");
  54.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12899.080078 -7.890600 3434.149902");
  55.     obj.SetOrientation("56.000000 0.000000 0.000000");
  56.     obj.SetPosition("12899.080078 -7.890600 3434.149902");
  57.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12887.900391 -7.890600 3450.728027");
  58.     obj.SetOrientation("56.000000 0.000000 0.000000");
  59.     obj.SetPosition("12887.900391 -7.890600 3450.728027");
  60.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12876.709961 -7.890600 3467.312256");
  61.     obj.SetOrientation("56.000000 0.000000 0.000000");
  62.     obj.SetPosition("12876.709961 -7.890600 3467.312256");
  63.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12865.540039 -7.890600 3483.872803");
  64.     obj.SetOrientation("56.000000 0.000000 0.000000");
  65.     obj.SetPosition("12865.540039 -7.890600 3483.872803");
  66.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12854.360352 -7.890600 3500.449463");
  67.     obj.SetOrientation("56.000000 0.000000 0.000000");
  68.     obj.SetPosition("12854.360352 -7.890600 3500.449463");
  69.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12843.179688 -7.890600 3517.039795");
  70.     obj.SetOrientation("56.000000 0.000000 0.000000");
  71.     obj.SetPosition("12843.179688 -7.890600 3517.039795");
  72.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12831.998047 -7.890600 3533.620117");
  73.     obj.SetOrientation("56.000000 0.000000 0.000000");
  74.     obj.SetPosition("12831.998047 -7.890600 3533.620117");
  75.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12820.809570 -7.890600 3550.198975");
  76.     obj.SetOrientation("56.000000 0.000000 0.000000");
  77.     obj.SetPosition("12820.809570 -7.890600 3550.198975");
  78.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12809.627930 -7.890600 3566.780029");
  79.     obj.SetOrientation("56.000000 0.000000 0.000000");
  80.     obj.SetPosition("12809.627930 -7.890600 3566.780029");
  81.     obj = GetGame().CreateObject("Dam_Concrete_20_Floodgate", "12798.440430 -7.890600 3583.360107");
  82.     obj.SetOrientation("56.000000 0.000000 0.000000");
  83.     obj.SetPosition("12798.440430 -7.890600 3583.360107");
  84.     obj = GetGame().CreateObject("Land_Container_1Moh", "12809.701172 2.301730 3576.680176");
  85.     obj.SetOrientation("138.000015 0.000000 0.000000");
  86.     obj.SetPosition("12809.701172 2.301730 3576.680176");
  87.     obj = GetGame().CreateObject("Land_Container_1Moh", "12835.256836 2.086504 3538.797119");
  88.     obj.SetOrientation("-20.000008 0.000000 0.000000");
  89.     obj.SetPosition("12835.256836 2.086504 3538.797119");
  90.     obj = GetGame().CreateObject("Land_Container_1Moh", "12894.056641 2.251730 3455.602783");
  91.     obj.SetOrientation("-69.000000 0.000000 0.000000");
  92.     obj.SetPosition("12894.056641 2.251730 3455.602783");
  93.     obj = GetGame().CreateObject("Land_Container_1Moh", "12934.767578 2.301730 3387.844238");
  94.     obj.SetOrientation("0.000000 0.000000 0.000000");
  95.     obj.SetPosition("12934.767578 2.301730 3387.844238");
  96.     obj = GetGame().CreateObject("Land_Container_1Moh", "12990.190430 2.251730 3310.003662");
  97.     obj.SetOrientation("-62.000011 0.000000 0.000000");
  98.     obj.SetPosition("12990.190430 2.251730 3310.003662");
  99.     obj = GetGame().CreateObject("Land_Container_1Bo", "12999.427734 2.249999 3290.898682");
  100.     obj.SetOrientation("-17.000000 0.000000 0.000000");
  101.     obj.SetPosition("12999.427734 2.249999 3290.898682");
  102.     obj = GetGame().CreateObject("Land_Container_1Bo", "12966.283203 2.201730 3346.047607");
  103.     obj.SetOrientation("-33.000004 0.000000 0.000000");
  104.     obj.SetPosition("12966.283203 2.201730 3346.047607");
  105.     obj = GetGame().CreateObject("Land_Container_1Bo", "12947.516602 1.970427 3371.596680");
  106.     obj.SetOrientation("-30.000006 0.000000 0.000000");
  107.     obj.SetPosition("12947.516602 1.970427 3371.596680");
  108.     obj = GetGame().CreateObject("Land_Container_1Bo", "12912.168945 2.301730 3425.531006");
  109.     obj.SetOrientation("-57.999996 0.000000 0.000000");
  110.     obj.SetPosition("12912.168945 2.301730 3425.531006");
  111.     obj = GetGame().CreateObject("Land_Container_1Mo", "12900.983398 2.060063 3443.850830");
  112.     obj.SetOrientation("-4.000000 0.000000 0.000000");
  113.     obj.SetPosition("12900.983398 2.060063 3443.850830");
  114.     obj = GetGame().CreateObject("Land_Container_1Mo", "12912.173828 4.767287 3425.496338");
  115.     obj.SetOrientation("-57.999992 0.000000 0.000000");
  116.     obj.SetPosition("12912.173828 4.767287 3425.496338");
  117.     obj = GetGame().CreateObject("Land_Wreck_Uaz", "12832.424805 1.935676 3544.248535");
  118.     obj.SetOrientation("0.000000 0.000000 0.000000");
  119.     obj.SetPosition("12832.424805 1.935676 3544.248535");
  120.     obj = GetGame().CreateObject("Land_Wreck_Uaz", "12889.860352 1.985680 3460.103760");
  121.     obj.SetOrientation("-70.000000 0.000000 0.000000");
  122.     obj.SetPosition("12889.860352 1.985680 3460.103760");
  123.     obj = GetGame().CreateObject("Land_Wreck_Uaz", "12937.300781 1.935676 3383.198975");
  124.     obj.SetOrientation("0.000000 0.000000 0.000000");
  125.     obj.SetPosition("12937.300781 1.935676 3383.198975");
  126.     obj = GetGame().CreateObject("Land_Wreck_S1023_Blue", "12931.631836 2.091624 3390.962158");
  127.     obj.SetOrientation("-25.000008 0.000000 0.000000");
  128.     obj.SetPosition("12931.631836 2.091624 3390.962158");
  129.     obj = GetGame().CreateObject("Land_Wreck_Volha_Blue", "12986.588867 1.829433 3314.493896");
  130.     obj.SetOrientation("0.000000 0.000000 0.000000");
  131.     obj.SetPosition("12986.588867 1.829433 3314.493896");
  132.     obj = GetGame().CreateObject("Land_Wreck_Volha_Blue", "13003.046875 1.829433 3284.915771");
  133.     obj.SetOrientation("-17.000004 0.000000 0.000000");
  134.     obj.SetPosition("13003.046875 1.829433 3284.915771");
  135.     obj = GetGame().CreateObject("Land_Wreck_V3S", "12903.459961 2.536791 3436.341797");
  136.     obj.SetOrientation("-24.000000 -4.000000 -0.000000");
  137.     obj.SetPosition("12903.459961 2.536791 3436.341797");
  138.     obj = GetGame().CreateObject("Land_Wreck_Lada_Red", "12871.142578 1.753987 3480.337891");
  139.     obj.SetOrientation("0.000000 0.000000 0.000000");
  140.     obj.SetPosition("12871.142578 1.753987 3480.337891");
  141.     obj = GetGame().CreateObject("Land_Wreck_Lada_Red", "12849.930664 1.753987 3521.847412");
  142.     obj.SetOrientation("-65.999985 0.000000 0.000000");
  143.     obj.SetPosition("12849.930664 1.753987 3521.847412");
  144.     obj = GetGame().CreateObject("Land_Container_1Aoh", "12860.179688 2.301730 3505.910400");
  145.     obj.SetOrientation("-32.000004 0.000000 0.000000");
  146.     obj.SetPosition("12860.179688 2.301730 3505.910400");
  147.     obj = GetGame().CreateObject("Land_Container_1Moh", "12884.648438 2.301730 3470.343018");
  148.     obj.SetOrientation("0.000000 0.000000 0.000000");
  149.     obj.SetPosition("12884.648438 2.301730 3470.343018");
  150.     obj = GetGame().CreateObject("Land_Container_1Bo", "12820.764648 2.301730 3562.224609");
  151.     obj.SetOrientation("0.000000 0.000000 0.000000");
  152.     obj.SetPosition("12820.764648 2.301730 3562.224609");
  153.     obj = GetGame().CreateObject("Land_Container_1Aoh", "12876.986328 0.573664 3519.558594");
  154.     obj.SetOrientation("0.000000 0.000000 0.000000");
  155.     obj.SetPosition("12876.986328 0.573664 3519.558594");
  156.     obj = GetGame().CreateObject("Land_Container_1Aoh", "12851.830078 0.312851 3463.268066");
  157.     obj.SetOrientation("-80.000000 0.000000 0.000000");
  158.     obj.SetPosition("12851.830078 0.312851 3463.268066");
  159.     obj = GetGame().CreateObject("Land_Container_1Aoh", "12936.000977 0.579718 3442.836914");
  160.     obj.SetOrientation("94.000031 0.000000 0.000000");
  161.     obj.SetPosition("12936.000977 0.579718 3442.836914");
  162.     obj = GetGame().CreateObject("Land_Container_1Aoh", "12936.377930 -0.158530 3346.650391");
  163.     obj.SetOrientation("34.000000 0.000000 0.000000");
  164.     obj.SetPosition("12936.377930 -0.158530 3346.650391");
  165.     obj = GetGame().CreateObject("Land_Container_1Aoh", "13002.358398 1.284515 3319.798828");
  166.     obj.SetOrientation("-74.000000 0.000000 0.000000");
  167.     obj.SetPosition("13002.358398 1.284515 3319.798828");
  168.     obj = GetGame().CreateObject("Land_Container_1Bo", "12946.557617 0.260173 3406.045410");
  169.     obj.SetOrientation("-67.000000 0.000000 0.000000");
  170.     obj.SetPosition("12946.557617 0.260173 3406.045410");
  171.     obj = GetGame().CreateObject("Land_Container_1Bo", "12821.682617 0.678651 3528.143799");
  172.     obj.SetOrientation("-64.000000 0.000000 0.000000");
  173.     obj.SetPosition("12821.682617 0.678651 3528.143799");
  174.     obj = GetGame().CreateObject("Land_Container_1Bo", "12851.442383 0.351952 3561.598877");
  175.     obj.SetOrientation("-57.999992 0.000000 0.000000");
  176.     obj.SetPosition("12851.442383 0.351952 3561.598877");
  177.     obj = GetGame().CreateObject("Land_Container_1Bo", "12918.758789 0.920032 3364.437012");
  178.     obj.SetOrientation("-60.999996 0.000000 0.000000");
  179.     obj.SetPosition("12918.758789 0.920032 3364.437012");
  180.     obj = GetGame().CreateObject("Land_Container_1Mo", "12934.750977 0.666381 3418.666992");
  181.     obj.SetOrientation("-52.000000 0.000000 0.000000");
  182.     obj.SetPosition("12934.750977 0.666381 3418.666992");
  183.     obj = GetGame().CreateObject("Land_Container_1Mo", "12856.403320 0.043793 3469.494629");
  184.     obj.SetOrientation("-45.999996 0.000000 0.000000");
  185.     obj.SetPosition("12856.403320 0.043793 3469.494629");
  186.     obj = GetGame().CreateObject("Land_Container_1Mo", "12879.313477 0.908100 3459.768066");
  187.     obj.SetOrientation("-120.999969 -64.000015 -54.999989");
  188.     obj.SetPosition("12879.313477 0.908100 3459.768066");
  189.     obj = GetGame().CreateObject("Land_Lighthouse", "13057.658203 27.043219 3247.424805");
  190.     obj.SetOrientation("0.000000 0.000000 0.000000");
  191.     obj.SetPosition("13057.658203 27.043219 3247.424805"); 
  192.     // ############################## Bridge ##################################
  193.     }
  194.    
  195.     void NumPLayersOnServer(){
  196.         ref array<Man> players = new array<Man>;
  197.         GetGame().GetPlayers( players );
  198.         int numPlayers = players.Count();
  199.         for ( int i = 0; i < players.Count(); ++i ){
  200.             Man player = players.Get(i);
  201.             if( player ){
  202.                 string messPlayers = "Players on the server: " + numPlayers.ToString() + "/120"
  203.                 Param1<string> m_MessageParam = new Param1<string>(messPlayers);
  204.                 GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity());
  205.             }
  206.         }
  207.     }
  208.    
  209.     override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
  210.     {  
  211.         bool IsAdmin = false;
  212.         string SteamId_sasaa =  "76561198015080948";
  213.         string SteamId_rene =   "76561197973590083";
  214.         string SteamId_Mauss =  "76561198015299671";
  215.         string SteamId_stefan = "76561198021971615";
  216.         string SteamId_tijmen = "76561198023029756";
  217.         string SteamId_kwast =  "76561198162531126";
  218.        
  219.         if (player.GetIdentity().GetPlainId() == SteamId_sasaa){
  220.             IsAdmin = true;
  221.         } else if (player.GetIdentity().GetPlainId() == SteamId_rene){
  222.             IsAdmin = true;
  223.         } else if (player.GetIdentity().GetPlainId() == SteamId_Mauss){
  224.             IsAdmin = true;
  225.         } else if (player.GetIdentity().GetPlainId() == SteamId_stefan){
  226.             IsAdmin = true;
  227.         } else if (player.GetIdentity().GetPlainId() == SteamId_tijmen){
  228.             IsAdmin = true;
  229.         } else if (player.GetIdentity().GetPlainId() == SteamId_kwast){
  230.             IsAdmin = true;
  231.         } else {
  232.             IsAdmin = false;
  233.         }
  234.         if (IsAdmin){
  235.             //! start auto
  236.             //if (player.GetIdentity().GetPlainId() == SteamId_sasaa){
  237.             //  player.SetPosition("3413.27 24 14808.81"); // spawn @ tisy
  238.             //}
  239.             EntityAI HatchBack;
  240.             vector NewPosition;
  241.             vector OldPosition;
  242.             OldPosition = player.GetPosition();
  243.             NewPosition[0] = OldPosition[0] + 2;
  244.             NewPosition[1] = OldPosition[1] + 0.2;
  245.             NewPosition[2] = OldPosition[2] + 2;
  246.             HatchBack = GetGame().CreateObject( "OffroadHatchback", NewPosition, false, true, true );                  
  247.             HatchBack.GetInventory().CreateAttachment("HatchbackHood");
  248.             HatchBack.GetInventory().CreateAttachment("HatchbackTrunk");
  249.             HatchBack.GetInventory().CreateAttachment("HatchbackWheel");
  250.             HatchBack.GetInventory().CreateAttachment("HatchbackWheel");
  251.             HatchBack.GetInventory().CreateAttachment("HatchbackWheel");
  252.             HatchBack.GetInventory().CreateAttachment("HatchbackWheel");
  253.             HatchBack.GetInventory().CreateAttachment("HatchbackWheel"); //spare
  254.             HatchBack.GetInventory().CreateAttachment("SparkPlug");
  255.             HatchBack.GetInventory().CreateAttachment("EngineBelt");
  256.             HatchBack.GetInventory().CreateAttachment("CarRadiator");
  257.             HatchBack.GetInventory().CreateAttachment("CarBattery");
  258.             auto carfluids = Car.Cast( HatchBack );
  259.                 carfluids.Fill( CarFluid.FUEL, 1000 );
  260.                 carfluids.Fill( CarFluid.OIL, 1000 );
  261.                 carfluids.Fill( CarFluid.BRAKE, 1000 );
  262.                 carfluids.Fill( CarFluid.COOLANT, 1000 );
  263.             //! einde auto
  264.            
  265.             player.RemoveAllItems();
  266.  
  267.             player.GetInventory().CreateInInventory("TTSKOPants");
  268.             player.GetInventory().CreateInInventory("TTsKOJacket_Camo");
  269.             player.GetInventory().CreateInInventory("CombatBoots_Black");
  270.            
  271.             // M4A1 Green
  272.             EntityAI ghillie_m4a1 = player.GetHumanInventory().CreateInHands("M4A1_Green");
  273.             ghillie_m4a1.GetInventory().CreateAttachment("M4_Suppressor");
  274.             ghillie_m4a1.GetInventory().CreateAttachment("M4_RISHndgrd_Green");
  275.             ghillie_m4a1.GetInventory().CreateAttachment("M4_MPBttstck_Green");
  276.             ghillie_m4a1.GetInventory().CreateAttachment("acogoptic");
  277.             //! glitched ghillie_m4a1.GetInventory().CreateAttachment("Mag_STANAGCoupled_30Rnd");
  278.            
  279.             player.GetInventory().CreateInInventory("HuntingBag");
  280.            
  281.             player.GetInventory().CreateInInventory("StoneKnife");
  282.             player.GetInventory().CreateInInventory("SodaCan_Cola");
  283.             player.GetInventory().CreateInInventory("SodaCan_Cola");
  284.             player.GetInventory().CreateInInventory("SodaCan_Cola");
  285.             player.GetInventory().CreateInInventory("SodaCan_Cola");
  286.             player.GetInventory().CreateInInventory("TacticalBaconCan");
  287.             player.GetInventory().CreateInInventory("CanOpener");
  288.             player.GetInventory().CreateInInventory("BandageDressing");
  289.             player.GetInventory().CreateInInventory("DuctTape");
  290.             player.GetInventory().CreateInInventory("AmmoBox_556x45_20Rnd");
  291.             player.GetInventory().CreateInInventory("AmmoBox_556x45_20Rnd");
  292.             player.GetInventory().CreateInInventory("Mag_STANAGCoupled_30Rnd");
  293.             player.GetInventory().CreateInInventory("Mag_STANAGCoupled_30Rnd");
  294.             player.GetInventory().CreateInInventory("AmmoBox_380_35rnd");
  295.             player.GetInventory().CreateInInventory("AmmoBox_380_35rnd");
  296.            
  297.             EntityAI ghilly_flashlight = player.GetHumanInventory().CreateInInventory("Flashlight");
  298.             ghilly_flashlight.GetInventory().CreateAttachment("Battery9V");
  299.            
  300.             // Marakov
  301.             EntityAI ghillie_marakov = player.GetHumanInventory().CreateInInventory("MakarovIJ70");
  302.             ghillie_marakov.GetInventory().CreateAttachment("PistolSuppressor");
  303.             player.GetInventory().CreateInInventory("Mag_IJ70_8Rnd");
  304.             player.GetInventory().CreateInInventory("Mag_IJ70_8Rnd");
  305.            
  306.             // Fireaxe
  307.             EntityAI Fireaxe_ghilly = player.GetHumanInventory().CreateInInventory("FirefighterAxe_Green");
  308.         } else {
  309.             // Rags
  310.             ItemBase Items_Rags = player.GetInventory().CreateInInventory("Rag");
  311.             Items_Rags.SetQuantity(Math.RandomInt(3, 6));
  312.            
  313.             // FNX45
  314.             EntityAI default_FNX45 = player.GetHumanInventory().CreateInInventory("FNX45");
  315.             player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd");
  316.             player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd");
  317.            
  318.             // AKM
  319.             EntityAI default_AKM = player.GetHumanInventory().CreateInHands("AKM");
  320.             default_AKM.GetInventory().CreateAttachment("AK74_Hndgrd_Black");
  321.             default_AKM.GetInventory().CreateAttachment("AK74_WoodBttstck_Black");
  322.             player.GetInventory().CreateInInventory("Mag_AKM_30Rnd");
  323.         }
  324.     }
  325. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement