SA-MP Forums Archive
[Ajuda] AttachObjectToVehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] AttachObjectToVehicle (/showthread.php?tid=604758)



AttachObjectToVehicle - ModaLOKO - 09.04.2016

OI , estou quebrando a cabeзa com esse comando:

pawn Код:
new BusObject[5];
pawn Код:
BusObject[1] = CreateObject(3267,0,0,-1000,0,0,0,100);
    BusObject[2] = CreateObject(1698,0,0,-1000,0,0,0,100);
    BusObject[3] = CreateObject(1698,0,0,-1000,0,0,0,100);
    BusObject[4] = CreateObject(1698,0,0,-1000,0,0,0,100);
pawn Код:
CMD:bus(playerid)
{
    if(Player[playerid][Vip] == 1)
    {
    GiveVehicle(playerid,437);
    new vehicle;
    vehicle = GetPlayerVehicleID(playerid);
    if(vehicle == 437)
    {
    AttachObjectToVehicle(BusObject[1], vehicle, 0.000000,-4.350000,1.725000,0.000000,0.000000,0.000000);
    AttachObjectToVehicle(BusObject[2], vehicle, -1.425000,1.575000,-0.599999,0.000000,0.000000,0.000000);
    AttachObjectToVehicle(BusObject[3], vehicle, 1.425000,1.575000,-0.599999,0.000000,0.000000,0.000000);
    AttachObjectToVehicle(BusObject[4], vehicle, -0.075000,-5.849997,-0.600000,0.000000,0.000000,-89.099998);
    }
    }
    return 1;
}
Como fazer para que os Objetos sу sejam criados para um sу veiculo ? (bus 437)


Re: AttachObjectToVehicle - ShutDown_ - 09.04.2016

Funзгo GetVehicleModel: https://sampwiki.blast.hk/wiki/GetVehicleModel

pawn Код:
CMD:bus(playerid)
{
    if(Player[playerid][Vip] == 1)
    {
        GiveVehicle(playerid,437);
        new vehicle;
        vehicle = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(vehicle) == 437)
        {
            AttachObjectToVehicle(BusObject[1], vehicle, 0.000000,-4.350000,1.725000,0.000000,0.000000,0.000000);
            AttachObjectToVehicle(BusObject[2], vehicle, -1.425000,1.575000,-0.599999,0.000000,0.000000,0.000000);
            AttachObjectToVehicle(BusObject[3], vehicle, 1.425000,1.575000,-0.599999,0.000000,0.000000,0.000000);
            AttachObjectToVehicle(BusObject[4], vehicle, -0.075000,-5.849997,-0.600000,0.000000,0.000000,-89.099998);
        }
    }
    return 1;
}



Re: AttachObjectToVehicle - ModaLOKO - 10.04.2016

Quando eu crio outro veiculo, os objetos aparecem , como fazer para sу aparecer quando for o Bus ?


Re: AttachObjectToVehicle - iLordGG - 10.04.2016

Se vocк criar os attach object no bus e deletar ele, o proximo carro criado irб vir com os objetos, a funзгo AttachObjectToVehicle й toda bugada, os objetos criados nгo da de deletar....