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

◆ SetupSpawnedEntity()

void PluginBase::SetupSpawnedEntity ( PlayerBase player,
EntityAI entity,
float health,
float quantity = -1,
bool special = false,
string presetName = "" )
inlineprotected

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

302 {
303 #ifdef DEVELOPER
304 if (presetName && player.m_PresetSpawned)//this is how we ascertain this is the first item being spawned from a new preset after a previous preset was already spawned in
305 {
306 player.m_PresetItems.Clear();
307 player.m_PresetSpawned = false;//is set to 'true' elsewhere after all the items have been spawned in
308 }
309 if ( entity.IsInherited( PlayerBase ) )
310 {
311 PlayerBase plr = PlayerBase.Cast( entity );
312 plr.OnSpawnedFromConsole();
313 }
314 else if ( entity.IsInherited(ItemBase) )
315 {
316 ItemBase item = ItemBase.Cast( entity );
317 SetupSpawnedItem(item, health, quantity);
318 }
319 else if (entity.IsInherited(House))
320 {
321 entity.PlaceOnSurface();
322 vector pos = entity.GetPosition();
323 vector ori = GetGame().GetSurfaceOrientation(pos[0], pos[2]);
324 entity.SetOrientation(ori);
325 }
326 if (presetName)
327 {
328 player.m_PresetItems.Insert(entity);
329 }
330
331 if ( special )
332 {
333 auto debugParams = DebugSpawnParams.WithPlayer(player);
334 entity.OnDebugSpawnEx(debugParams);
335 }
336 #endif
337 }
class GP5GasMask extends MaskBase ItemBase
void SetupSpawnedItem(ItemBase item, float health, float quantity)
Определения ItemBase.c:4803
vector GetSurfaceOrientation(float x, float z)
Returns tilt of the ground on the given position in degrees, so you can use this value to rotate any ...
Определения Game.c:1143
proto native CGame GetGame()

Перекрестные ссылки GetGame(), CGame::GetSurfaceOrientation() и SetupSpawnedItem().

Используется в SpawnEntityOnCursorDir() и SpawnEntityOnGroundPos().