Problem with AttachObjectToVehicle
#1

Problem with AttachObjectToVehicle

load bug teleports me away out of the truck

video of bug

http://*********/UVhftL77y2Y

My Script in my GM

Код:
	if(truckdeliver == 1)
		{
			Enviarmensaje(playerid, -1,"Su camiуn se lleno de madera para la compaсia.");
			SetPlayerCheckpoint(playerid, 2505.1680,-2116.9663,13.5469, 5);
            madera1[GetPlayerVehicleID(playerid)] = CreateObject( 684,0,0,0,0,0,0,80 ); // <0 palo 1>
            AttachObjectToVehicle( madera1[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), -0.900000, -1.600000, 0.100000, 0.000000, 0.000000, 0.000000 ); // <0 palo 1>
            madera2[GetPlayerVehicleID(playerid)] = CreateObject( 684,0,0,0,0,0,0,80 ); // <0 palo2>
            AttachObjectToVehicle( madera2[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), -0.100000, -1.600000, 0.100000, 0.000000, 0.000000, 0.000000 ); // <0 palo2>
            madera3[GetPlayerVehicleID(playerid)] = CreateObject( 684,0,0,0,0,0,0,80 ); // <3 palo3>
            AttachObjectToVehicle( madera3[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), 0.700000, -1.600000, 0.000000, 0.000000, 0.000000, 0.000000 ); // <3 palo3>
            madera4[GetPlayerVehicleID(playerid)] = CreateObject( 684,0,0,0,0,0,0,80 ); // <4 palo4>
            AttachObjectToVehicle( madera4[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), -0.600000, -1.600000, 0.700000, 0.000000, 0.000000, 0.000000 ); // <4 palo4>
            madera5[GetPlayerVehicleID(playerid)] = CreateObject( 684,0,0,0,0,0,0,80 ); // <5 objeto5>
            AttachObjectToVehicle( madera5[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), 0.200000, -1.600000, 0.700000, 0.000000, 0.000000, 0.000000 ); // <5 objeto5>
		}
		else if(truckdeliver == 2)
		{
			Enviarmensaje(playerid, -1,"Su camiуn se lleno de piedras y minerales");
			SetPlayerCheckpoint(playerid, 1879.7130,-1329.7416,13.5978, 5);//entrega en construccion de los santos
			piedra1[GetPlayerVehicleID(playerid)] = CreateObject( 758,0,0,0,0,0,0,80 ); // <7 piedra7>
            AttachObjectToVehicle( piedra1[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), 0.700000, -0.100000, -0.200000, 0.000000, 0.000000, 0.000000 ); // <7 piedra7>
            piedra2[GetPlayerVehicleID(playerid)] = CreateObject( 758,0,0,0,0,0,0,80 ); // <82 piedra2>
            AttachObjectToVehicle( piedra2[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), 0.800000, -3.799998, -0.200000, 0.000000, 0.000000, 0.000000 ); // <82 piedra2>
		}
		else if(truckdeliver == 3)
		{
			Enviarmensaje(playerid, -1,"Su camiуn se lleno de tuberias de construccion san fierro");
			SetPlayerCheckpoint(playerid, 2160.4478,-1978.3196,13.5527, 5);
            tuberia[GetPlayerVehicleID(playerid)] = CreateObject( 3865,0,0,0,0,0,0,80 ); // <6 tuberia6>
            AttachObjectToVehicle( tuberia[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), 0.000000, -2.299999, 1.300000, 0.000000, 0.000000, 0.000000 ); // <6 tuberia6>
		}
		else if(truckdeliver == 4)
		{
			Enviarmensaje(playerid, -1,"Su Camiуn se lleno de ropa.");
			SetPlayerCheckpoint(playerid, 2247.2351,-1661.2406,15.6749, 5);
			carga[GetPlayerVehicleID(playerid)] = CreateObject( 2935,0,0,0,0,0,0,80 );
            AttachObjectToVehicle( carga[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid), -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000 );
		}
		else if(truckdeliver == 5)
		{
			Enviarmensaje(playerid, -1,"Su Camiуn se lleno de ropa.");
			SetPlayerCheckpoint(playerid, 455.2845,-1501.5569,31.0434, 5);
			carga[GetPlayerVehicleID(playerid)] = CreateObject( 2935,0,0,0,0,0,0,80 );
            AttachObjectToVehicle( carga[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid), -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000 );
		}
		else if(truckdeliver == 6)
		{
			Enviarmensaje(playerid, -1,"Su Camiуn se lleno de ropa.");
			SetPlayerCheckpoint(playerid, 2112.7766,-1216.1750,23.8047, 5);
			carga[GetPlayerVehicleID(playerid)] = CreateObject( 2935,0,0,0,0,0,0,80 );
            AttachObjectToVehicle( carga[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid), -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000 );
		}
		else if(truckdeliver == 7)
		{
			Enviarmensaje(playerid, -1,"Su Camiуn se lleno de Materiales.");
			SetPlayerCheckpoint(playerid, 1474.4786,-1140.6188,24.0781, 5);
			carga[GetPlayerVehicleID(playerid)] = CreateObject( 2935,0,0,0,0,0,0,80 );
            AttachObjectToVehicle( carga[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid), -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000 );
		}
		else if(truckdeliver == 8)
		{
			Enviarmensaje(playerid, -1,"Su camiуn se llenу con artнculos 24/7.");
			SetPlayerCheckpoint(playerid, 1331.2570,-885.2997,39.9401, 5);
			carga[GetPlayerVehicleID(playerid)] = CreateObject( 2935,0,0,0,0,0,0,80 );
            AttachObjectToVehicle( carga[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid), -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000 );
		}
		else if(truckdeliver == 9)
		{
			Enviarmensaje(playerid, -1,"Su camiуn se llenу con artнculos 24/7.");
			SetPlayerCheckpoint(playerid, 1347.0487,-1752.1692,13.7886, 5);
			carga[GetPlayerVehicleID(playerid)] = CreateObject( 2935,0,0,0,0,0,0,80 );
            AttachObjectToVehicle( carga[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid), -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000 );
		}
		else if(truckdeliver == 10)
		{
			Enviarmensaje(playerid, -1,"Su camiуn se llenу con artнculos 24/7.");
			SetPlayerCheckpoint(playerid, 1925.5968,-1789.5017,13.1459, 5);
			carga[GetPlayerVehicleID(playerid)] = CreateObject( 2935,0,0,0,0,0,0,80 );
            AttachObjectToVehicle( carga[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid), -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000 );
		}
		else if(truckdeliver >= 11 && truckdeliver <= 15)
		{
			Enviarmensaje(playerid, -1,"Su camiуn se llenу de armas.");
			SetPlayerCheckpoint(playerid, 2168.4043,-2275.2454,13.4004, 5);
			carga[GetPlayerVehicleID(playerid)] = CreateObject( 2935,0,0,0,0,0,0,80 );
            AttachObjectToVehicle( carga[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid), -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000 );
		}
		else if(truckdeliver >= 16 && truckdeliver <= 20)
		{
			Enviarmensaje(playerid, -1,"Su camiуn se llenу de drogas.");
			SetPlayerCheckpoint(playerid, 2360.4639,-1362.5967,24.0205, 5);
			carga[GetPlayerVehicleID(playerid)] = CreateObject( 2935,0,0,0,0,0,0,80 );
            AttachObjectToVehicle( carga[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid), -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000 );
		}
		else if(truckdeliver >= 21 && truckdeliver <= 25)
		{
			Enviarmensaje(playerid, -1,"Su camiуn se llenу de materiales ilegales.");
			SetPlayerCheckpoint(playerid, 1703.7422,-1473.5187,13.5534, 5);
			carga[GetPlayerVehicleID(playerid)] = CreateObject( 2935,0,0,0,0,0,0,80 );
            AttachObjectToVehicle( carga[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid), -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000 );
		}
		Enviarmensaje(playerid, COLOR_WHITE, "Se a marcado el lugar de {0096FF}entrega {FFFFFF}en el {0096FF}mapa");//aqui2
