matucha123 Posted February 16, 2012 Share Posted February 16, 2012 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
Kenix Posted February 16, 2012 Share Posted February 16, 2012 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
matucha123 Posted February 16, 2012 Author Share Posted February 16, 2012 I need that only player can see vehicle I needed cursors function thanks! Link to comment
Kenix Posted February 16, 2012 Share Posted February 16, 2012 I need that only player can see vehicle Yes i know you need only for local player ( rotate vehicle ) but if you select vehicle you need destroy this vehicle ( rotate vehicle ) and create new in server side for sync all. This just idea for your script. I needed cursors function https://wiki.multitheftauto.com/wiki/Cli ... _functions thanks! No problem! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now