HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- Do Damage (https://hlfx.ru/forum/showthread.php?threadid=2555)
Отправлено S34Qu4K3 16-01-2011 в 23:07:
Do Damage
Hi, how can I do damage to a player in a determinated radius?
I made a UTIL_FindEntityInSphere but I don´t know how to do damage
Thanks in advance
Отправлено XaeroX 17-01-2011 в 02:26:
See UTIL_RadiusDamage code. All you need - to make it work only against players.
__________________
Отправлено S34Qu4K3 17-01-2011 в 20:14:
I´ve tried something with EntityInSphere but i have problems to retrieve the player index
C++ Source Code:
6 | entvars_t *pevOwner = pev; |
11 | if (UTIL_FindEntityInSphere( pStomp, pev->origin, 14096 ) != NULL) |
15 | ALERT( at_console, "pPlayer = %d\n pev = %d\n", pPlayer, pev ); |
16 | ALERT( at_console, "pevOwner = %d %s\n", pevOwner, pevOwner ); |
20 | pPlayer->TakeDamage( pev, pevOwner, 100, DMG_SONIC ); |
21 | ALERT( at_console, "Damage!!!!!\n" ); |
24 | UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 150 ); |
Отправлено Дядя Миша 17-01-2011 в 20:50:
This is completely wrong!
__________________
My Projects: download page
F.A.Q по XashNT
Блог разработчика в телеграме
Цитата:
C:\DOCUME~1\C4C5~1\LOCALS~1\Temp\a33328if(72) : see declaration of 'size_t'
Отправлено S34Qu4K3 17-01-2011 в 21:24:
Yeah, i know it
I´ve tried more things like:
C++ Source Code:
pPlayer = (CBasePlayer *)GET_PRIVATE(pev->owner); |
And nothing
Отправлено XaeroX 18-01-2011 в 02:55:
S34Qu4K3
Forget it. Taki already use UTIL_RadiusDamage (modified a bit)!
__________________