Car doors and hood
#1

What are the values I must put into the:
pawn Код:
UpdateVehicleDamageStatus
To destroy a vehicle's doors and hood?


Please do not give me the link to the SAMP Wiki as I cannot seem to understand what it is saying, please just post the values I must put into the code and just please post the actual code to destroy the car's doors/hood. Thank you.
Reply
#2

Took from SA-MP wiki. (https://sampwiki.blast.hk/wiki/DoorStates)
Quote:

The damage of each door (note that the hood and the trunk are also doors)

Quote:

Which byte stores what?
The first byte stores the state of the hood
The second byte stores the state of the trunk
The third byte stores the state of the drivers door
The fourth byte stores the state of the co-drivers door

The states of the 2 rear doors cannot be handled by GetVehicleDamageStatus and UpdateVehicleDamageStatus.

Notice that I count the bytes from behind - so the first is the rightmost byte

And taking the example from SA-MP wiki.(https://sampwiki.blast.hk/wiki/UpdateVehicleDamageStatus)
pawn Код:
new panels, doors, lights, tires;  
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, 15); //Setting tires to 15 will pop them all
And editing it..
pawn Код:
new panels, doors, lights, tires;  
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, 15, lights, tires); //If you set tires to 15 to pop them, i think they are used to destroy a part of the vehicle also.
NOTE: I never used that function, or any type of those, so i dont know if it works. Not tested.

Good luck, Dr.
Reply
#3

Quote:
Originally Posted by Marricio
Посмотреть сообщение
Took from SA-MP wiki. (https://sampwiki.blast.hk/wiki/DoorStates)




And taking the example from SA-MP wiki.(https://sampwiki.blast.hk/wiki/UpdateVehicleDamageStatus)
pawn Код:
new panels, doors, lights, tires;  
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, 15); //Setting tires to 15 will pop them all
And editing it..
pawn Код:
new panels, doors, lights, tires;  
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, 15, lights, tires); //If you set tires to 15 to pop them, i think they are used to destroy a part of the vehicle also.
NOTE: I never used that function, or any type of those, so i dont know if it works. Not tested.

Good luck, Dr.
https://sampwiki.blast.hk/wiki/TireStates

You haven't read this, have you ?
Reply
#4

Quote:
Originally Posted by G4M3Ov3r
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/TireStates

You haven't read this, have you ?
Oh, I didnt.
Reply
#5

Anyways, on Topic I suggest you to use GetVehicleDamageStatus in order to find what you need.
Reply
#6

.4char
Reply
#7

Quote:
Originally Posted by Marricio
Посмотреть сообщение
.4char
Wrong Thread.

Edit: Nvm
Reply
#8

How would that used exactly G4M30v3r? Can you show me what I need to do?
Reply
#9

PHP код:
new panels,doors,lights,tires;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
printf("Vehicle Status : [Panels] : %d - [Doors] : %d - [Lights] : %d - [Tires] : %d",panels,doors,lights,tires); 
https://sampwiki.blast.hk/wiki/GetVehicleDamageStatus

You'll get all the info you need.

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/vehdamage"true) == 0)
    {
        new 
panels,doors,lights,tires;
        if(
IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,0x00FF00AA,"You're in a vehicle.");
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
printf("Vehicle Status : [Panels] : %d - [Doors] : %d - [Lights] : %d - [Tires] : %d",panels,doors,lights,tires);
        }
        return 
1;
    }
    return 
0;

Reply
#10

Add this in a command or something.
pawn Код:
new panels,doors,lights,tires;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
printf("Vehicle Status : [Panels] : %d - [Doors] : %d - [Lights] : %d - [Tires] : %d",panels,doors,lights,tires);
Took from SA-MP wiki.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)