IsPlayerAimingAtVehicle function?
#1

I'm currently creating an advanced empty vehicle damage system and i'm almost finished but i'd need a IsPlayerAimingAtVehicle function. To make it more accurate, it should use GetVehicleModelInfo. Could someone create this for me?
Reply
#2

Bump.
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=140765

Use IsPlayerAimingAt and get the coordinates of the vehicle.
Reply
#4

It checks if player is aiming inside a sphere but vehicles (usually ) aren't sphere-shaped and are all different-sized.



This drawing shows, which area should be aimed to get the positive result. My drawing skills are really bad, just like my english.
Reply
#5

Bump.
Reply
#6

Bumping wont help you anyways.

Here:- https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate
Reply
#7

That is going to be difficult to do because you would need to compensate for the position of the collision box in relation of the angle of the vehicle. Just use a sphere
Reply
#8

Quote:
Originally Posted by HyDrAtIc
Посмотреть сообщение
It wouldn't get called because an empty vehicle's damage status doesn't update when it's getting shot at.

I'll test the sphere again.
Reply
#9

It isn't possible to make it accurate enough.
Reply
#10

You may try to do it like this:
(Warning: This is just my mumbling about stuff)

You know size of vehicle box(xyz), position of car is center of box (o).
You know angle of car box in degrees.
You know distance(d) between player and center of car box.
You know angle of player camera so you can calculate exact point(xyz) where player aiming,to be accurate you may use Map Andreas Plugin for z of ground at xy of POV .

Now you have point in 3D space(xyz).This place where you bullet(hit) while pass.
BOX OF CAR: Have center point at car coordinate and half + and - size of Vehicle_Model_Info for each X,Y,Z plane in appropriate angle of car.
Now you must test is this point belong to any of BOX OF CAR(plane).
And if you have a hit else you not.

This is actuate.
http://tutorial.math.lamar.edu/Class.../3DCoords.aspx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)