Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Air Drop Mod And Kill Feed Message

Junior Spellweaver
Joined
Sep 5, 2014
Messages
119
Reaction score
8
Found this and thought some people would enjoy it, For 0.63, Not my work just sourced from DayZ forums and other forums Hope you enjoy.

Better airdrops takes the idea of airdrops a bit further by using dynamic flight paths, enhanced location interface, performance and expandability.


This is the first implementation, so constructive criticism is greatly appreciated.


- Dynamic plane flight paths
- Easier control of airdrop locations
- ADM file logging
- Doesnt causes crashes
- Adds item to loot economy (rather unintended but dont tell anyone)


Known Bugs (aka. Help wanted):
- Plane facing is off in some instances
- Sounds do not work
- Particle effects do not work


Installing:


1. edit your init.c
Code: init.c




  1. // Add on top of your file
  2. #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\plugins\\betterairdrop.c"
  3. // Add within your CustomMission
  4. ref BetterAirdrop Airdrop;
  5. void CustomMission() {
  6. Airdrop = new BetterAirdrop();
  7. }

2. create directory called "plugins" within your missions folder (default: dayzOffline.chernarusplus)


3. create file called "betterairdrop.c" in your newly created plugins directory



4. place following code inside the file you just created


Code

  1. class BetterAirdropLocation {
  2. float x, y;
  3. string name;
  4. bool disclose, send_proximity;
  5. TStringArray items;
  6. void BetterAirdropLocation(float x, float y, string name, bool disclose = false, bool send_proximity = false) {
  7. this.x = x;
  8. this.y = y;
  9. this.name = name;
  10. this.disclose = disclose;
  11. this.send_proximity = send_proximity;
  12. }
  13. };
  14. class BetterAirdrop {
  15. /*
  16. * DayZ 0.63 BetterAirdrop by philippj
  17. * inspired by AirDrop from mov3ax
  18. */
  19. /*
  20. * Config
  21. */
  22. bool debug_mode = false; // display d2t & port to target
  23. float interval = 60.0; // Interval in minutes
  24. float initial = 0.5;
  25. float plane_height = 500; // Height in units
  26. float proximity_warning_distance = 750.0;
  27. bool display_basic_information = true;
  28. bool display_coordinates = true;
  29. bool smoke_signal = true;
  30. int infected_count = 20;
  31. int items_to_be_spawned = 10;
  32. int number_of_drops = 1; // number of drops must match the number amount of airdrop locations
  33. ref BetterAirdropLocation airdrop_locations[1] = {
  34. new BetterAirdropLocation(2760.0, 5527.0, "Zelenogorsk Church", true, true),
  35. //new BetterAirdropLocation(4451.0, 10220.0, "NWAF", true, true),
  36. };
  37. /*
  38. * internals
  39. */
  40. Object plane;
  41. vector plane_pos;
  42. vector spawn_pos;
  43. vector drop_pos;
  44. float drop_sim_height_diff = -1;
  45. Object airdrop_obj;
  46. Object tmp_airdrop_obj;
  47. EntityAI airdrop_physics;
  48. Particle signal;
  49. Particle explosion;
  50. bool active = false;
  51. bool dropped = false;
  52. bool sent_proximity_warning = false;
  53. ref BetterAirdropLocation active_drop;
  54. void BetterAirdrop() {
  55. GetGame().AdminLog("<BetterAirdrop> plugin init");
  56. ResetPlane();
  57. GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(InitiateAirdrop, initial*60*1000, false);
  58. }
  59. void InitiateAirdrop() {
  60. ResetPlane();
  61. Cleanup();
  62. Spawn();
  63. GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(InitiateAirdrop, interval*60*1000, false);
  64. }
  65. void Cleanup() {
  66. GetGame().ObjectDelete(airdrop_obj);
  67. }
  68. void ResetPlane() {
  69. GetGame().ObjectDelete(plane);
  70. plane = GetGame().CreateObject( "Land_Wreck_C130J", "0 0 0", false, true, false );
  71. plane_pos[0] = 0;
  72. plane_pos[1] = 0;
  73. plane_pos[2] = 0;
  74. plane.SetPosition(plane_pos);
  75. dropped = false;
  76. active = false;
  77. sent_proximity_warning = false;
  78. if(active_drop.send_proximity) SendMessageToPlayers("The plane has vanished");
  79. }
  80. void MovePlane() {
  81. float angle = Math.Atan2(drop_pos[1]-spawn_pos[1], drop_pos[0]-spawn_pos[0]);
  82. float fixed_angle = angle*Math.RAD2DEG;
  83. plane_pos[0] = Math.Cos(angle);
  84. plane_pos[2] = Math.Sin(angle);
  85. if(plane.GetPosition()[1] < plane_height) plane_pos[1] = plane_height-plane.GetPosition()[1];
  86. else plane_pos[1] = 0;
  87. vector advanced_plane_pos = plane.GetPosition() + (plane_pos*1);
  88. plane.SetPosition( advanced_plane_pos );
  89. if(!dropped) {
  90. float distance = Math.Sqrt(Math.Pow(drop_pos[0] - advanced_plane_pos[0], 2) + Math.Pow(drop_pos[1] - advanced_plane_pos[2], 2));
  91. if(debug_mode) SendMessageToPlayers("DISTANCE2TARGET: "+distance);
  92. if(distance <= 10.0) {
  93. dropped = true;
  94. Drop();
  95. GetGame().AdminLog("<BetterAirdrop> dropped airdrop");
  96. if(active_drop.send_proximity) SendMessageToPlayers("<BetterAirdrop> The airdrop has been dropped at " + active_drop.name);
  97. } else if(distance <= proximity_warning_distance && !sent_proximity_warning) {
  98. sent_proximity_warning = true;
  99. GetGame().AdminLog("<BetterAirdrop> nearing target");
  100. if(active_drop.send_proximity) SendMessageToPlayers("<BetterAirdrop> The airdrop is closing in on its target location (" + active_drop.name + ")");
  101. }
  102. } else {
  103. if(!IsInRect(advanced_plane_pos[0], advanced_plane_pos[1], -10.0, 15470.0, -10.0, 1570.0)) {
  104. GetGame().AdminLog("<BetterAirdrop> cleaning up");
  105. GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).Remove(MovePlane);
  106. GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(ResetPlane, 1000, false);
  107. }
  108. }
  109. }
  110. void DropSimulation() {
  111. float ground = GetGame().SurfaceY(airdrop_obj.GetPosition()[0], airdrop_obj.GetPosition()[2]);
  112. //GetGame().AdminLog("GROUND: "+ground+"; HEIGHT: "+airdrop_physics.GetPosition()[1]+"; DIFF: "+drop_sim_height_diff);
  113. if (airdrop_physics.GetPosition()[1] <= (ground+3) ) { // || (drop_sim_height_diff != -1 && X)
  114. GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).Remove(DropSimulation);
  115. vector tmp_pos = airdrop_obj.GetPosition();
  116. tmp_pos[1] = ground;
  117. GetGame().ObjectDelete(airdrop_physics);
  118. airdrop_obj.SetPosition(tmp_pos);
  119. airdrop_obj.PlaceOnSurface();
  120. Particle.Play(ParticleList.RDG2, tmp_pos); // not working
  121. Particle.Play(ParticleList.ROADFLARE_BURNING_MAIN, tmp_pos);
  122. AfterDrop();
  123. } else {
  124. drop_sim_height_diff = airdrop_obj.GetPosition()[1]-airdrop_physics.GetPosition()[1];
  125. vector airdrop_obj_pos;
  126. airdrop_obj_pos[0] = drop_pos[0];
  127. airdrop_obj_pos[1] = airdrop_physics.GetPosition()[1];
  128. airdrop_obj_pos[2] = drop_pos[1];
  129. airdrop_obj.SetPosition(airdrop_obj_pos);
  130. airdrop_obj.SetOrientation(airdrop_physics.GetOrientation());
  131. }
  132. }
  133. void AfterDrop() {
  134. float ground = GetGame().SurfaceY(airdrop_obj.GetPosition()[0], airdrop_obj.GetPosition()[2]);
  135. vector base_pos = airdrop_obj.GetPosition(), dynamic_pos;
  136. base_pos[1] = ground + 0.2;
  137. /*
  138. // TODO: #fix | Returns random strings for some reason
  139. for ( int i = 0; i < active_drop.items.Count(); i++ ) {
  140. string item = active_drop.items.Get(i);
  141. GetGame().AdminLog("" + item);
  142. }
  143. */
  144. for(int i = 0; i < items_to_be_spawned; i++) {
  145. dynamic_pos = base_pos;
  146. dynamic_pos[0] = dynamic_pos[0]+Math.RandomFloat(2.0, 3.0);
  147. dynamic_pos[2] = dynamic_pos[2]+Math.RandomFloat(2.0, 3.0);
  148. string item = GetRandomItem();
  149. GetGame().CreateObject(item, dynamic_pos, false, true);
  150. }
  151. for ( int inf = 0; inf < infected_count; inf++ ) {
  152. dynamic_pos = base_pos;
  153. dynamic_pos[0] = dynamic_pos[0]+Math.RandomFloat(-20.0, 20.0);
  154. dynamic_pos[2] = dynamic_pos[2]+Math.RandomFloat(-20.0, 20.0);
  155. GetGame().CreateObject( WorkingZombieClasses().GetRandomElement(), dynamic_pos, false, true );
  156. }
  157. }
  158. void Drop() {
  159. GetGame().AdminLog("<BetterAirdrop> initiated drop physics");
  160. airdrop_physics = EntityAI.Cast(GetGame().CreateObject( "CivilianSedan", plane.GetPosition(), true, true ));
  161. airdrop_physics.SetAllowDamage(false);
  162. airdrop_obj = GetGame().CreateObject( "Land_Container_1Bo", plane.GetPosition(), false, true );
  163. SetVelocity(airdrop_physics, "10 0 0");
  164. GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(DropSimulation, 10, true);
  165. }
  166. void Spawn() {
  167. GetGame().CreateSoundOnObject(plane, "powerGeneratorLoop", 10000.0, true); // not working
  168. plane.PlaySoundLoop("powerGeneratorLoop", 10000.0, true); // not working
  169. GetGame().AdminLog("<BetterAirdrop> airdrop init");
  170. // TODO: dynamic plane spawns
  171. int side = Math.RandomInt(0,4);
  172. switch(side) {
  173. case 0: {
  174. spawn_pos[0] = 0.0;
  175. spawn_pos[1] = Math.RandomFloat(0.0, 15360.0);
  176. break;
  177. }
  178. case 1: {
  179. spawn_pos[0] = 15360.0;
  180. spawn_pos[1] = Math.RandomFloat(0.0, 15360.0);
  181. break;
  182. }
  183. case 2: {
  184. spawn_pos[0] = Math.RandomFloat(0.0, 15360.0);
  185. spawn_pos[1] = 0.0;
  186. break;
  187. }
  188. case 3: {
  189. spawn_pos[0] = Math.RandomFloat(0.0, 15360.0);
  190. spawn_pos[1] = 15360.0;
  191. break;
  192. }
  193. }
  194. vector plane_start_pos;
  195. plane_start_pos[0] = spawn_pos[0];
  196. plane_start_pos[2] = spawn_pos[1];
  197. plane.SetPosition(plane_start_pos);
  198. // select random drop
  199. BetterAirdropLocation default_drop = new BetterAirdropLocation(2760.0, 5527.0, "ravioli ravioli gib mir die formeloli", true, true);
  200. if(number_of_drops < 1) {
  201. GetGame().AdminLog("<BetterAirdrop> No random locations defined, using fallback");
  202. active_drop = default_drop;
  203. } else {
  204. active_drop = airdrop_locations[Math.RandomInt(0, number_of_drops - 1)];
  205. }
  206. if(debug_mode) {
  207. vector tmp_pos;
  208. tmp_pos[0] = active_drop.x;
  209. tmp_pos[1] = GetGame().SurfaceY(active_drop.x, active_drop.y)+1.0;
  210. tmp_pos[2] = active_drop.y;
  211. TeleportPlayers(tmp_pos);
  212. }
  213. if(active_drop.disclose) SendMessageToPlayers("<BetterAirdrop> An airdrop has been spotted heading towards " + active_drop.name);
  214. drop_pos[0] = active_drop.x;
  215. drop_pos[1] = active_drop.y;
  216. float angle = Math.Atan2(drop_pos[1]-spawn_pos[1], drop_pos[0]-spawn_pos[0]);
  217. float fixed_angle = angle*Math.RAD2DEG;
  218. vector plane_orientation;
  219. plane_orientation[0] = 90+fixed_angle;
  220. if(plane_orientation[0] > 360.0) {
  221. plane_orientation[0] = plane_orientation[0] - 360.0;
  222. }
  223. plane_orientation[1] = 0.0;
  224. plane_orientation[2] = 0.0;
  225. plane.SetOrientation(plane_orientation);
  226. float distance = Math.Sqrt(Math.Pow(spawn_pos[0] - drop_pos[0], 2) + Math.Pow(spawn_pos[1] - drop_pos[2], 2));
  227. GetGame().AdminLog("<BetterAirdrop> INBOUND " + active_drop.name + " AT [X: "+active_drop.x+"; Y: "+active_drop.y+"] START [X: "+spawn_pos[0]+"; Y: "+spawn_pos[1]+"] DISTANCE2TARGET: "+distance + "; FACINGANGLE:"+fixed_angle);
  228. GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(MovePlane, 20, true);
  229. }
  230. void SendMessageToPlayers(string message) {
  231. ref array<Man> players = new array<Man>;
  232. GetGame().GetPlayers( players );
  233. for ( int i = 0; i < players.Count(); i++ )
  234. {
  235. PlayerBase player = players.Get(i);
  236. Param1<string> message_param = new Param1<string>(message);
  237. GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, message_param, true, player.GetIdentity());
  238. }
  239. }
  240. void TeleportPlayers(vector pos) {
  241. ref array<Man> players = new array<Man>;
  242. GetGame().GetPlayers( players );
  243. for ( int i = 0; i < players.Count(); i++ ) {
  244. Man player = players.Get(i);
  245. player.SetPosition(pos);
  246. }
  247. }
  248. bool IsInRect(float x, float y, float min_x, float max_x, float min_y, float max_y) {
  249. if(x > min_x && x < max_x && y > min_y && y < max_y) return true;
  250. return false;
  251. }
  252. string GetRandomItem() {
  253. TStringArray loot = {
  254. "LandMineTrap",
  255. "M4A1",
  256. };
  257. return loot.GetRandomElement();
  258. }
  259. TStringArray WorkingZombieClasses()
  260. {
  261. return {
  262. "ZmbM_HermitSkinny_Base","ZmbM_HermitSkinny_Beige","ZmbM_HermitSkinny_Black","ZmbM_HermitSkinny_Green",
  263. "ZmbM_HermitSkinny_Red","ZmbM_FarmerFat_Base","ZmbM_FarmerFat_Beige","ZmbM_FarmerFat_Blue","ZmbM_FarmerFat_Brown",
  264. "ZmbM_FarmerFat_Green","ZmbF_CitizenANormal_Base","ZmbF_CitizenANormal_Beige","ZmbF_CitizenANormal_Brown",
  265. "ZmbF_CitizenANormal_Blue","ZmbM_CitizenASkinny_Base","ZmbM_CitizenASkinny_Blue","ZmbM_CitizenASkinny_Brown",
  266. "ZmbM_CitizenASkinny_Grey","ZmbM_CitizenASkinny_Red","ZmbM_CitizenBFat_Base","ZmbM_CitizenBFat_Blue","ZmbM_CitizenBFat_Red",
  267. "ZmbM_CitizenBFat_Green","ZmbF_CitizenBSkinny_Base","ZmbF_CitizenBSkinny","ZmbM_PrisonerSkinny_Base","ZmbM_PrisonerSkinny",
  268. "ZmbM_FirefighterNormal_Base","ZmbM_FirefighterNormal","ZmbM_FishermanOld_Base","ZmbM_FishermanOld_Blue","ZmbM_FishermanOld_Green",
  269. "ZmbM_FishermanOld_Grey","ZmbM_FishermanOld_Red","ZmbM_JournalistSkinny_Base","ZmbM_JournalistSkinny","ZmbF_JournalistNormal_Base",
  270. "ZmbF_JournalistNormal_Blue","ZmbF_JournalistNormal_Green","ZmbF_JournalistNormal_Red","ZmbF_JournalistNormal_White",
  271. "ZmbM_ParamedicNormal_Base","ZmbM_ParamedicNormal_Blue","ZmbM_ParamedicNormal_Green","ZmbM_ParamedicNormal_Red",
  272. "ZmbM_ParamedicNormal_Black","ZmbF_ParamedicNormal_Base","ZmbF_ParamedicNormal_Blue","ZmbF_ParamedicNormal_Green",
  273. "ZmbF_ParamedicNormal_Red","ZmbM_HikerSkinny_Base","ZmbM_HikerSkinny_Blue","ZmbM_HikerSkinny_Green","ZmbM_HikerSkinny_Yellow",
  274. "ZmbF_HikerSkinny_Base","ZmbF_HikerSkinny_Blue","ZmbF_HikerSkinny_Grey","ZmbF_HikerSkinny_Green","ZmbF_HikerSkinny_Red",
  275. "ZmbM_HunterOld_Base","ZmbM_HunterOld_Autumn","ZmbM_HunterOld_Spring","ZmbM_HunterOld_Summer","ZmbM_HunterOld_Winter",
  276. "ZmbF_SurvivorNormal_Base","ZmbF_SurvivorNormal_Blue","ZmbF_SurvivorNormal_Orange","ZmbF_SurvivorNormal_Red",
  277. "ZmbF_SurvivorNormal_White","ZmbM_SurvivorDean_Base","ZmbM_SurvivorDean_Black","ZmbM_SurvivorDean_Blue","ZmbM_SurvivorDean_Grey",
  278. "ZmbM_PolicemanFat_Base","ZmbM_PolicemanFat","ZmbF_PoliceWomanNormal_Base","ZmbF_PoliceWomanNormal","ZmbM_PolicemanSpecForce_Base",
  279. "ZmbM_PolicemanSpecForce","ZmbM_SoldierNormal_Base","ZmbM_SoldierNormal","ZmbM_usSoldier_normal_Base",
  280. "ZmbM_usSoldier_normal_Woodland","ZmbM_usSoldier_normal_Desert","ZmbM_CommercialPilotOld_Base","ZmbM_CommercialPilotOld_Blue",
  281. "ZmbM_CommercialPilotOld_Olive","ZmbM_CommercialPilotOld_Brown","ZmbM_CommercialPilotOld_Grey","ZmbM_PatrolNormal_Base",
  282. "ZmbM_PatrolNormal_PautRev","ZmbM_PatrolNormal_Autumn","ZmbM_PatrolNormal_Flat","ZmbM_PatrolNormal_Summer","ZmbM_JoggerSkinny_Base",
  283. "ZmbM_JoggerSkinny_Blue","ZmbM_JoggerSkinny_Green","ZmbM_JoggerSkinny_Red","ZmbF_JoggerSkinny_Base","ZmbF_JoggerSkinny_Blue",
  284. "ZmbF_JoggerSkinny_Brown","ZmbF_JoggerSkinny_Green","ZmbF_JoggerSkinny_Red","ZmbM_MotobikerFat_Base","ZmbM_MotobikerFat_Beige",
  285. "ZmbM_MotobikerFat_Black","ZmbM_MotobikerFat_Blue","ZmbM_VillagerOld_Base","ZmbM_VillagerOld_Blue","ZmbM_VillagerOld_Green",
  286. "ZmbM_VillagerOld_White","ZmbM_SkaterYoung_Base","ZmbM_SkaterYoung_Blue","ZmbM_SkaterYoung_Brown","ZmbM_SkaterYoung_Green",
  287. "ZmbM_SkaterYoung_Grey","ZmbF_SkaterYoung_Base","ZmbF_SkaterYoung_Brown","ZmbF_SkaterYoung_Striped","ZmbF_SkaterYoung_Violet",
  288. "ZmbF_DoctorSkinny_Base","ZmbF_DoctorSkinny","ZmbF_BlueCollarFat_Base","ZmbF_BlueCollarFat_Blue","ZmbF_BlueCollarFat_Green",
  289. "ZmbF_BlueCollarFat_Red","ZmbF_BlueCollarFat_White","ZmbF_MechanicNormal_Base","ZmbF_MechanicNormal_Beige","ZmbF_MechanicNormal_Green",
  290. "ZmbF_MechanicNormal_Grey","ZmbF_MechanicNormal_Orange","ZmbM_MechanicSkinny_Base","ZmbM_MechanicSkinny_Blue","ZmbM_MechanicSkinny_Grey",
  291. "ZmbM_MechanicSkinny_Green","ZmbM_MechanicSkinny_Red","ZmbM_ConstrWorkerNormal_Base","ZmbM_ConstrWorkerNormal_Beige",
  292. "ZmbM_ConstrWorkerNormal_Black","ZmbM_ConstrWorkerNormal_Green","ZmbM_ConstrWorkerNormal_Grey","ZmbM_HeavyIndustryWorker_Base",
  293. "ZmbM_HeavyIndustryWorker","ZmbM_OffshoreWorker_Base","ZmbM_OffshoreWorker_Green","ZmbM_OffshoreWorker_Orange","ZmbM_OffshoreWorker_Red",
  294. "ZmbM_OffshoreWorker_Yellow","ZmbF_NurseFat_Base","ZmbF_NurseFat","ZmbM_HandymanNormal_Base","ZmbM_HandymanNormal_Beige",
  295. "ZmbM_HandymanNormal_Blue","ZmbM_HandymanNormal_Green","ZmbM_HandymanNormal_Grey","ZmbM_HandymanNormal_White","ZmbM_DoctorFat_Base",
  296. "ZmbM_DoctorFat","ZmbM_Jacket_Base","ZmbM_Jacket_beige","ZmbM_Jacket_black","ZmbM_Jacket_blue","ZmbM_Jacket_bluechecks",
  297. "ZmbM_Jacket_brown","ZmbM_Jacket_greenchecks","ZmbM_Jacket_grey","ZmbM_Jacket_khaki","ZmbM_Jacket_magenta","ZmbM_Jacket_stripes",
  298. "ZmbF_PatientOld_Base","ZmbF_PatientOld","ZmbM_PatientSkinny_Base","ZmbM_PatientSkinny","ZmbF_ShortSkirt_Base","ZmbF_ShortSkirt_beige",
  299. "ZmbF_ShortSkirt_black","ZmbF_ShortSkirt_brown","ZmbF_ShortSkirt_green","ZmbF_ShortSkirt_grey","ZmbF_ShortSkirt_checks",
  300. "ZmbF_ShortSkirt_red","ZmbF_ShortSkirt_stripes","ZmbF_ShortSkirt_white","ZmbF_ShortSkirt_yellow","ZmbF_VillagerOld_Base",
  301. "ZmbF_VillagerOld_Blue","ZmbF_VillagerOld_Green","ZmbF_VillagerOld_Red","ZmbF_VillagerOld_White","ZmbM_Soldier","ZmbM_SoldierAlice",
  302. "ZmbM_SoldierHelmet","ZmbM_SoldierVest","ZmbM_SoldierAliceHelmet","ZmbM_SoldierVestHelmet","ZmbF_MilkMaidOld_Base",
  303. "ZmbF_MilkMaidOld_Beige","ZmbF_MilkMaidOld_Black","ZmbF_MilkMaidOld_Green","ZmbF_MilkMaidOld_Grey","ZmbM_priestPopSkinny_Base",
  304. "ZmbM_priestPopSkinny","ZmbM_ClerkFat_Base","ZmbM_ClerkFat_Brown","ZmbM_ClerkFat_Grey","ZmbM_ClerkFat_Khaki","ZmbM_ClerkFat_White",
  305. "ZmbF_Clerk_Normal_Base","ZmbF_Clerk_Normal_Blue","ZmbF_Clerk_Normal_White","ZmbF_Clerk_Normal_Green","ZmbF_Clerk_Normal_Red",
  306. };
  307. }
  308. }

