[Ajuda] AttachDynamicObjectToVehicle
#1

Estou um pouco confuso, pois, jб tentei de todas as formas anexar um objeto no veнculo, mas nunca dб certo

PHP Code:
stock Attachment_Refresh(attachmentid)
{
    if (
attachmentid != -&& AttachmentData[attachmentid][attachmentExists])
    {
        if (
IsValidDynamicObject(AttachmentData[attachmentid][attachmentObject]))
            
DestroyDynamicObject(AttachmentData[attachmentid][attachmentObject]);
        
AttachmentData[attachmentid][attachmentObject] = CreateDynamicObject(
            
AttachmentData[attachmentid][attachmentModel],
            
AttachmentData[attachmentid][attachmentPos][0],
            
AttachmentData[attachmentid][attachmentPos][1],
            
AttachmentData[attachmentid][attachmentPos][2],
            
AttachmentData[attachmentid][attachmentRot][0],
            
AttachmentData[attachmentid][attachmentRot][1],
            
AttachmentData[attachmentid][attachmentRot][2]
        );
        
SetTimerEx("AttachObjects"800false"d"attachmentid);
        return 
1;
    }
    return 
0;
}
forward AttachObjects(attachmentid);
public 
AttachObjects(attachmentid)
{
    
AttachDynamicObjectToVehicle(
        
AttachmentData[attachmentid][attachmentObject],
        
CarData[AttachmentData[attachmentid][attachmentVehicle]][carVehicle],
        
AttachmentData[attachmentid][attachmentPos][0],
        
AttachmentData[attachmentid][attachmentPos][1],
        
AttachmentData[attachmentid][attachmentPos][2],
        
AttachmentData[attachmentid][attachmentRot][0],
        
AttachmentData[attachmentid][attachmentRot][1],
        
AttachmentData[attachmentid][attachmentRot][2]
    );
    return 
1;

PHP Code:
stock Car_Spawn(carid)
{
    if (
carid != -&& CarData[carid][carExists])
    {
        if (
IsValidVehicle(CarData[carid][carVehicle]))
            
DestroyVehicle(CarData[carid][carVehicle]);
        if (
CarData[carid][carColor1] == -1)
            
CarData[carid][carColor1] = random(127);
        if (
CarData[carid][carColor2] == -1)
            
CarData[carid][carColor2] = random(127);
        
CarData[carid][carVehicle] = CreateVehicle(CarData[carid][carModel], CarData[carid][carPos][0], CarData[carid][carPos][1], CarData[carid][carPos][2], CarData[carid][carPos][3], CarData[carid][carColor1], CarData[carid][carColor2], (CarData[carid][carOwner] != 0) ? (-1) : (1200000));
        if (
CarData[carid][carVehicle] != INVALID_VEHICLE_ID)
        {
            for(new 
0MAX_DYNAMIC_CARSi++)
            {
                
SetVehicleNumberPlate(CarData[i][carVehicle], CarData[i][carPlate]);
            }
            if (
CarData[carid][carPaintjob] != -1)
            {
                
ChangeVehiclePaintjob(CarData[carid][carVehicle], CarData[carid][carPaintjob]);
            }
            if (
CarData[carid][carLocked])
            {
                new
                    
enginelightsalarmdoorsbonnetbootobjective;
                
GetVehicleParamsEx(CarData[carid][carVehicle], enginelightsalarmdoorsbonnetbootobjective);
                
SetVehicleParamsEx(CarData[carid][carVehicle], enginelightsalarm1bonnetbootobjective);
            }
            for (new 
014++)
            {
                if (
CarData[carid][carMods][i]) AddVehicleComponent(CarData[carid][carVehicle], CarData[carid][carMods][i]);
            }
               
ResetVehicle(CarData[carid][carVehicle]);
            return 
1;
        }
    }
    return 
0;

Reply
#2

Up!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)