-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bumpers #56
Comments
Hello @bbmeb, |
I've tried your code provided and produce the same results I tried it without the use of this library aswell and same result I got here's the code `@cmd() test(playerid, params[], help)
} @cmd() test1(playerid, params[], help) |
Additionally I tried with samp server and it works fine either openmp causing this bug or the code itself we'll see what we can do Code I've used to reproduce this issue public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/test1", true)) {
new panels, doors, lights, tires;
new vehicleid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, (panels | 0b00000000001100000000000000000000), doors, lights, tires);
return 1;
// Returning 1 informs the server that the command has been processed.
// OnPlayerCommandText won't be called in other scripts.
} else if (!strcmp(cmdtext, "/test", true)) {
new str[32];
new panels, doors, lights, tires;
new front_left_panel, front_right_panel, rear_left_panel, rear_right_panel, windshield, front_bumper, rear_bumper;
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
decode_panels(panels, front_left_panel, front_right_panel, rear_left_panel, rear_right_panel, windshield, front_bumper, rear_bumper);
format(str, sizeof(str), "front_bumper: %d | back_bumper: %d", front_bumper, rear_bumper);
SendClientMessage(playerid, -1, str);
return 1;
}
return 0;
}
decode_panels(panels, &front_left_panel, &front_right_panel, &rear_left_panel, &rear_right_panel, &windshield, &front_bumper, &rear_bumper)
{
front_left_panel = panels & 15;
front_right_panel = panels >> 4 & 15;
rear_left_panel = panels >> 8 & 15;
rear_right_panel = panels >> 12 & 15;
windshield = panels >> 16 & 15;
front_bumper = panels >> 20 & 15;
rear_bumper = panels >> 24 & 15;
} |
So this issue might be related to open.mp. Could you try storing the result without decoding the panels? |
I'm trying recognize the vehicle bumpers with the" Vehicle_GetPanelsCondition", the system recognizes the front bumper as a back bumper, the back bumper doesn't even recognize.
Screens, logs:
[18:27:55] front_bumper: 0 | back_bumper: 2
[18:28:25] front_bumper: 0 | back_bumper: 3
18:28:42] front_bumper: 0 | back_bumper: 3
The text was updated successfully, but these errors were encountered: