AttachObjectToVehicle
#1

Hey, I got a little problem over here, I created this cmd that loads the forklift cargo on the truck. The only problem is once I use the cmd the object or the cargo doesn't get attached on the truck but on the back of the forklift .
Here are the codes.
pawn Код:
CMD:loadtruck(playerid, params[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new truckid = GetClosestCar(playerid);
    new Float:X,Float:Y,Float:Z;
    GetVehiclePos(truckid, X,Y,Z);
    if(IsAForklift(vehicleid))
    {
    if(ForkliftLoaded[vehicleid] == 0) return SendClientMessage(playerid, COLOR_DARKRED,"[SERVER] {FFFFFF}There is no cargo on this forklift.");
    if(!IsATruck(truckid) && IsPlayerInRangeOfPoint(playerid, 10, X,Y,Z))
    {
    if(TruckLoaded[truckid] == 0)
    {
    DestroyObject(ForkliftObject[vehicleid][vObject]);
    TruckObject[truckid][vObject] = CreateObject(964, 0, 0.9, -0.12, 0, 0, 0);
    AttachObjectToVehicle(TruckObject[truckid][vObject], truckid, 0.000000, -3.890041, 0.120000, 0.000000, 0.000000, 0.000000);
    TruckLoaded[truckid] = 1;
    ForkliftLoaded[vehicleid] = 0;
    }
    else return SendClientMessage(playerid, COLOR_DARKRED,"[SERVER] {FFFFFF}This truck can't carry more cargo.");
    }
    else return SendClientMessage(playerid, COLOR_DARKRED,"[SERVER] {FFFFFF}You aren't near any cargo truck.");
    }
    else return SendClientMessage(playerid, COLOR_DARKRED,"[SERVER] {FFFFFF}You must be a driver of a forklift to load a forklift.");
    return 1;
}
Reply


Messages In This Thread
AttachObjectToVehicle - by RALL0 - 19.07.2013, 16:23
Re: AttachObjectToVehicle - by RajatPawar - 19.07.2013, 16:30
Re: AttachObjectToVehicle - by RALL0 - 19.07.2013, 16:33
Re: AttachObjectToVehicle - by Mitchy - 19.07.2013, 16:37
Re: AttachObjectToVehicle - by RALL0 - 19.07.2013, 17:02
Re: AttachObjectToVehicle - by RALL0 - 19.07.2013, 21:55
Re: AttachObjectToVehicle - by Joe Staff - 19.07.2013, 22:49
Re: AttachObjectToVehicle - by RALL0 - 20.07.2013, 10:43
Re: AttachObjectToVehicle - by RALL0 - 20.07.2013, 22:39
Re: AttachObjectToVehicle - by RALL0 - 21.07.2013, 10:10

Forum Jump:


Users browsing this thread: 3 Guest(s)