DayZ 1.29
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 строка 523

524 {
525
526 if ( g_Game.IsServer() )
527 {
528 // Client -> Server Spawning: Server Side
529 EntityAI entity = player.SpawnEntityOnGroundOnCursorDir(item_name, distance);
530
531 if ( entity )
532 {
533 if ( !entity.IsBuilding() && health < 0 && entity.GetMaxHealth() > 0)//check for default (-1)
534 {
535 health = entity.GetMaxHealth();
536 }
537 SetupSpawnedEntity( player,entity, health, quantity, special, presetName );
538 }
539 else
540 OnSpawnErrorReport( item_name );
541
542 InventoryItem item;
543 if (Class.CastTo(item, entity) && withPhysics)
544 item.ThrowPhysically(null, "0 0 0");
545
546 return entity;
547 }
548 else
549 {
550 // Client -> Server Spawning: Client Side
551 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);
552 player.RPCSingleParam(ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR, params, true);
553 }
554 return NULL;
555 }
class LogManager EntityAI
DayZGame g_Game
Определения DayZGame.c:3942
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

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

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