SA-MP Forums Archive
g bug - 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: g bug (/showthread.php?tid=460412)



g bug - ajwar - 28.08.2013

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


Re: g bug - Cypress - 28.08.2013

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.


Re: g bug - ajwar - 28.08.2013

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


Re: g bug - Cypress - 28.08.2013

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.


Re: g bug - ajwar - 28.08.2013

you also need to press h while sitting as a passenger


Re: g bug - Cypress - 28.08.2013

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.


Re: g bug - Richie© - 28.08.2013

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