SA-MP Forums Archive
[Tutorial] Trailer System (Attach on all types of 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] Trailer System (Attach on all types of vehicles) (/showthread.php?tid=593137)



Trailer System (Attach on all types of vehicles) - Dusan01 - 02.11.2015

Making Camp Trailer System
Introduction
Today i'm gonna to release this. I think this is useful, because its good for RP servers and from this system of attach u can make really good jobs, camp trailers system...

Things that you need
- SA-MP 0.3.7 windows server - download it and extract it to your desktop
- zcmd - Download it and place it in /pawno/includes/

Let's start scripting!
Okay, so first think witch will we add will be this on top of your script:
PHP код:
new vozilo 0//to save vehicleid
new prikolca 0//to save trailer id 
Now we will make a command witch will create our vehicle (USAGE: /veh [MODEL OF VEHICLE])
PHP код:
CMD:veh(playeridparams[]) {
    new 
Float:Poz[4]; //new for player pos
    
GetPlayerPos(playeridPoz[0], Poz[1], Poz[2]); //getting player pos
    
GetPlayerFacingAngle(playeridPoz[3]); //getting player angle
    
new vozz CreateVehicle(strval(params), Poz[0]+4Poz[1], Poz[2], Poz[3], 00, -1); //creating vehicle
     
PutPlayerInVehicle(playeridvozz0); //Puting player in vehicle as dirver
    
return 1;

Now we will make command to spawn a trailer (USAGE: /trailer):
PHP код:
CMD:trailer(playeridparams[]) {
    new 
Float:Poz[4]; //new for player pos
    
GetPlayerPos(playeridPoz[0], Poz[1], Poz[2]); //getting player pos
    
GetPlayerFacingAngle(playeridPoz[3]); //getting player angle
    
prikolca CreateVehicle(607Poz[0]+4Poz[1], Poz[2], Poz[3], 00, -1); //creating trailer id 607
    
return 1;

And now what will we add is attach command to attach trailer to vehicle (USAGE: /attach):
PHP код:
CMD:attach(playeridparams[]) {
    new 
objekt=CreateObject(3171,  0,0,0,0,0,0);  //creating object for example will be camp trailer
    
AttachObjectToVehicle(objektprikolca0.084999, -2.125115, -1.144999, -3.0149990.000000178.890090); //attaching object to trailer
        
AttachTrailerToVehicle(prikolcavozilo); //attaching trailer to vehicle
    
return 1;

PICTURES




!!! THANKS FOR WATCHING MY TUTORIAL !!!



Re: Trailer System (Attach on all types of vehicles) - Karan007 - 02.11.2015

Nice one.


Re: Trailer System (Attach on all types of vehicles) - Dusan01 - 02.11.2015

Quote:
Originally Posted by Karan007
Посмотреть сообщение
Nice one.
Ty


Re: Trailer System (Attach on all types of vehicles) - thimo - 05.11.2015

Heh, looks funny


Re: Trailer System (Attach on all types of vehicles) - N0FeaR - 06.11.2015

Didn't work for me.


Re: Trailer System (Attach on all types of vehicles) - DemME - 06.11.2015

It'd be nice if people could live on them, or having their houses on those trailers. just keep in mind.


Re: Trailer System (Attach on all types of vehicles) - iKarim - 06.11.2015

Simple, But gg anyways.


Re: Trailer System (Attach on all types of vehicles) - LazyB0y - 06.11.2015

Good job!!


Re: Trailer System (Attach on all types of vehicles) - [XST]O_x - 07.11.2015

Very creative, nice job.


Re: Trailer System (Attach on all types of vehicles) - Dusan01 - 08.11.2015

Heheh thanks guys!!

@N0FeaR How is not working, can u describe it?