Reply
#2

First, change:
pawn Код:
new madera1[MAX_VEHICLES];
new madera2[MAX_VEHICLES];
new madera3[MAX_VEHICLES];
new madera4[MAX_VEHICLES];
new madera5[MAX_VEHICLES];
To:
pawn Код:
new madera[MAX_VEHICLES][5];
--

Then change the above code to:
pawn Код:
new vid = GetPlayerVehicleID(playerid);
    switch(truckdeliver)
    {
        case 1:
        {
            Enviarmensaje(playerid, -1, "Su camiуn se lleno de madera para la compaсia.");
            SetPlayerCheckpoint(playerid, 2505.1680, -2116.9663, 13.5469, 5);
            AttachObjectToVehicle((madera[vid][0] = CreateObject(684,0,0,0,0,0,0, 80)), vid, -0.900000, -1.600000, 0.100000, 0.000000, 0.000000, 0.000000); // <0 palo 1>
            AttachObjectToVehicle((madera[vid][1] = CreateObject(684,0,0,0,0,0,0, 80)), vid, -0.100000, -1.600000, 0.100000, 0.000000, 0.000000, 0.000000); // <0 palo2>
            AttachObjectToVehicle((madera[vid][2] = CreateObject(684,0,0,0,0,0,0, 80)), vid, 0.700000, -1.600000, 0.000000, 0.000000, 0.000000, 0.000000); // <3 palo3>
            AttachObjectToVehicle((madera[vid][3] = CreateObject(684,0,0,0,0,0,0, 80)), vid, -0.600000, -1.600000, 0.700000, 0.000000, 0.000000, 0.000000); // <4 palo4>
            AttachObjectToVehicle((madera[vid][4] = CreateObject(684,0,0,0,0,0,0, 80)), vid, 0.200000, -1.600000, 0.700000, 0.000000, 0.000000, 0.000000); // <5 objeto5>
        }
        case 2:
        {
            Enviarmensaje(playerid, -1, "Su camiуn se lleno de piedras y minerales");
            SetPlayerCheckpoint(playerid, 1879.7130, -1329.7416, 13.5978, 5);//entrega en construccion de los santos
            AttachObjectToVehicle((piedra1[vid] = CreateObject(758,0,0,0,0,0,0, 80)), vid, 0.700000, -0.100000, -0.200000, 0.000000, 0.000000, 0.000000); // <7 piedra7>
            AttachObjectToVehicle((piedra2[vid] = CreateObject(758,0,0,0,0,0,0, 80)), vid, 0.800000, -3.799998, -0.200000, 0.000000, 0.000000, 0.000000); // <82 piedra2>
        }
        case 3:
        {
            Enviarmensaje(playerid, -1, "Su camiуn se lleno de tuberias de construccion san fierro");
            SetPlayerCheckpoint(playerid, 2160.4478, -1978.3196, 13.5527, 5);
            AttachObjectToVehicle((tuberia[vid] = CreateObject(3865,0,0,0,0,0,0, 80)), vid, 0.000000, -2.299999, 1.300000, 0.000000, 0.000000, 0.000000); // <6 tuberia6>
        }
        case 4:
        {
            Enviarmensaje(playerid, -1, "Su Camiуn se lleno de ropa.");
            SetPlayerCheckpoint(playerid, 2247.2351, -1661.2406, 15.6749, 5);
            AttachObjectToVehicle((carga[vid] = CreateObject(2935,0,0,0,0,0,0, 80)), vid, -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000);
        }
        case 5:
        {
            Enviarmensaje(playerid, -1, "Su Camiуn se lleno de ropa.");
            SetPlayerCheckpoint(playerid, 455.2845, -1501.5569, 31.0434, 5);
            AttachObjectToVehicle((carga[vid] = CreateObject(2935,0,0,0,0,0,0, 80)), vid, -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000);
        }
        case 6:
        {
            Enviarmensaje(playerid, -1, "Su Camiуn se lleno de ropa.");
            SetPlayerCheckpoint(playerid, 2112.7766, -1216.1750, 23.8047, 5);
            AttachObjectToVehicle((carga[vid] = CreateObject(2935,0,0,0,0,0,0, 80)), vid, -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000);
        }
        case 7:
        {
            Enviarmensaje(playerid, -1, "Su Camiуn se lleno de Materiales.");
            SetPlayerCheckpoint(playerid, 1474.4786, -1140.6188, 24.0781, 5);
            AttachObjectToVehicle((carga[vid] = CreateObject(2935,0,0,0,0,0,0, 80)), vid, -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000);
        }
        case 8:
        {
            Enviarmensaje(playerid, -1, "Su camiуn se llenу con artнculos 24/7.");
            SetPlayerCheckpoint(playerid, 1331.2570, -885.2997, 39.9401, 5);
            AttachObjectToVehicle((carga[vid] = CreateObject(2935,0,0,0,0,0,0, 80)), vid, -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000);
        }
        case 9:
        {
            Enviarmensaje(playerid, -1, "Su camiуn se llenу con artнculos 24/7.");
            SetPlayerCheckpoint(playerid, 1347.0487, -1752.1692, 13.7886, 5);
            AttachObjectToVehicle((carga[vid] = CreateObject(2935,0,0,0,0,0,0, 80)), vid, -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000);
        }
        case 10:
        {
            Enviarmensaje(playerid, -1, "Su camiуn se llenу con artнculos 24/7.");
            SetPlayerCheckpoint(playerid, 1925.5968, -1789.5017, 13.1459, 5);
            AttachObjectToVehicle((carga[vid] = CreateObject(2935,0,0,0,0,0,0, 80)), vid, -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000);
        }
        case 11 .. 15:
        {
            Enviarmensaje(playerid, -1, "Su camiуn se llenу de armas.");
            SetPlayerCheckpoint(playerid, 2168.4043, -2275.2454, 13.4004, 5);
            AttachObjectToVehicle((carga[vid] = CreateObject(2935,0,0,0,0,0,0, 80)), vid, -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000);
        }
        case 16 .. 20:
        {
            Enviarmensaje(playerid, -1, "Su camiуn se llenу de drogas.");
            SetPlayerCheckpoint(playerid, 2360.4639, -1362.5967, 24.0205, 5);
            AttachObjectToVehicle((carga[vid] = CreateObject(2935,0,0,0,0,0,0, 80)), vid, -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000);
        }
        case 21 .. 25:
        {
            Enviarmensaje(playerid, -1, "Su camiуn se llenу de materiales ilegales.");
            SetPlayerCheckpoint(playerid, 1703.7422, -1473.5187, 13.5534, 5);
            AttachObjectToVehicle((carga[vid] = CreateObject(2935,0,0,0,0,0,0, 80)), vid, -0.000000, -1.400000, 1.100000, 0.000000, 0.000000, 0.000000);
        }
    }
    Enviarmensaje(playerid, COLOR_WHITE, "Se a marcado el lugar de {0096FF}entrega {FFFFFF}en el {0096FF}mapa");//aqui2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)