SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/04/2019, 05:09 PM   #1
Marshas
Little Clucker
 
Join Date: Apr 2017
Posts: 37
Reputation: 0
Default GetVehicleDamageStatus

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!
Marshas is offline   Reply With Quote
Old 02/04/2019, 07:23 PM   #2
SymonClash
Banned
 
Join Date: Dec 2018
Posts: 257
Reputation: 25
Default Re: GetVehicleDamageStatus

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.
SymonClash is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Panels - GetVehicleDamageStatus? Chocopie Scripting Help 3 29/12/2016 04:53 PM
GetVehicleDamageStatus MerryDeer Scripting Help 1 10/10/2016 02:56 PM
GetVehicleDamageStatus Lidor124 Scripting Help 6 10/04/2014 08:12 PM
GetVehicleDamageStatus value ranges? cAMo Help Archive 11 30/05/2011 03:09 PM


All times are GMT. The time now is 08:28 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.