Jump to content

Mouse rotation.


matucha123

Recommended Posts

I have shop. Then players enters it (pick pickup), I set camera to look at car (which is selected in GUI). How can I do rotation with mouse (You holding mouse button pressed on screen and drag it right or left and car rotates, its hard to explain...) And it should be client side because car is created in client side.

Link to comment

So you need check key( 'mouse1' if player clamped this key ) in event onClientRender .Then you need know cursor position.

If cursor show then you need check x-axis ( in function https://wiki.multitheftauto.com/wiki/GetCursorPosition ).You need create this: if x > 500 then rotate car z-axis +1 if x < 500 then rotate car z-axis - 1.

You also need the border where you can use the mouse to rotate the vehicle.( just check cursor position )

P.S If you created vehicle ( done you selected ) you should destroy this car and create vehicle in server ( because it need for sync ).

If you create vehicle in client side only you can see.

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...