SA-MP Forums Archive
Shooting X Crash . Difference - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Shooting X Crash . Difference (/showthread.php?tid=99622)



Shooting X Crash . Difference - texugo - 29.09.2009

Hi. I have a problem. Some cars have 'Airbag' when the player hits something, the player does not lose life if you have this equipment. And now I think of doing shielding shots for cars. I have not found a way to differentiate because the weapons fire has different value depending of the distance. I need find a way to life the player loses if the car being crashs even shielded.

Thanks




Re: Shooting X Crash . Difference - texugo - 29.09.2009

Please i need assistance


Re: Shooting X Crash . Difference - TMasters - 29.09.2009

not possible to make, YET, cause it all uses colision, and we dont have callback OnVehicleDamage(vehicleid,colision_type)


Re: Shooting X Crash . Difference - dice7 - 29.09.2009

Get this
http://forum.sa-mp.com/index.php?topic=82583.0
and edit the OnPlayerHealthChange to work with vehicles
pawn Код:
OnVehicleHealthChange(veh, newhealth, oldhealth)
{
  loop thorugh players
  {
    if(isplayerinspecificcar)
    {
      SetPlayerHealth(playerid, 100);
    }
  }
}



Re: Shooting X Crash . Difference - texugo - 02.10.2009

Quote:
Originally Posted by dice7
Get this
http://forum.sa-mp.com/index.php?topic=82583.0
and edit the OnPlayerHealthChange to work with vehicles
pawn Код:
OnVehicleHealthChange(veh, newhealth, oldhealth)
{
  loop thorugh players
  {
    if(isplayerinspecificcar)
    {
     SetPlayerHealth(playerid, 100);
   }
  }
}
The specification is not valid because the value changes with the distance and gun. Believe it would be like Tmastersa said, a OnVehicleDamage differentiating. Someone might have more suggestions?


Re: Shooting X Crash . Difference - Hiitch - 02.10.2009

the bottom line is this

You can't really make anything bullet proof, the reason being is because the sync between the player, the vehicle, the other player, and the server differentiate between the distance to the player, the ping, and the server's connection.

If this was able to be made, there would be alot of lag within your gamemode / filterscript or maybe even your server.

But then again, they way dice7 said it, there would be a problem, theres no way to detect if someone is on the car and pressing the fire key to damage it, other than seeing if the person shot it.

- Just a few thoughts.