SA-MP Forums Archive
Car doors and hood - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car doors and hood (/showthread.php?tid=282662)



Car doors and hood - Dr - 12.09.2011

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.


Re: Car doors and hood - Marricio - 12.09.2011

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.


Re: Car doors and hood - =WoR=G4M3Ov3r - 12.09.2011

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 ?


Re: Car doors and hood - Marricio - 12.09.2011

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

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


Re: Car doors and hood - =WoR=G4M3Ov3r - 12.09.2011

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


Re: Car doors and hood - Marricio - 12.09.2011

.4char


Re: Car doors and hood - =WoR=G4M3Ov3r - 12.09.2011

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

Edit: Nvm


Re: Car doors and hood - Dr - 12.09.2011

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


Re: Car doors and hood - =WoR=G4M3Ov3r - 12.09.2011

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;




Re: Car doors and hood - Marricio - 12.09.2011

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.