视频观看:DayZ服务器新人出生装备修改教程
路径:D:\steamcmd\steamapps\common\DayZServer\mpmissions\dayzOffline.chernarusplus\init.c
用notepad++编辑
- override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
- {
- EntityAI itemTop;
- EntityAI itemEnt;
- ItemBase itemBs;
- float rand;
-
- itemTop = player.FindAttachmentBySlotName("Body");
-
- if ( itemTop )
- {
- itemEnt = itemTop.GetInventory().CreateInInventory("Rag");
- if ( Class.CastTo(itemBs, itemEnt ) )
- itemBs.SetQuantity(4);
- SetRandomHealth(itemEnt);
-
- itemEnt = itemTop.GetInventory().CreateInInventory("RoadFlare");
- SetRandomHealth(itemEnt);
-
- rand = Math.RandomFloatInclusive(0.0, 1.0);
- if ( rand < 0.35 )
- itemEnt = player.GetInventory().CreateInInventory("Apple");
- else if ( rand > 0.65 )
- itemEnt = player.GetInventory().CreateInInventory("Pear");
- else
- itemEnt = player.GetInventory().CreateInInventory("Plum");
-
- SetRandomHealth(itemEnt);
- }
- }
- };
复制代码
添加:
- itemEnt = player.GetInventory().CreateInInventory("TTSKOPants");
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("TTSKOJacket_Camo");
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("AliceBag_Black");
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("CombatBoots_Black");
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("M4A1");
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("Mag_STANAG_30rND");
- SetRandomHealth(itemEnt);
复制代码
视频教程下载链接: https://pan.baidu.com/s/14ZYBb0uejI3Sj1qRJYEZ3Q 提取码: q9vv
编辑:init.c
搜索这段:override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
确实需要点基本功,如果不会改的话,看不懂变量,就直接复制套用吧
直接复制会产生空格,需要粘贴到空文本里把前面的空格删除掉
把这个代码里先复制到notepad++里把前面空格处理一下,
如果不清理掉会报错,如果有能力手写就手写吧,复制的话,就手动删除前面的空格,空格在C语言里也是字符
|