Author Topic: [Request] onWheelShot( player, oldWheelHealth, newWheelHealth, damage)  (Read 715 times)

TurboGrafx

  • Full Member
  • ***
  • Posts: 233
  • Karma: +32/-33
    • View Profile
Since reading more of the wiki, I noticed

http://liberty-unleashed.co.uk/LUWiki/Squirrel/Server/Functions/Vehicles/SetWheelStatus

because of WHEELSTATUS_FUCKED, And I laughed indeed, Also spit up some of my energy drink...

I think it would be freaking cool if its possible to add a onshoot for tires, This way the game engine would come to life more, as well this is a multiplayer.

I would love to hear a response from developers

Rhytz

  • Newbie
  • *
  • Posts: 30
  • Karma: +13/-7
    • View Profile
    • Rhytz's Website
Re: [Request] onWheelShot( player, oldWheelHealth, newWheelHealth, damage)
« Reply #1 on: November 14, 2016, 07:11:28 pm »
Well, there is an undocumented onClientVehicleShot...

I've tried using it but it appears never to get called, just like onClientVehicleDamage.

But onClientVehicleShot could include a parameter indicating which part of the car was shot
Meet everyone on the Liberty Unleashed Discord || Check out my website/portal!

TurboGrafx

  • Full Member
  • ***
  • Posts: 233
  • Karma: +32/-33
    • View Profile
Re: [Request] onWheelShot( player, oldWheelHealth, newWheelHealth, damage)
« Reply #2 on: November 14, 2016, 07:26:12 pm »
Nice find. I didn't know onClientVehicleShot existed.

I might try shooting through windshields soon.

Nice find and addition in general  :)

Theremin

  • Full Member
  • ***
  • Posts: 152
  • Karma: +48/-18
  • Worst Server Owner
    • View Profile
    • Visit my YouTube channel
Re: [Request] onWheelShot( player, oldWheelHealth, newWheelHealth, damage)
« Reply #3 on: November 16, 2016, 01:12:27 am »
Thanks a lot to s19 for retrieving functions' arguments and testing them together with me.
Couple of things worth a mention:

1. onClientVehicleDamage returns null in place of player.
2. onClientVehicleDamage has been tested with weapons, car ramming and vehicle addons (tank cannon and Predator boat gun). It seems to be called exclusively with Predator's gun. Untested: ped ramming damage.
3. onClientVehicleShot is called for every gun (from Colt 'till Motolov) with the obvious exception of fists, bat and detonator since they deliver no damage at all.
4. Molotovs and Flamethrower both return 9 with onClientVehicleShot (aka Flamethrower) and Grenades and RPG return 18(o_O?).

Code: [Select]
function onClientVehicleDamage( damagedvehicle, damager )
{
Message("[#FF00AA][DEBUG] [#FFFFFF]Player [#FFFF00]"+damager+"[#FFFFFF] damaged this vehicle [#FFFF00]"+damagedvehicle);
}

function onClientVehicleShot( vehicle, player, weapon )
{
Message("[#FF00AA][DEBUG] [#FFFFFF]Player [#FFFF00]"+player+"[#FFFFFF] damaged this vehicle [#FFFF00]"+vehicle+"[#FFFFFF] with weapon ID [#FFFF00]"+weapon);
}

TurboGrafx

  • Full Member
  • ***
  • Posts: 233
  • Karma: +32/-33
    • View Profile
Re: [Request] onWheelShot( player, oldWheelHealth, newWheelHealth, damage)
« Reply #4 on: November 16, 2016, 01:59:20 am »
NICE!!

So I am beginning to think that onClientVehicleShot

If a new parameter was added for BodyPart/VehiclePart to detect where bullets hit then we could possibly make something happen for onClientVehicleShot to blow out a players tire.

*Then maybe in the future when we can add custom weapons we could even add the police spike strip from vice city

So do you and or s19 think that adding a detection on the vehicles body parts would help?

Example:

Code: [Select]
onClientVehicleShot( vehicle, player, weapon, carpart )
even if each part returns 1 2 3 4 5 6 7 8 9 etc it is whatever it can be played with.

I think it's awesome that Molotovs ,Flamethrower, Grenades and RPGs are detected
« Last Edit: November 16, 2016, 12:44:31 pm by Mötley »

Rhytz

  • Newbie
  • *
  • Posts: 30
  • Karma: +13/-7
    • View Profile
    • Rhytz's Website
Re: [Request] onWheelShot( player, oldWheelHealth, newWheelHealth, damage)
« Reply #5 on: November 16, 2016, 09:30:17 pm »
Updated the wiki regarding onClientVehicleShot
Meet everyone on the Liberty Unleashed Discord || Check out my website/portal!

Vortrex

  • Full Member
  • ***
  • Posts: 259
  • Karma: +51/-64
    • View Profile
Re: [Request] onWheelShot( player, oldWheelHealth, newWheelHealth, damage)
« Reply #6 on: November 30, 2016, 06:37:58 am »
SA-MP has a feature for server developers that detects where bullets hit. With it, you can determine what a bullet hits (like a vehicle, player, or object), and a set of coordinates the bullet struck relative to whatever was hit. I would like to see this for LU.

A crude version could probably be implemented with some of the client side functions we have already, but a natively supported function would be awesome.

This is a long shot, but I don't have time to work on it right now, so I'll just put it as a concept. Maybe an experienced scripter will come along and see it:
Perhaps we could calculate a bullet trajectory ... Screen to world position from crosshair, check incrementing distance until line of sight is not clear. At that point we could determine the bullet stopped there, and use the vector for something.

EDIT: by incrementing distance, I meant vector lerp.
« Last Edit: November 30, 2016, 06:40:16 am by Vortrex »

 

© Liberty Unleashed Team.