DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnRPCSpawnEntity()

void PluginBase::OnRPCSpawnEntity ( PlayerBase player,
ParamsReadContext ctx )
inlineprotected

См. определение в файле PluginDeveloper.c строка 263

264 {
265 #ifdef DEVELOPER
266 DevSpawnItemParams p = new DevSpawnItemParams(null,"", 0, 0, false, "", FindInventoryLocationType.ANY);
267 if ( ctx.Read(p) )
268 {
269 EntityAI target = EntityAI.Cast(p.param1);
270 PlayerBase playerTarget = PlayerBase.Cast(target);
271
272 EntityAI ent = SpawnEntityInInventory( target, p.param2, p.param3, p.param4, p.param5, "", p.param7);
273 if (playerTarget && p.param5)
274 {
275 if (playerTarget.m_PresetSpawned)
276 {
277 playerTarget.m_PresetSpawned = false;
278 playerTarget.m_PresetItems.Clear();
279 }
280 if (ent)
281 {
282 playerTarget.m_PresetItems.Insert(ent);
283 }
284 }
285 }
286 #endif
287 }
class LogManager EntityAI
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
Param7< EntityAI, string, float, float, bool, string, FindInventoryLocationType > DevSpawnItemParams
Определения PluginDeveloper.c:1
EntityAI SpawnEntityInInventory(notnull EntityAI target, string className, float health, float quantity, bool special=false, string presetName="", FindInventoryLocationType locationType=FindInventoryLocationType.ANY)
tries to spawn item somewhere in inventory
Определения PluginDeveloper.c:502
proto bool Read(void value_in)

Перекрестные ссылки Serializer::Read() и SpawnEntityInInventory().

Используется в OnRPC().