OnPlayerTakeDamage (projectiles)
#1

Looks like OnPlayerGive/TakeDamage doesn't support weapon grenade, molotov and other throwable weapons. Anyone can confirm that?

I am doing my own weapon damages, and it doesn't take any damage made by molotov or grenade. I've checked both callbacks.
Reply
#2

Look for ID 51 (Explosion) and ID 37 (Flamethrower, also caused by any fire)
Reply
#3

Quote:
Originally Posted by BigETI
Посмотреть сообщение
Look for ID 51 (Explosion) and ID 37 (Flamethrower, also caused by any fire)
Well, it works then. Thanks, but I still think it should be fixed
Reply
#4

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
Well, it works then. Thanks, but I still think it should be fixed
Dunno If you have played Counter Strike, but the id of grenades and so it's like if that weapon touchs you and takes you one hp for example, you could change that value.
Reply
#5

GiveDamage doesn't detect explosions and car collisions as far I know, but TakeDamage does. So, I also think that it should be fixed.
Reply
#6

I can confirm this, I have spent countless hours trying to get throwables to work in OnPlayerGiveDamage, and the only thing you can hurt is yourself. Unless, like Stront says, the grenade actually hits the player.

It's also the same for rockets, and it seems like OnPlayerGiveDamage GetPlayerTargetPlayer will return INVALID_PLAYER_ID unless your crosshair is aiming at the skin - ex: the projectile spread of shotguns will call OnPlayerGiveDamage even if your crosshair is not aiming directly at the damagedid and the projectiles still hit the damagedid, so GetPlayerTargetPlayer will return INVALID_PLAYER_ID.
Reply
#7

OnPlayerTakeDamage detects properly explosions and issuerid as long as the weapon is a rocket launcher/grenades/satchel charges and the issuerid isn't yourself (Haven't tested with rhino/hunter/hydra); If you hurt yourself with such it will return INVALID_PLAYER_ID instead of yourself as issuerid at Onplayertakedamage.
Reply
#8

Awesome, thanks CuervO, I now have working grenades 'cause of you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)