SA-MP Forums Archive
[Tutorial] How to use map 'Objects' as 'Vehicles'. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to use map 'Objects' as 'Vehicles'. (/showthread.php?tid=282150)



How to use map 'Objects' as 'Vehicles'. - iPLEOMAX - 09.09.2011

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]


Re: How to use map 'Objects' as 'Vehicles'. - =WoR=G4M3Ov3r - 09.09.2011

This is nice, Thanks for this .

Keep it up, man.


Re: How to use map 'Objects' as 'Vehicles'. - System64 - 09.09.2011

ahahahhahhah so cool thanks


Re: How to use map 'Objects' as 'Vehicles'. - wups - 09.09.2011

The video made my day. Nice tutorial, simple and effective way.


Re: How to use map 'Objects' as 'Vehicles'. - Darnell - 09.09.2011

That's funny & good, good job.


AW: How to use map 'Objects' as 'Vehicles'. - Meta - 09.09.2011

Actually that's the way I made that.


Re: AW: How to use map 'Objects' as 'Vehicles'. - iPLEOMAX - 09.09.2011

Thanks Everyone! ^_^

Quote:
Originally Posted by Meta
Посмотреть сообщение
Actually that's the way I made that.
Haven't seen that before, Nice.

I found out this when I was trying to make a football minigame... (I attached a Beachball to an RC Cam and used SetVehicleVelocity to do stuff) (Same with my shark FS)


Re: How to use map 'Objects' as 'Vehicles'. - Davz*|*Criss - 09.09.2011

Well done iPleomax. Thanks for this.


Re: How to use map 'Objects' as 'Vehicles'. - emokidx - 10.09.2011

lmao,, this is funny
nice job!


Re: How to use map 'Objects' as 'Vehicles'. - Lorenc_ - 10.09.2011

Really creative, however. Using the interior linking method is really really impressive, it's also great for invisibility to derby servers :P

What would happen if the hydra is destroyed? and theres an object?