GetVehicleDamageStatus
#1

Hello everyone. How should I properly use GetVehicleDamageStatus, UpdateVehicleDamageStatus, and most important - store it in mysql database? I can't fully understand how does bits works, how is they used in damage status, how to export them properly (wiki says, that sa-mp returns a decimal number, and using encode_(panels, doors, tires, lights) I should get every part damage state separately). I read tutorials about bit, but that did not helped for me. Can someone provide an example, how to properly get, update, and most important - store vehicle damage status in database. That type of column should I use? Integer, Bit, or any other type? Thanks in advance!
Reply
#2

Panels, doors, lights & tires are ALL integers.

And in this case, as the wheel says, integers should be saved with the %d specifier.

Unless you're saving vehicle health (which is a FLOAT - so %f).

pawn Code:
new panels, doors, lights, tires;

GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);

printf("Vehicle Info: [Panels] : %d - [Doors] : %d - [Lights] : %d - [Tires] : %d", panels, doors, lights, tires);
Remember, panels and doors are both 0-1.

Save it like you save every other variable (such like player kills or deaths), there is no difference.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)