camera view on car
#1

I need to stick cameras to my car. I tried attaching the camera to an already attached object, but I failed miserably. Can you give me the code for that? For example I need the camera on the side of the car looking at the front wheel. Just like one of the camhack views.

Can someone give me the template, so I can figure out how to do them myself?
Reply
#2

Search it on the forums.

Or goto ******, paste: site:forum.sa-mp.com your search
Reply
#3

don't you think I've already tried it?
Reply
#4

pawn Код:
new p = GetPlayerVehicleID(playerid);
new object[playerid] = CreatePlayerObject(playerid,19300, 0., 0,0, 0.0000, -1, -1, 100);
AttachPlayerObjectToVehicle(playerid,object[playerid],p,0.0, 0.0, 5.510000, 0.000000, 0.000000, 0.000000);
AttachCameraToPlayerObject(playerid,object[playerid]);
change the coords in AttachPlayerObjectToVehicle
Reply
#5

When I reset the camera, I need to destroy the object. how should I define it again in a separate callback?
Reply
#6

REP ME PLZ

okay you need to getcarposition attach
new objectid = CreateObject(...);
new vehicleid = GetPlayerVehicleID(playerid);
AttachObjectToVehicle(objectid, vehicleid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);

go to mta and create a object onto a car get the object the xyz and the xyz rotation and past it there and createobject with no position just create the object put the cords on the attach to car........... and there u have it attackobject to veh

REP ++ plz i need
Reply
#7

Quote:
Originally Posted by HeLiOn_PrImE
Посмотреть сообщение
When I reset the camera, I need to destroy the object. how should I define it again in a separate callback?
define the object on the top of your script
new object[MAX_PLAYERS];

and to destroy it
DestroyObject(object[playerid]);
Quote:
Originally Posted by trapstar2020
Посмотреть сообщение
REP ME PLZ

okay you need to getcarposition attach
new objectid = CreateObject(...);
new vehicleid = GetPlayerVehicleID(playerid);
AttachObjectToVehicle(objectid, vehicleid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);

go to mta and create a object onto a car get the object the xyz and the xyz rotation and past it there and createobject with no position just create the object put the cords on the attach to car........... and there u have it attackobject to veh

REP ++ plz i need
Reply
#8

thank you, I'll try it tomorrow. Rep to all of you. who answered.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)