HLFX.Ru Forum
Показать все 9 сообщений этой темы на одной странице

HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- Detect entities in sphere (https://hlfx.ru/forum/showthread.php?threadid=3332)


Отправлено MisterDeath 29-03-2012 в 22:40:

Half-Life Detect entities in sphere

How to detect a entitie in sphere ?

C++ Source Code:
1
void CGravitySpot::Absorb( void )
2
{
3
  CBaseEntity *pEntity = NULL;
4
 
5
  if ((pEntity = UTIL_FindEntityInSphere( pEntity, pev->origin, 100 )) != NULL)
6
  {
7
 
8
    if (!pEntity->IsPlayer() )
9
    {
10
      UTIL_SetOrigin( pEntity->pev, pev->origin );
11
    }
12
 
13
  }
14
  SetThink( Absorb );
15
  pev->nextthink = gpGlobals->time + 0.01;
16
 
17
}

__________________
hl 4 ever


Отправлено Дядя Миша 30-03-2012 в 04:24:

what do you need?

__________________
My Projects: download page

F.A.Q по XashNT
Блог разработчика в телеграме

Цитата:

C:\DOCUME~1\C4C5~1\LOCALS~1\Temp\a33328if(72) : see declaration of 'size_t'


Отправлено MisterDeath 30-03-2012 в 17:16:

Цитата:
Дядя Миша писал:


i created a gravity gun, the problem is created a UTIL_FindEntityInSphere in tr.vecEndPos, now have a 3 entities in the sphere.. i can only hook 1 entitie in sphere, how to ?

sorry bad english

__________________
hl 4 ever


Отправлено Ozzy 31-03-2012 в 06:47:

Цитата:
MisterDeath писал:
sorry bad english

so,why dont you type russian ?

__________________
удалено по соображениям цензуры


Отправлено Дядя Миша 31-03-2012 в 11:38:

Цитата:
Ozzy писал:
so,why dont you type russian ?

because Ozzy is "negey"
Наливает в samovar vodka, plyashet с medved'

__________________
My Projects: download page

F.A.Q по XashNT
Блог разработчика в телеграме

Цитата:

C:\DOCUME~1\C4C5~1\LOCALS~1\Temp\a33328if(72) : see declaration of 'size_t'


Отправлено XaeroX 31-03-2012 в 11:44:

Меня смущает тот факт, что все наши "псевдо-иностранцы" сидят через прокси-серверы. Кажется, кому-то пора залогиниться.

__________________

xaerox on Vivino


Отправлено pRoxxx 31-03-2012 в 17:11:

Цитата:
MisterDeath писал:
now have a 3 entities in the sphere.. i can only hook 1 entitie in sphere, how to ?


code:
for(int i = 0; i < 3, i++) { if ((pEntity = UTIL_FindEntityInSphere( pEntity, pev->origin, 100 )) == NULL) break;


Отправлено marikcool 31-03-2012 в 18:24:

Цитата:
pRoxxx писал:
for(int i = 0; i < 3, i++)
{

if ((pEntity = UTIL_FindEntityInSphere( pEntity, pev->origin, 100 )) == NULL)
break;

надо while до тех пока не будет NULL


Отправлено pRoxxx 31-03-2012 в 18:53:

Цитата:
marikcool писал:
надо while до тех пока не будет NULL

не ну ему жеж надо не больше трех.


Временная зона GMT. Текущее время 10:02.
Показать все 9 сообщений этой темы на одной странице

На основе vBulletin версии 2.3.0
Авторское право © Jelsoft Enterprises Limited 2000 - 2002.
Дизайн и программирование: Crystice Softworks © 2005 - 2024