[Tutorial] How to use map 'Objects' as 'Vehicles'.
#1

Hello Everyone! Once again. I'd like to share something with you guys.
I didn't really know where to post this but it probably is the right place.


This is a very-short tutorial on making your own vehicles using the objects.

1) Create a Vehicle somewhere (In this case we are creating it near the player).
pawn Код:
new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
new myvehicle = CreateVehicle(594, Pos[0], Pos[1], Pos[2], 0, -1, -1, 0); //Note: 594 is an RC CAM.
2) Create an Object that you want to use as a replacement for the vehicle.
pawn Код:
new myobject = CreateObject(1598, 0, 0, -500, 0, 0, 0, 100); //1598 is a beachball I think.
3) Attach it to the vehicle.
pawn Код:
AttachObjectToVehicle(myobject, myvehicle, 0, 0, 0, 0, 0, 0);
4) Change the Vehicle Interior ID to a player's interior +1 so it is always different.
pawn Код:
LinkVehicleToInterior(myvehicle, GetPlayerInterior(playerid) + 1);
5) Put player in the Vehicle.
pawn Код:
PutPlayerInVehicle(playerid, myvehicle, 0);
Done.

What have you achieved?
- This will make the vehicle invisible to everyone (except any person with interior as 10).
- You will be able to roam around with the vehicle but everyone will see it as the attached object.
Basically, you replaced the vehicle model.

Example/Screenshot:
-Me flying a BIG CESAR! (Note that the object used here is different)

[ame]http://www.youtube.com/watch?v=UnWyANQZDCw[/ame]
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)