Posts: 232
Threads: 4
Joined: Apr 2013
1. the LoadBox[vehicleid][ForkliftObject] must be valid object
2. the position of LoadBox[vehicleid][ForkliftObject] must be: 0.0,0.0,0.0
also see here:
https://sampwiki.blast.hk/wiki/AttachObjectToVehicle
Posts: 208
Threads: 40
Joined: Sep 2010
Reputation:
0
I've added the missing .0 to the position & rotation, and I've made sure that the forklift object is valid, and yet it doesn't appear.
Posts: 232
Threads: 4
Joined: Apr 2013
Quote:
Originally Posted by Konstantinos
Nope. You can change the offset and the rotation of it.
|
AttachObjectToVehicle never reset the position of object, example if you need to attach object to this offset of vehicle: 1.0,1.0,1.0 if we set offset of Object to 1.0,1.0,1.0 we can't use 1.0,1.0,1.0 in AttachObjectToVehicle if we do it Object doesn't go to your intentional position
Posts: 208
Threads: 40
Joined: Sep 2010
Reputation:
0
The position of the object that is to be attached to the vehicle isn't 1.0,1.0,1.0
Posts: 232
Threads: 4
Joined: Apr 2013
You need to do something like this:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVING)
{
LoadBox[GetPlayerVehicleID(playerid)][ForkliftObject] = CreateObject(2000, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(LoadBox[GetPlayerVehicleID(playerid)][ForkliftObject], GetPlayerVehicleID(playerid), 0, 0.9, -0.2, 0, 0, 0);
}
return 1;
}
Posts: 232
Threads: 4
Joined: Apr 2013
i told you use 0.0,0.0,0.0 for offset of CreateObject !
Try this:
pawn Код:
LoadBox[vehicleid][ForkliftObject] = CreateObject(964,0.0, 0.0, 0.0, 0.00000000, 0.00000000, 0.00000000);
AttachObjectToVehicle(LoadBox[vehicleid][ForkliftObject], vehicleid, 0.0, 0.9, -0.2, 0.0, 0.0, 0.0);