You can add Airdrop locations by adding lines under "airdrop_locations" in following format
Code




  1. new BetterAirdropLocation(X, Y, NAME, true, true),


the last "," is important. Aswell when adding airdrops you have to set "number_of_drops" to the amount of airdrops defined and update the array length (number betwenn "[]" behind "airdrop_locations") to the same number


To customize loot you can edit "GetRandomItem" and add/remove items from the loot table. It is advised to not use weapons as they spawn without any attachments.

How To Video Here from Original Author.....
[video=youtube;kYgzQY_wy94]https://www.youtube.com/watch?feature=player_embedded&v=kYgzQY_wy94[/video]

This is a killfeed code I found Ive not tested yet but apparently is working.

Mod the SurvivorBase with this in line 3

private string PlayerIdentityName = "empty";

string GetPlayerIdentityName()
{
return this.PlayerIdentityName;
}

void SetPlayerIdentityName(string name)
{
this.PlayerIdentityName = name;
}

Then added in PlayerBase -> EEKilled line 306

SurvivorBase sbKilled = this;

if (killer.IsMan()) {
Man manKiller = Man.Cast(killer);
GetGame().ChatPlayer( 0, sbKilled.GetPlayerIdentityName() + " Killed By " + manKiller.GetIdentity().GetName());
} else {
GetGame().ChatPlayer( 0, sbKilled.GetPlayerIdentityName() + " Killed by zombie/bleedout/fall?");
}

