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

◆ SpawnEntityOnCursorDir()

EntityAI PluginBase::SpawnEntityOnCursorDir ( PlayerBase player,
string item_name,
float quantity,
float distance,
float health = -1,
bool special = false,
string presetName = "",
bool withPhysics = false )
inlineprotected

spawns entity in direction of cursor at specified distance

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

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

573 {
574
575 if ( g_Game.IsServer() )
576 {
577 // Client -> Server Spawning: Server Side
578 EntityAI entity = player.SpawnEntityOnGroundOnCursorDir(item_name, distance);
579
580 if ( entity )
581 {
582 if ( !entity.IsBuilding() && health < 0 && entity.GetMaxHealth() > 0)//check for default (-1)
583 {
584 health = entity.GetMaxHealth();
585 }
586 SetupSpawnedEntity( player,entity, health, quantity, special, presetName );
587 }
588 else
589 OnSpawnErrorReport( item_name );
590
591 InventoryItem item;
592 if (Class.CastTo(item, entity) && withPhysics)
593 item.ThrowPhysically(null, "0 0 0");
594
595 return entity;
596 }
597 else
598 {
599 // Client -> Server Spawning: Client Side
600 Param7<string, float, float, float, bool, string, bool> params = new Param7<string, float, float, float, bool, string, bool>(item_name, quantity, distance, health, special, presetName, withPhysics);
601 player.RPCSingleParam(ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR, params, true);
602 }
603 return NULL;
604 }
class LogManager EntityAI
DayZGame g_Game
Определения DayZGame.c:4074
ERPCs
Определения ERPCs.c:2
void OnSpawnErrorReport(string name)
Определения PluginDeveloper.c:343
void SetupSpawnedEntity(PlayerBase player, EntityAI entity, float health, float quantity=-1, bool special=false, string presetName="")
Определения PluginDeveloper.c:350

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

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