Quote:
Originally Posted by norton2
I did not understand, I can give you example how would need to show?
Thank You
|
you have to create the trailer at the same position as the player (or at least somewhere near by).
try it like this:
pawn Код:
CMD:tri(playerid, params[])
{
new Float:p[3];
GetPlayerPos(playerid,p[0],p[1],p[2]);
new trailerid = CreateVehicle(610, p[0],p[1],p[2], 0.00, 0, 0, -1);
AttachTrailerToVehicle(trailerid, GetPlayerVehicleID(playerid));
return 1;
}
or
pawn Код:
CMD:tri(playerid, params[])
{
new trailerid = CreateVehicle(610, 0, 0, 0, 0.00, 0, 0, -1);
if(!(IsVehicleStreamedIn(trailerid, playerid)))
{
new Float:p[3];
GetPlayerPos(playerid,p[0],p[1],p[2]);
SetVehiclePos(trailerid, p[0], p[1], p[2]);
}
AttachTrailerToVehicle(trailerid, GetPlayerVehicleID(playerid));
return 1;
}
like this, you won't have to get the position of the player and create it near him
if he happens to be just near the "zero" point.
if not, it's just being created there and then tp'ed to him.
it'll get attached at the end.
either way, both examples will result in the trailer getting attached successfully