14.02.2016, 13:38
I'm working on a trucking system with a dialog.
This is what I have right now.
The problem here is, that the trailer is spawning but it isn't attaching to the truck.
What did I do wrong?
This is what I have right now.
Код:
case DIALOG_TRUCKER:
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new col1 = randomEx(128,255);
new col2 = randomEx(128,255);
new tr = randomEx(1, 2);
if(tr == 1)
{
pInfo[playerid][TrailID] = CreateVehicle(591, x, y, z+15, 0, col1, col2, -1);
}
else if(tr == 2)
{
pInfo[playerid][TrailID] = CreateVehicle(435, x, y, z+15, 0, col1, col2, -1);
}
new vehicleid = GetPlayerVehicleID(playerid);
switch(listitem)
{
case 0:
{
SetPlayerCheckpoint(playerid, 1190.2216,-883.0084,43.0915, 5);
SendClientMessage(playerid, COLOR_GREY, "You have chosen the delivery for Burger Shot LS.");
pInfo[playerid][Checkpoint] = 3;
AttachTrailerToVehicle(pInfo[playerid][TrailID], vehicleid);
}
case 1:
{
SetPlayerCheckpoint(playerid, 369.6213,-2043.0742,7.6719, 5);
SendClientMessage(playerid, COLOR_GREY, "You have chosen the delivery for Fish LS.");
pInfo[playerid][Checkpoint] = 4;
AttachTrailerToVehicle(pInfo[playerid][TrailID], vehicleid);
}
case 2:
{
SetPlayerCheckpoint(playerid, 1389.0614,266.1005,19.5669, 5);
SendClientMessage(playerid, COLOR_GREY, "You have chosen the delivery for Montegory's Pizza Stack.");
pInfo[playerid][Checkpoint] = 5;
AttachTrailerToVehicle(pInfo[playerid][TrailID], vehicleid);
}
}
}
What did I do wrong?


