#1

Hi, is there any possible fix for demaging a player while he is sitting as passenger? No demage is done to passengers...
Reply
#2

Don't exactly know what you mean but yes, you can check if player is a passenger and if he gets any damage, give him the lost health back.

I would do it like this:

pawn Код:
new bool:passenger[MAX_PLAYERS];

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if (ispassenger) passenger = true;
     return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
     if (passenger) passenger = false;
     return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
      if (passenger) SetPlayerHealth(playerid, GetPlayerHeath(playerid) + amount);
      return 1;
}
Not sure if gonna work.
Reply
#3

test to damage a player while he is sitting on nrg as a passenger, it's impossible to kill him.
Reply
#4

Quote:
Originally Posted by ajwar
Посмотреть сообщение
test to damage a player while he is sitting on nrg as a passenger, it's impossible to kill him.
Test the code I made above.

EDIT: Do you want to make it so you can kill the passenger on NRG? Don't get it.

I believe it is still possible to kill the player on NRG. Guess take damage must be called, not sure, gonna test it.
Reply
#5

you also need to press h while sitting as a passenger
Reply
#6

Quote:
Originally Posted by ajwar
Посмотреть сообщение
you also need to press h while sitting as a passenger
There isn't any fix for this. I'm afraid. However I have an idea, give me some minutes.

EDIT:

You can disable player weapons when he is as passenger on NRG.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if(vehicleid == 522 && ispassenger) SetPlayerArmedWeapon(playerid, 0);
     return 1;
}
Also you can check if there isn't a driver on NRG then remove weapons. If there is a driver and he gets damage, give the same or minus something damage to the passenger, it's up to you.
Reply
#7

I know this bug. Annoying as shit. You shooting at 2 players on nrg while passenger is in shooting mode, only driver takes damage.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)