Jump to content

Light collision and recoil with World Models such as lantern


krischkros

Recommended Posts

Does anyone know how the collision or in GTA unfortunately the "recoil" diminish?

My current problem:

.. if I remove the model from onClientVehicleCollision, I'm trz. once it collides and could therefore not achieve the desired effect.

LUA approach:

function CVehicle:onClientVehicleCollision(hitElement, force, bodyPart, x, y, z, nx, ny, nz, hitElementForce, model) 
    if localPlayer:IsInVehicle() then 
        local vehicle = localPlayer:getVehicle() 
        local vx, vy, vz = vehicle:getPosition() 
        removeWorldModel(model, 15, vx, vy, vz) 
    end 
end 

As I said, I have to be here at least once colliding with it to retrieve this data.

I want when it comes, do not have a permanent checking whether a lamp or fence near me is .. only in the event that someone is so smart and wants to post this :D

Ideas of others:

1 use "onClientObjectDamage", and let the triggering of events removed the affected object. Is cancelbar and triggers from damage

2 use "onClientVehicleCollision". When it is triggered tap the Velocity. Then on the server side use "onVehicleDamage" and reflect the vehicle velocity.

3 use "onClientVehicleCollision". When triggered with "setVehicleHandling" the mass and increase, then the server side use "onVehicleDamage" to re-establish the origin of "getOriginalHandling" it.

1 in a onClientRender event the velocity of the car in time to save three variables (vx, vy, vz)

2 In a onClientVehicleCollision the car event query, and a second variable to true filters (query for Dynamic Objects: if (break (object)) ...)

3 After the event onClientRender query the variable, and give the car the velocity that was previously stored

However, do not go, because onClientVehicleCollision does not swing at breakable or broken world models.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...