HLFX.Ru Forum Страницы (2): [1] 2 »
Показать все 18 сообщений этой темы на одной странице

HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- Kill Points (https://hlfx.ru/forum/showthread.php?threadid=2981)


Отправлено MisterDeath 03-09-2011 в 00:41:

Хитрота Kill Points

Wrong? could fix please...

Sorry bad english

C++ Source Code:
1
void CScientist::Killed(entvars_t *pAttacker, int iGib)
2
{
3
  SetUse( NULL );
4
  CTalkMonster::Killed( pAttacker, iGib );
5
 
6
 
7
  int score = pev->frags += 1;
8
 
9
  MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
10
  WRITE_BYTE( pAttacker->edict() );
11
  WRITE_SHORT( score );
12
  WRITE_SHORT( 1 );
13
  WRITE_SHORT( 0 );
14
  WRITE_SHORT( 0 );
15
  MESSAGE_END();
16
 
17
 
18
 
19
 
20
 
21
}


scientist.cpp
E:\Halflife\TESTEANDO MOD!!!\neew mod\HLSDK\Single-Player Source\dlls\scientist.cpp(889) : error C2039: 'edict' : is not a member of 'entvars_s'
..\engine\progdefs.h(59) : see declaration of 'entvars_s'
Error executing cl.exe.

__________________
hl 4 ever


Отправлено XaeroX 03-09-2011 в 03:28:

Цитата:
MisterDeath писал:
WRITE_BYTE( pAttacker->edict() );

WRITE_BYTE( ENT(pAttacker) );

__________________

xaerox on Vivino


Отправлено Дядя Миша 03-09-2011 в 08:39:

Цитата:
XaeroX писал:
WRITE_BYTE( ENT(pAttacker) );

No!
This is only works for players and edicts smaller than 255.
You need to rewrite message on the client too, change WRITE_BYTE on the WRITE_ENTITY.

__________________
My Projects: download page

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

Цитата:

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


Отправлено XaeroX 03-09-2011 в 08:45:

А блин, там надо ентиндекс слать же вроде?
Тогда ENTINTEX( pAttacker )

__________________

xaerox on Vivino


Отправлено Дядя Миша 03-09-2011 в 08:53:

XaeroX I do not understand, write it in English

__________________
My Projects: download page

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

Цитата:

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


Отправлено XaeroX 03-09-2011 в 09:01:

Дядя Миша
http://translate.google.ru/

__________________

xaerox on Vivino


Отправлено MisterDeath 03-09-2011 в 13:20:

XaeroX

This not works!!! found errors !!!

__________________
hl 4 ever


Отправлено XaeroX 03-09-2011 в 14:18:

MisterDeath
Where is the compile log?

__________________

xaerox on Vivino


Отправлено MisterDeath 03-09-2011 в 14:59:

XaeroX

C++ Source Code:
1
MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
2
WRITE_BYTE( ENT(pAttacker) );
3
WRITE_SHORT( score );
4
WRITE_SHORT( 1 );
5
WRITE_SHORT( 0 );
6
WRITE_SHORT( 0 );
7
MESSAGE_END();



--------------------Configuration: hl - Win32 Profile--------------------
Compiling...
scientist.cpp
E:\Halflife\TESTEANDO MOD!!!\neew mod\HLSDK\Single-Player Source\dlls\scientist.cpp(889) : error C2664: 'void (int)' : cannot convert parameter 1 from 'struct edict_s *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.

hl.dll - 1 error(s), 0 warning(s)

__________________
hl 4 ever


Отправлено XaeroX 03-09-2011 в 15:11:

MisterDeath
I did correct myself in the next post:

Цитата:
XaeroX писал:
ENTINTEX( pAttacker )

__________________

xaerox on Vivino


Отправлено MisterDeath 03-09-2011 в 15:30:

XaeroX

C++ Source Code:
1
MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
2
WRITE_BYTE( ENTINDEX( pAttacker ) );
3
WRITE_SHORT( score );
4
WRITE_SHORT( 1 );
5
WRITE_SHORT( 0 );
6
WRITE_SHORT( 0 );
7
MESSAGE_END();


--------------------Configuration: hl - Win32 Profile--------------------
Compiling...
scientist.cpp
E:\Halflife\TESTEANDO MOD!!!\neew mod\HLSDK\Single-Player Source\dlls\scientist.cpp(889) : error C2664: 'ENTINDEX' : cannot convert parameter 1 from 'struct entvars_s *' to 'struct edict_s *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.

hl.dll - 1 error(s), 0 warning(s)

__________________
hl 4 ever


Отправлено Дядя Миша 03-09-2011 в 16:14:

C++ Source Code:
1
MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
2
WRITE_BYTE( ENTINDEX( ENT( pAttacker )));
3
WRITE_SHORT( score );
4
WRITE_SHORT( 1 );
5
WRITE_SHORT( 0 );
6
WRITE_SHORT( 0 );
7
MESSAGE_END();

__________________
My Projects: download page

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

Цитата:

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


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

Дядя Миша

Thanks, this code now works!

__________________
hl 4 ever


Отправлено XaeroX 03-09-2011 в 19:44:

А чоита в халфе ентиндекс не конвертит ентварсы?

__________________

xaerox on Vivino


Отправлено MisterDeath 03-09-2011 в 20:10:

XaeroX
Sorry... Not speak russian ( Bad Idiom Translater )

__________________
hl 4 ever


Временная зона GMT. Текущее время 16:39. Страницы (2): [1] 2 »
Показать все 18 сообщений этой темы на одной странице

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