AttachObjectToVehicle
#1

Hey, I just created a loadforklift command and I got 5 defined object, but I am really confused how can I make it that the system checks if the player is near one of the 5 objects instead just 1 of them. Here are the codes.
pawn Код:
CMD:loadforklift(playerid, params[])
{
    new Float:X,Float:Y,Float:Z;
    new vehicleid = GetPlayerVehicleID(playerid);
    GetObjectPos(CrateObjects[1],X,Y,Z);
    if(IsAForklift(vehicleid))
    {
    if(IsPlayerInRangeOfPoint(playerid,10,X,Y,Z))
    {
    ForkliftLoaded[vehicleid] = 1;
    DestroyObject(CrateObjects[1]);
    ForkliftObject[vehicleid][vObject] = CreateObject(964, 0, 0.9, -0.12, 0, 0, 0);
    AttachObjectToVehicle(ForkliftObject[vehicleid][vObject], vehicleid, 0, 0.9, -0.12, 0, 0, 0);
    }
    else return SendClientMessage(playerid, COLOR_DARKRED,"[SERVER] {FFFFFF}You aren't near any crate.");
    }
    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, 10:13
Re: AttachObjectToVehicle - by RALL0 - 19.07.2013, 11:39
Re: AttachObjectToVehicle - by PaulDinam - 19.07.2013, 11:50
Re: AttachObjectToVehicle - by RALL0 - 19.07.2013, 12:05

Forum Jump:


Users browsing this thread: 2 Guest(s)