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

◆ SpawnEntityOnGroundPos()

EntityAI PluginBase::SpawnEntityOnGroundPos ( PlayerBase player,
string item_name,
float health,
float quantity,
vector pos,
bool special = false,
bool withPhysics = false )
inlineprotected

spawns entity on exact position

Аргументы
[in]healthhealth of the item
[in]quantityquantity to set if item.HasQuantity() (-1 == set to max)
[in]posposition where to spawn
Возвращает
entity if ok, null otherwise

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

429 {
430 if ( GetGame().IsServer() )
431 {
432 EntityAI entity = player.SpawnEntityOnGroundPos(item_name, pos);
433 if (entity)
434 SetupSpawnedEntity(player, entity, health, quantity, special);
435 else
436 OnSpawnErrorReport(item_name);
437
438 InventoryItem item;
439 if (Class.CastTo(item, entity) && withPhysics)
440 item.ThrowPhysically(null, "0 0 0");
441
442 return entity;
443 }
444 else
445 {
446 Param6<string, float, float, vector, bool, bool> params = new Param6<string, float, float, vector, bool, bool>(item_name, health, quantity, pos, special, withPhysics);
447 player.RPCSingleParam(ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND, params, true);
448 }
449 return NULL;
450 }
class LogManager EntityAI
ERPCs
Определения ERPCs.c:2
void OnSpawnErrorReport(string name)
Определения PluginDeveloper.c:294
void SetupSpawnedEntity(PlayerBase player, EntityAI entity, float health, float quantity=-1, bool special=false, string presetName="")
Определения PluginDeveloper.c:301
proto native CGame GetGame()

Перекрестные ссылки Class::CastTo(), GetGame(), OnSpawnErrorReport() и SetupSpawnedEntity().

Используется в OnRPCSpawnEntityOnGround(), SpawnEntityInPlayerInventory(), SpawnEntityOnGroundPatternGrid() и SpawnItemOnCrosshair().