and added in PlayerBase -> OnConnect line 3313

SurvivorBase sb = this;
sb.SetPlayerIdentityName(this.GetIdentity().GetName());

Extract scripts.pbo
Then follow instructions from the above i've quoted.
Playerbase.c is in scripts\4_World\Entities\ManBase
Survivorbase.c is in scripts\4_World\Entities\ManBase\PlayerBase
Repack scripts.pbo

I will test and reply soon and edit this post accordingly.
Air drop works well for me.
 
Last edited:
Newbie Spellweaver
Joined
Sep 25, 2018
Messages
8
Reaction score
2
Found this and thought some people would enjoy it, For 0.63, Not my work just sourced from DayZ forums and other forums Hope you enjoy.



This is a killfeed code I found Ive not tested yet but apparently is working.



I cant test it yet as I dont know where to put it for killfeed to work :p: feel free to let me know.
Air drop works well for me.

Can you link me the sources please?
The killfeed intrests me a lot! But your Install guide is a bit weird. so i need the sources. Thx
 
Junior Spellweaver
Joined
Sep 5, 2014
Messages
119
Reaction score
8
Check for instructions for killfeed in OP
 
Last edited:
Newbie Spellweaver
Joined
Sep 25, 2018
Messages
8
Reaction score
2
Check for instructions for killfeed in OP

