Trailer Attach to Truck
#1

Okay, so I make command
PHP код:
CMD:work(playerid,params[])
{
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"Trebuie sa te loghezi mai intai.");
    new 
idcar GetPlayerVehicleID(playerid);
    if(
PlayerInfo[playerid][pJob] != 14) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not a Trucker.");
    if(!
IsATruck(idcar) && GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid,COLOR_WHITE,"{FFF8C6}This vehicle does not truck or you are not driver.");
    if(!
IsPlayerInRangeOfPoint(playerid50.0, -63.6036,-1128.5824,1.0781)) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not the place where you can get products.");
    
//new Trucker = CreateVehicle(515,-77.2527,-1128.5070,2.0876,68.5459,3,77,9000); //  Trucker
    
new TrailerID CreateVehicle(450,-68.6366,-1132.4463,2.0863,63.8751,3,77,9000); // Trucker si remorca
    //PutPlayerInVehicle(playerid,Trucker,0);
    //ShowPlayerDialog(playerid, DIALOG_TRANSPORT, DIALOG_STYLE_LIST, "Product:", "Legal Products\nIllegal Products", "Select", "Close");
    //AttachTrailerToVehicle(TrailerID,GetPlayerVehicleID(playerid));
    
new Float:pX,Float:pY,Float:pZ;
    
GetPlayerPos(playerid,pX,pY,pZ);
    new 
Float:vX,Float:vY,Float:vZ;
    
GetVehiclePos(idcar,vX,vY,vZ);
    
AttachTrailerToVehicle(TrailerID,idcar);
    
    return 
1;

I did this command when writing / work wherever you are attach the trailer to truck

BUT! Not work, i don't know why

He give me the trailer to this Coordonates
PHP код:
new TrailerID CreateVehicle(450,-68.6366,-1132.4463,2.0863,63.8751,3,77,9000); // Trucker si remorca 
where is trailer create!
Help me Guys!
Reply
#2

The trailer is created at X = -68.6366, Y = -1132.4463 and Z = 2.0863 as the code clearly states.
Reply
#3

this i know...,how to create trailer but in same time to attach to vehcile wherever vehicle are ?
Reply
#4

PHP код:
new TrailerID CreateVehicle(450,-68.6366,-1132.4463,2.0863,63.8751,3,77,9000); // Trucker si remorca  
new vehicleid GetPlayerVehicleID(playerid); // Asta este tirul tau. 
AttachTrailerToVehicle(TrailerIDvehicleid); // Iar cu asta vei putea atasa remorca la tir. 
I gave you some explanations in romanian, this should be all you need to attach the trailer to the vehicle.
Reply
#5

dude, i know,BUT i want to create and attach trailer wherever are VEHICLE!
If vehicle as this coord : 0,0,0 then attach and create the trailer at this coord.
Reply
#6

RO : Macar de ai fi cautat pe Wiki ,nu e greu, dar nah, lenea e mare. Uite cum se face:
EN : If only you'd have searched the wiki, its not hard, but meh, lazy people! Here is how to do that :
PHP код:
new vehicleid GetPlayerVehicleID(playerid); // Asta este tirul tau.  
new Float:vehxFloat:vehyFloat:vehz// cream variable sa stocam pozitia tirului tau   
new Float:z_rot// Rotatia masinii
GetVehiclePos(vehicleidvehxvehyvehz); // Salvam pozitia tirului tau.
GetVehicleZAngle(vehicleidz_rot);
new 
TrailerID CreateVehicle(450vehx+2vehy+2vehz+2z_rot,3,77,9000); // Cream remorca la coordonatele tale curente.
AttachTrailerToVehicle(TrailerIDvehicleid); // Iar cu asta vei putea atasa remorca la tir. 
This should work, I didn't test it.
Reply
#7

please give me the link of wikipedia page
Reply
#8

Main Page of SAMP Wiki : http://wiki.sa-mp.com

GetVehiclePos = https://sampwiki.blast.hk/wiki/Function:GetVehiclePos

GetVehicleZAngle = https://sampwiki.blast.hk/wiki/GetVehicleZAngle

CreateVehicle = https://sampwiki.blast.hk/wiki/CreateVehicle

AttachTrailerToVehicle = https://sampwiki.blast.hk/wiki/AttachTrailerToVehicle
Reply
#9

Anybody?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)