[Tutorial] Trailer System (Attach on all types of vehicles)
#1

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(playerid, params[]) {
    new 
Float:Poz[4]; //new for player pos
    
GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]); //getting player pos
    
GetPlayerFacingAngle(playerid, Poz[3]); //getting player angle
    
new vozz = CreateVehicle(strval(params), Poz[0]+4, Poz[1], Poz[2], Poz[3], 0, 0, -1); //creating vehicle
     
PutPlayerInVehicle(playerid, vozz, 0); //Puting player in vehicle as dirver
    
return 1;
} 
Now we will make command to spawn a trailer (USAGE: /trailer):
PHP код:
CMD:trailer(playerid, params[]) {
    new 
Float:Poz[4]; //new for player pos
    
GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]); //getting player pos
    
GetPlayerFacingAngle(playerid, Poz[3]); //getting player angle
    
prikolca = CreateVehicle(607, Poz[0]+4, Poz[1], Poz[2], Poz[3], 0, 0, -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(playerid, params[]) {
    new 
objekt=CreateObject(3171,  0,0,0,0,0,0);  //creating object for example will be camp trailer
    
AttachObjectToVehicle(objekt, prikolca, 0.084999, -2.125115, -1.144999, -3.014999, 0.000000, 178.890090); //attaching object to trailer
        
AttachTrailerToVehicle(prikolca, vozilo); //attaching trailer to vehicle
    
return 1;
} 
PICTURES




!!! THANKS FOR WATCHING MY TUTORIAL !!!
Reply
#2

Nice one.
Reply
#3

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

Heh, looks funny
Reply
#5

Didn't work for me.
Reply
#6

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

Simple, But gg anyways.
Reply
#8

Good job!!
Reply
#9

Very creative, nice job.
Reply
#10

Heheh thanks guys!!

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


Forum Jump:


Users browsing this thread: 1 Guest(s)