Figured it out on my own, your describtion was very hard to understand

For all who struggle like me, here is my installguide:

1. in your Rootfolder of DayZ navigate to dta.
2. in the dta folder unpack scripts.pbo via pbo manager (downloadable via google ; Just search: PBO MANAGER DOWLOAD ; 1st search result)
3.Navigate to: 4_World folder and open it up.
4.Open "Entities" folder.
5.Open "ManBase" folder.
6. From here you Open the "PlayerBase.c" with your favorite edit program and navigate to line 306!
7.In my case i added the code after the existing code. That means after line 337. The code to add is:

SurvivorBase sbKilled = this;

if (killer.IsMan()) {
Man manKiller = Man.Cast(killer);
GetGame().ChatPlayer( 0, sbKilled.GetPlayerIdentityName() + " Killed By " + manKiller.GetIdentity().GetName());
} else {
GetGame().ChatPlayer( 0, sbKilled.GetPlayerIdentityName() + " Killed by zombie/bleedout/fall?");
}


8.Save the file!
9.Stay in your current Directory, but open up the folder Playerbase, and open the File SurvivorBase.c
10. Replace the code with this:

class SurvivorBase extends PlayerBaseClient
{
private string PlayerIdentityName = "empty"; //KillFeed

string GetPlayerIdentityName()
{
return this.PlayerIdentityName;
}

void SetPlayerIdentityName(string name)
{
this.PlayerIdentityName = name;
}
}


