SA-MP Forums Archive
OnPlayerTakeDamage (projectiles) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerTakeDamage (projectiles) (/showthread.php?tid=488825)



OnPlayerTakeDamage (projectiles) - Riddick94 - 19.01.2014

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.


AW: OnPlayerTakeDamage (projectiles) - BigETI - 19.01.2014

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


Re: AW: OnPlayerTakeDamage (projectiles) - Riddick94 - 19.01.2014

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


Respuesta: Re: AW: OnPlayerTakeDamage (projectiles) - Stront - 19.01.2014

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.


Respuesta: OnPlayerTakeDamage (projectiles) - MugiwaraNoLuffy - 19.01.2014

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


Re: OnPlayerTakeDamage (projectiles) - [FAT]Klabauter[LST] - 22.01.2014

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.


Re: OnPlayerTakeDamage (projectiles) - CuervO - 22.01.2014

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.


Re: OnPlayerTakeDamage (projectiles) - [FAT]Klabauter[LST] - 23.01.2014

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