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(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 !!!
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?