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

◆ SpawnItemOnCrosshair()

void PluginBase::SpawnItemOnCrosshair ( PlayerBase player,
string itemName,
float health,
float quantity,
float maxDist = 100,
bool allowFreeflight = false,
bool special = false,
bool withPhysics = false )
inlineprotected

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

511 {
512 vector from, to, dir;
513 GetCameraDirections(player, true, from, dir);
514 to = from + (dir * maxDist);
515
516 float hitFraction;
517 vector start, end;
518 vector direction;
519
520 vector hitPos, hitNormal;
521 Object obj;
522
524 DayZPhysics.RayCastBullet(from, to, hitMask, player, obj, hitPos, hitNormal, hitFraction);
525
526 // something is hit
527 if (hitPos != vector.Zero)
528 {
529 SpawnEntityOnGroundPos(player, itemName, health, quantity, hitPos, special, withPhysics);
530 }
531 }
PhxInteractionLayers
Определения DayZPhysics.c:2
float hitFraction
Определения DustKickupEffects.c:23
EntityAI SpawnEntityOnGroundPos(PlayerBase player, string object_name, vector pos)
Определения PluginDeveloper.c:478
void GetCameraDirections(Man player, bool allowFreeflight, out vector position, out vector direction)
Определения PluginDeveloper.c:459
class LOD Object

Перекрестные ссылки GetCameraDirections(), hitFraction, DayZPhysics::RayCastBullet(), SpawnEntityOnGroundPos() и vector::Zero.

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