BULLET_HIT_TYPE_NPC? - 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: BULLET_HIT_TYPE_NPC? (
/showthread.php?tid=489087)
BULLET_HIT_TYPE_NPC? -
Elorreli - 20.01.2014
Would be awesome if you could detect shots fired at NPCs or is it included in
#define BULLET_HIT_TYPE_PLAYER
?
Re: BULLET_HIT_TYPE_NPC? -
Mauzen - 20.01.2014
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) {
if (hittype == BULLET_HIT_TYPE_PLAYER && IsPlayerNPC(hitid)) {
// BULLET_HIT_TYPE_NPC
}
}
I really doubt that we need an extra hittype for that

A native type wouldnt make it faster than checking for PLAYER || NPC would slow it down.
Re : Re: BULLET_HIT_TYPE_NPC? -
Elorreli - 20.01.2014
Quote:
Originally Posted by Mauzen
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { if (hittype == BULLET_HIT_TYPE_PLAYER && IsPlayerNPC(hitid)) { // BULLET_HIT_TYPE_NPC } }
I really doubt that we need an extra hittype for that 
|
Yeah well you never know, seeing NPCs werent affected by OnPlayerTake/GiveDamage
Re: BULLET_HIT_TYPE_NPC? -
iJumbo - 20.01.2014
You can detect if you are shooting on npc skin but not have control on it