CMD:bb(playerid, vehicleid, params[]) { new panels, doors, lights, tires; GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); UpdateVehicleDamageStatus(vehicleid, panels, 111, lights, tires); return 1; }
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; } |
UpdateVehicleDamageStatus(vehicleid, panels, 0b111, lights, tires);
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); |
CMD:dda(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid))
return 1;
new panels, doors, lights, tires,
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors | (0b100 << 16) | (0b100 << 24), lights, tires);
return 1;
}
There is actually 4 byte and not 5. Remove the last one (40). Otherwise, that should works. Here you go
|
CMD:bb(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid))
return 1;
new panels, doors, lights, tires,
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors | (0b100 << 8) | (0b100 << 16) | (0b100 << 24)| (0b100 << 32) , lights, tires);
return 1;
}
UpdateVehicleDamageStatus(vehicleid, panels, (0b100 << 8) | (0b100 << 16) | (0b100 << 24)| (0b100 << 32) , lights, tires);