Help trucker
#1

How to change this
PHP код:
 new TrailerID CreateVehicle(450vehxvehyvehzz_rot,3,77,9000); // 
because I put the trailer over truck
Reply
#2

If you want to attach it use

https://sampwiki.blast.hk/wiki/AttachTrailerToVehicle
Reply
#3

it's attached
Reply
#4

Then what do you want? can you briefly explain.
Reply
#5

command:
PHP код:

CMD
:work(playerid,params[])
{
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"Trebuie sa te loghezi mai intai.");
    new 
idcar GetPlayerVehicleID(playerid); // Asta este tirul tau.  
    
if(PlayerInfo[playerid][pJob] != 14) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not a Trucker.");
    if(!
IsPlayerInRangeOfPoint(playerid10.0, -146.3690,-1116.3546,4.2725)) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not the place where you can get products.");
    if(!
IsATruck(idcar) && GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid,COLOR_WHITE,"{FFF8C6}This vehicle does not truck or you are not driver.");
    
//new Trucker = CreateVehicle(515,-142.5756,-1116.7383,5.3989,257.1702,3,77,-1); // Trucker si remorca
    //new TrailerID = CreateVehicle(450,-152.0133,-1114.9786,5.9868,258.3351,3,77,-1); // Trucker si remorca
    //AttachTrailerToVehicle(TrailerID,GetPlayerVehicleID(playerid));
    //PutPlayerInVehicle(playerid,Trucker,0);
    
    
new Float:vehxFloat:vehyFloat:vehz// cream variable sa stocam pozitia tirului tau   
    
new Float:z_rot// Rotatia masinii

    
GetVehiclePos(idcarvehxvehyvehz); // Salvam pozitia tirului tau.
    
GetVehicleZAngle(idcarz_rot);
    new 
TrailerID CreateVehicle(450vehxvehyvehzz_rot,3,77,9000); // Cream remorca la coordonatele tale curente.

    
AttachTrailerToVehicle(TrailerID,idcar); // Iar cu asta vei putea atasa remorca la tir.  
    
SetPlayerCheckpoint(playerid,-96.4776,-1159.1644,2.0905,4.0);
    
IsTruckerStart[playerid] = 1;
    return 
1;

But when spawned Trailer spawn over truck
Reply
#6

pawn Код:
CMD:work(playerid,params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi mai intai.");
    if(PlayerInfo[playerid][pJob] != 14) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not a Trucker.");
    if(!IsPlayerInRangeOfPoint(playerid, 10.0, -146.3690,-1116.3546,4.2725)) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not the place where you can get products.");
    if(!IsATruck(GetPlayerVehicleID(playerid)) && GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid,COLOR_WHITE,"{FFF8C6}This vehicle does not truck or you are not driver.");
    //new Trucker = CreateVehicle(515,-142.5756,-1116.7383,5.3989,257.1702,3,77,-1); // Trucker si remorca
    //new TrailerID = CreateVehicle(450,-152.0133,-1114.9786,5.9868,258.3351,3,77,-1); // Trucker si remorca
    //AttachTrailerToVehicle(TrailerID,GetPlayerVehicleID(playerid));
    //PutPlayerInVehicle(playerid,Trucker,0);
   
    new Float:vehx, Float:vehy, Float:vehz; // cream variable sa stocam pozitia tirului tau  
    new Float:z_rot; // Rotatia masinii

    GetVehiclePos(GetPlayerVehicleID(playerid), vehx, vehy, vehz); // Salvam pozitia tirului tau.
    GetVehicleZAngle(idcar, z_rot);
    new TrailerID = CreateVehicle(450, vehx, vehy, vehz, z_rot,3,77,9000); // Cream remorca la coordonatele tale curente.

    AttachTrailerToVehicle(TrailerID,GetPlayerVehicleID(playerid)); // Iar cu asta vei putea atasa remorca la tir.  
    SetPlayerCheckpoint(playerid,-96.4776,-1159.1644,2.0905,4.0);
    IsTruckerStart[playerid] = 1;
    return 1;
}
I don't see a reason for you to create a new variable getting a vehicles ID, try the code I gave you.
Reply
#7

PHP код:
error 017undefined symbol "idcar" 
Reply
#8

pawn Код:
GetVehicleZAngle(GetPlayerVehicle(playerid), z_rot);
Reply
#9

PHP код:
error 017undefined symbol "GetPlayerVehicle" 
I put GetPlayerVehicleID but still don't work give me trailer in left
Reply
#10

first PutPlayerInVehicle(playerid,Trucker,0);
then AttachTrailerToVehicle(TrailerID,GetPlayerVehicleI D(playerid));
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)