06.07.2010, 13:57
Hey everyone... I've made this command for a Delivery faction...
And it works, except that the trailer doesn't attach.... Why? thx
pawn Код:
dcmd_buycomps(playerid, params[])
{
#pragma unused params
if(PlayerInfo[playerid][pFaction] != 6) return 1;
new vehicle = GetPlayerVehicleID(playerid);
if(vehicle != SDCcar[6] && vehicle != SDCcar[7] && vehicle != SDCcar[8]
&& vehicle != SDCcar[9] && vehicle != SDCcar[10]) return SendErrorMessage(playerid, ".: Info: You must be in a SDC Truck :.");
if(!PlayerToPoint(50.0,playerid,-1018.8698,-655.1353,32.0078) && !PlayerToPoint(50.0,playerid,566.0120,899.2450,-43.0550)
&& !PlayerToPoint(50.0,playerid,-491.1401,-517.8155,28.5155)) return SendErrorMessage(playerid, ".: Info: You must be at a SDC Pickup spot! :.");
if(PlayerToPoint(50.0,playerid,-1018.8698,-655.1353,32.0078))
{
SetVehiclePos(vehicle,-1020.5069,-637.3546,33.0223);
SetVehicleZAngle(vehicle,0.0);
trailer[playerid+1] = CreateVehicle(584,9999.9,9999.9,9999.9,9.9,1,1,-1);
AttachTrailerToVehicle(trailer[playerid+1], vehicle);
SendInfoMessage(playerid, ".: Info: Trailer attached. Drive the fuel to the SDC Dropoff. :.");
VehicleInfo[vehicle][vSDCFuel] = 300;
}
else if(PlayerToPoint(50.0,playerid,-491.1401,-517.8155,28.5155))
{
SetVehiclePos(vehicle,-491.1401,-517.8155,28.5155);
SetVehicleZAngle(vehicle,88.6842);
trailer[playerid+1] = CreateVehicle(591,9999.9,9999.9,9999.9,9.9,1,1,-1);
AttachTrailerToVehicle(trailer[playerid+1], vehicle);
SendInfoMessage(playerid, ".: Info: Trailer attached. Drive the stuffs to the SDC Dropoff. :.");
VehicleInfo[vehicle][vSDCStuffs] = 300;
}
else if(PlayerToPoint(50.0,playerid,-1018.8698,-655.1353,32.0078))
{
SetVehiclePos(vehicle,-1018.8698,-655.1353,32.0078);
SetVehicleZAngle(vehicle,178.6117);
trailer[playerid+1] = CreateVehicle(435,9999.9,9999.9,9999.9,9.9,1,1,-1);
AttachTrailerToVehicle(trailer[playerid+1], vehicle);
SendInfoMessage(playerid, ".: Info: Trailer attached. Drive the guns to the SDC Dropoff. :.");
VehicleInfo[vehicle][vSDCGuns] = 300;
}
return 1;
}