I waited so long for a good camera control in SAMP to get this to work and now finally it's here.
, so some credits go to him. The function itself does what it has to do, so I didn't have to make one of my own.
What I did is center the camera in most of the cars, but not all of them. I'm not planning to expand it right now, but you will see that is very easy to customize.
- Checkpoints can't be seen through the windshield or side windows (this is a GTA thing, nothing to do with the script itself).
pawn Код:
enum CameraObjects
{
camobj
};
new Player[MAX_PLAYERS][CameraObjects];
enum DashBoardEnum
{
modelid,
Float:cam_x,
Float:cam_y,
Float:cam_z
};
new DashBoards[][DashBoardEnum] =
{
{ 410, -0.30, -0.25, 0.55 }, // Manana
{ 404, -0.35, -0.15, 0.68 }, // Perreniel
{ 575, -0.35, -0.15, 0.68 }, // Broadway
{ 466, -0.38, -0.15, 0.60 }, // Glendale
{ 401, -0.40, -0.15, 0.52 }, // Bravura
{ 419, -0.40, -0.25, 0.40 }, // Esperanto
{ 474, -0.47, -0.30, 0.52 }, // Hermes
{ 518, -0.53, -0.22, 0.43 }, // Buccaneer
{ 516, -0.47, -0.15, 0.55 }, // Nebula
{ 491, -0.40, -0.25, 0.44 }, // Virgo
{ 479, -0.35, -0.30, 0.65 }, // Regina
{ 566, -0.45, -0.25, 0.55 }, // Tahoma
{ 535, -0.35, -0.15, 0.62 }, // Slamvan
{ 467, -0.45, -0.25, 0.54 }, // Oceanic
{ 492, -0.45, -0.25, 0.54 }, // Greenwood
{ 426, -0.45, -0.25, 0.54 }, // Premier
{ 505, -0.45, -0.35, 0.68 }, // Rancher
{ 546, -0.45, -0.33, 0.56 }, // Intruder
{ 533, -0.45, -0.33, 0.56 }, // Feltzer
{ 496, -0.45, -0.37, 0.51 }, // Blista
{ 542, -0.45, -0.37, 0.51 }, // Clover
{ 589, -0.45, -0.31, 0.73 }, // Club
{ 565, -0.45, -0.25, 0.42 }, // Flash
{ 587, -0.45, -0.38, 0.44 }, // Euros
{ 412, -0.45, -0.27, 0.44 }, // Voodoo
{ 439, -0.45, -0.47, 0.45 }, // Stallion
{ 534, -0.50, -0.2, 0.42 }, // Remington
{ 602, -0.45, -0.25, 0.40 }, // Alpha
{ 536, -0.45, -0.25, 0.42 }, // Blade
{ 475, -0.45, -0.25, 0.44 }, // Sabre
{ 436, -0.34, -0.35, 0.52 }, // Previon
{ 585, -0.45, -0.26, 0.66 }, // Emperor
{ 600, -0.45, -0.18, 0.51 }, // Picador
{ 421, -0.38, -0.07, 0.45 }, // Washington
{ 580, -0.45, -0.26, 0.69 }, // Stafford
{ 458, -0.45, -0.12, 0.43 }, // Solair
{ 561, -0.37, -0.08, 0.52 }, // Stratum
{ 517, -0.45, -0.26, 0.54 }, // Majestic
{ 526, -0.40, -0.25, 0.37 }, // Fortune
{ 576, -0.35, -0.30, 0.58 }, // Tornado
{ 579, -0.45, -0.33, 0.85 }, // Huntley
{ 558, -0.37, -0.34, 0.59 }, // Uranus
{ 603, -0.47, -0.44, 0.35 }, // Phoenix
{ 560, -0.37, -0.20, 0.58 }, // Sultan
{ 559, -0.40, -0.40, 0.50 }, // Jester
{ 506, -0.39, -0.43, 0.37 }, // Super GT
{ 562, -0.36, -0.34, 0.53 }, // Elegy
{ 477, -0.40, -0.35, 0.47 }, // ZR-350
{ 402, -0.44, -0.49, 0.50 }, // Buffalo
{ 415, -0.36, -0.32, 0.32 }, // Cheetah
{ 451, -0.36, -0.32, 0.32 }, // Turismo
{ 541, -0.36, -0.20, 0.40 }, // Bullet
{ 429, -0.40, -0.65, 0.45 }, // Banshee
{ 411, -0.39, -0.21, 0.40 } // Infernus
};
Then just add this to your OnPlayerStateChange or copy the whole function as you need:
Edit: I forgot to paste some code. Added now!
i like the idea of when every player enters a vehicle it auto puts them inside to make it look more like real life
Thanks for shearing .. I will add your credits
The code looks fine. Post few videos.
The code is pasted in the first post. You have to add it to your gamemode/filterscript.
I didn't make a file because maybe you want to just display the camera with a command, etc...
I'll try. I had a video but didn't have time to upload it that day, so I deleted it.
I'll record another one.
There are another FS that uses 1st person view inside cars, but they just center the camera in the player's head. Didn't try them, but seeing some videos I prefer this one that centers the camera for each vehicle on the list (I tried to make so if you look around you won't see parts of the car turning invisible, although I couldn't accomplish that will all the cars)