Remove 5 Car Doors
#1

I need CMD for remove all 5 doors from the car, Someone can help me??
Reply
#2

5 doors?
i saw 4, 2 only huh but from where the 5 came lol? huh
Edit: today i knew it
Reply
#3

https://sampwiki.blast.hk/wiki/UpdateVehicleDamageStatus
Than
https://sampwiki.blast.hk/wiki/DoorStates
Reply
#4

Thx, friend. Im using this code but dont work, do u know why dont work??

Код:
CMD:bb(playerid, vehicleid, params[])
{
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, 111, lights, tires); 
return 1;
}
Reply
#5

Quote:
Originally Posted by bookknp
Посмотреть сообщение
Thx, friend. Im using this code but dont work, do u know why dont work??

Код:
CMD:bb(playerid, vehicleid, params[])
{
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, 111, lights, tires); 
return 1;
}
The values for the doors are displayed in bits, so 111 shouldn't be a decimal number but binary.

111 in binary equals 7 in decimal, so to toggle all doors you need to use the value 7 or write it in binary format:

Код:
UpdateVehicleDamageStatus(vehicleid, panels, 0b111, lights, tires);
Reply
#6

Quote:
Originally Posted by NaS
Посмотреть сообщение
The values for the doors are displayed in bits, so 111 shouldn't be a decimal number but binary.

111 in binary equals 7 in decimal, so to toggle all doors you need to use the value 7 or write it in binary format:

Код:
UpdateVehicleDamageStatus(vehicleid, panels, 0b111, lights, tires);
Thx, Why dont remove car doors ??
Reply
#7

Quote:
Originally Posted by bookknp
Посмотреть сообщение
Thx, Why dont remove car doors ??
That's a bit more tricky and if you have read what it wronte on the wiki, your code is false.

PHP код:
CMD:dda(playeridparams[])
{
    if(!
IsPlayerInAnyVehicle(playerid))
        return 
1;
    new 
panelsdoorslightstires,
        
vehicleid GetPlayerVehicleID(playerid);
        
    
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
    
UpdateVehicleDamageStatus(vehicleidpanelsdoors | (0b100 << 16) | (0b100 << 24), lightstires);
    return 
1;

Reply
#8

There is actually 4 byte and not 5. Remove the last one (40). Otherwise, that should works. Here you go
Reply
#9

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
There is actually 4 byte and not 5. Remove the last one (40). Otherwise, that should works. Here you go
This door cant be removed??

Reply
#10

No'p you can't.
About your code :
PHP код:
CMD:bb(playeridparams[])
{
if(!
IsPlayerInAnyVehicle(playerid))
        return 
1;
    new 
panelsdoorslightstires,
        
vehicleid GetPlayerVehicleID(playerid);
    
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
    
UpdateVehicleDamageStatus(vehicleidpanelsdoors | (0b100 << 8) | (0b100 << 16) | (0b100 << 24)| (0b100 << 32)  , lightstires);
    return 
1;

If you set every byte of "doors", you don't to have "doors |".
PHP код:
UpdateVehicleDamageStatus(vehicleidpanels, (0b100 << 8) | (0b100 << 16) | (0b100 << 24)| (0b100 << 32)  , lightstires); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)