Search

open.mp forum

RegisterLogin

Discussion

General
Chat
Tech
Life
Art
Programming
open.mp
Development Updates
Questions and Suggestions
SA-MP
General Discussions
Videos and Screenshots
Support
Pawn Scripting
Tutorials
Releases
Plugins
Libraries
Filterscripts
Gamemodes
Maps
Advertisements
Other languages
Spanish/Espa?ol
Programaci?n
Discusi?n GTA SA Multijugador
Mods
Offtopic
Juegos
Portuguese/Portugu?s
Russian/???????
Italian/Italiano
Dutch/Nederlands
German/Deutsch
Romanian/Rom?na
Ex-Yu
Polish/Polski
Og?lne
Serwery
Skryptowanie
Filmiki i zdjecia
Lithuanian/Lietuvi?kas
French/Fran?ais
Hungarian/Magyar
Hindi/Urdu
Turkish
Other
Internal
Team
Hidden
Archived

Library

 Collections Links Members Roles

How can I position the camera in front of the vehicle?

I'm trying to make a system where I need to position the camera in front of the vehicle so that it "points" to the vehicle...

ID
d6ouivnilegovhg7btug
author
next's avatar

Next

@next


View profile
Copy link
  Report member
started
Jul 18, 2021
replies
0
participating
No

scroll to top

powered by storyden

Login
Discussion
Pawn Scripting
How can I position the camera in front of the vehicle?
next's avatar

Next

@next


View profile
Copy link
  Report member
• 4y
Pawn Scripting

How can I position the camera in front of the vehicle?

pawn

I'm trying to make a system where I need to position the camera in front of the vehicle so that it "points" to the vehicle without setting the coordinates in an array, having a "radius" using a GetVehicleModelInfo function.







I managed to do a function where I can get the front of the vehicle using some calculations. But I can't point the camera at the vehicle at the right angle.







GetVehicleFront(vehicleid, &Float:x, &Float:y)

{

? ? new Float:a, Float:fSize;

? ? GetVehiclePos(vehicleid, x, y, a);

? ? GetVehicleZAngle(vehicleid, a);

? ? GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, fSize, fSize, fSize);



? ? x = (/* radius using fSize? (about 7.5) */ * floatsin(-a, degrees));

? ? y = (/* radius using fSize? (about 7.5) */ * floatcos(-a, degrees));

? ? return 1;

}









btw, is this function correct??

0 likes0 replies

    Please sign up or log in to reply