11. Save this file and go back where you extracted the Files, repack it via pbo manager, load it up to your server, and have Phun :D

PS: In the PlayerBase.c file, just where we added the code, there is some Output we can change into whatever we want to print by kill, or in a death case, for example:

We added the code:
SurvivorBase sbKilled = this;

if (killer.IsMan()) {
Man manKiller = Man.Cast(killer);
GetGame().ChatPlayer( 0, sbKilled.GetPlayerIdentityName() + " Killed By " + manKiller.GetIdentity().GetName());
} else {
GetGame().ChatPlayer( 0, sbKilled.GetPlayerIdentityName() + " Killed by zombie/bleedout/fall?");
}

But if we want to change the Printmessages to whatever we want you can do it like this:


SurvivorBase sbKilled = this; //KillFeed

if (killer.IsMan()) {
Man manKiller = Man.Cast(killer);
GetGame().ChatPlayer(0, sbKilled.GetPlayerIdentityName() + " punished By " + manKiller.GetIdentity().GetName());
}
else {
GetGame().ChatPlayer(0, sbKilled.GetPlayerIdentityName() + " just died!");
}

Hope this helps. GL HF!:8:

Greetz S4MT3K :eek:tt1:
 
Junior Spellweaver
Joined
Sep 5, 2014
Messages
119
Reaction score
8
I want to implement the Airdrop event into DaOnes ScriptedMods so its setup like the hoardes and buildings etc,.. DaOne if you read this,.. please can you add this into your Mods, Thanks! Also Mods need updating... again lol.. another patch released today, Great work and all the best.
 
Back
Top