Help creating+attaching an object to a vehicle.
#1

pawn Код:
forward mChecker();
public mChecker()
{
    for(new i=0;i<MAX_VEHICLES;i++)
    {
        new vehicle = GetVehicleModel(i);
        if(vehicle == 470)
        {
            if(HasMinigun[ i ] == true)
            {
                HasMinigun[ i ] = true;
                new Float:VehPos[3];
                GetVehiclePos(vehicle, VehPos[0],VehPos[1],VehPos[2]);
                minigun[ minicount ] = CreateObject(2985, VehPos[0], VehPos[1], VehPos[2], -1.0, 0, 0 , 0.6);
                AttachObjectToVehicle( minigun[ minicount ], i, 0.74, 3.37, -0.25, 0.00, 0.00, 89.47 );
                minicount++;
            }
        }
    }
    return 1;
}
Well, this code ain't attaching the object at all.. what can i do?.
Reply
#2

im guessing becouse your variable HasMinigun is checking for the condition true when yet is not!
Also clear up other things
pawn Код:
public mChecker()
{
    for(new i=0;i<MAX_VEHICLES;i++)
    {
        if(GetVehicleModel(i) == 470)
        {
            if(HasMinigun[i] == false)
            {
                HasMinigun[i] = true;
                new Float:VehPos[3];
                GetVehiclePos(vehicle, VehPos[0],VehPos[1],VehPos[2]);
                minigun[minicount] = CreateObject(2985, VehPos[0], VehPos[1], VehPos[2], -1.0, 0, 0 , 0.6);
                AttachObjectToVehicle(minigun[minicount], i, 0.74, 3.37, -0.25, 0.00, 0.00, 89.47 );
                minicount++;
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)