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.