[Ajuda] AttachObjectToVehicle
#1

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)
Reply
#2

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;
}
Reply
#3

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

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....

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)