Jump to content

Transport-SYSTEM


Crespo_

Recommended Posts

!Hello Community!, Im developing a transport system for my server

This consists of a system of busstops, in which you can go to destinations within the city, currently when the player makes the trip the following animation is generated: a bus appears in the initial terminal, then a "fadecamera", and another bus in the final terminal.
I have 2 problems with this animation.
1_ I don't know how to make the vehicle only see the local player, I tried to use the setElementAlpha () function, but the arguments are defined for all players.
2_ I would like to give it a further plus of realism in which the player gets off the bus (I don't know which function to use to show this) or that the bus makes a movement, in this last fact I am even more disoriented.
I attach images.

if someone can guide me, I will be very grateful!

spacer.pngspacer.png

Link to comment

If you want the bus to not interfere with other players at all and not be seen by them, your best bet is to just spawn the bus client-side, and a ped-clone of the player. Have this ped play the animation of entering the bus, preferably have the ped attached to the bus at the right offset to ensure that the animation will play in the right place all the time. Then, at the right time, have the ped warpPedIntoVehicle, or just destroy/place them away from the screen. The client-side bus can have another ped to be it's driver, and you can use setPedControlState to have the bus accelerate as the camera fades out. When it comes to the bus approaching, having the bus stop at the correct place can be more difficult, so you may need to utilise some interpolations between keyframes -- onClientRender, interpolateBetween, setElementPosition and setElementRotation.

Link to comment
30 minutes ago, Addlibs said:

Si quieres que el autobús no interfiera en absoluto con otros jugadores y no sea visto por ellos, lo mejor que puedes hacer es generar el lado del cliente del autobús y un clon del jugador. Haga que este ped reproduzca la animación de entrar al autobús, preferiblemente tenga el ped adjunto al autobús en el desplazamiento correcto para asegurarse de que la animación se reproduzca en el lugar correcto todo el tiempo. Luego, en el momento adecuado, haga que los ped warpPedIntoVehicle , o simplemente destrúyalos / colóquelos lejos de la pantalla. El bus del lado del cliente puede tener otro ped como conductor, y puede usar setPedControlState para que el bus acelere a medida que la cámara se desvanece. Cuando se trata de la aproximación del autobús, tener la parada del autobús en el lugar correcto puede ser más difícil, por lo que es posible que deba utilizar algunas interpolaciones entre fotogramas clave.onClientRender , interpolateBetween , setElementPosition y setElementRotation .

A few hours ago I managed to generate the vehicle on the client side (sorry for not updating the post), when the player accepts the destination a bus is generated, which accelerates to a stop, now, I have the problem of how to generate the cloning of the player ( I guess it could be via createPed and setCameratarget), do I divert the player to another dimension to avoid some kind of conflict?

 

 

as far as, as far as the bus accelerates, I determined it through the distance vector being completely perpendicular to the maker of the busstop

Edited by Crespo_
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...