Detect SeaSparrow damage amount.
#1

Hello! I tried OnPlayerGiveDamage but it doesn't work when i fire with seasparrow. Is there a way to detect the amount of damage given by SeaSparrow?
Reply
#2

i think you have to make it on OnPlayerTakeDamage

IM NOT SURE IF WORK

Quote:

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 31 && IsPlayerInVehicle(issuerid, 447))
{
new Float:hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp + amount);
}
return 1;
}
Reply
#3

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) {
      if(weaponid == 38 && IsPlayerInAnyVehicle(issuerid) && GetVehicleModel(GetPlayerVehicleID(issuerid)) == VEHICLE_SEASPARROW) {
          // player has taken damage from seasparrow
      }

      return 1;
}
I believe this should work, it's based off Slice's damage include.
Reply
#4

Quote:
Originally Posted by Abagail
Посмотреть сообщение
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) {
      if(weaponid == 38 && IsPlayerInAnyVehicle(issuerid) && GetVehicleModel(GetPlayerVehicleID(issuerid)) == VEHICLE_SEASPARROW) {
          // player has taken damage from seasparrow
      }

      return 1;
}
I believe this should work, it's based off Slice's damage include.
I tried it, doesn't work.
weaponid 38 = Minigun...

Quote:
Originally Posted by kyriakos587
Посмотреть сообщение
i think you have to make it on OnPlayerTakeDamage

IM NOT SURE IF WORK
First of all, you are using this wrong: https://sampwiki.blast.hk/wiki/IsPlayerInAnyVehicle
And...weapn id 31 is M4. This doesn't help me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)