[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(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 !!!
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: 2 Guest(s)