Search the Community

Showing results for tags 'getelementhealth'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



About Me





Found 1 result

  1. Hello there, i want to make a function where when the vehicle damages it syncs its health to the sqlite db.. It works quite a bit but the numbers are a bit different in database and in game Code Below: addEventHandler("onVehicleDamage", getRootElement(), function(loss) local vehHealth = math.floor((getElementHealth(source) / 10) - (loss / 10)) local owner = getElementData(source, "Owner") local getAccName = getAccountName(getPlayerAccount(owner)) local getPlate = getVehiclePlateText(source) local checkOwner = dbQuery(vehicleDb,"SELECT * FROM vehicles WHERE ownerName=? AND veh_plate=?", getAccName, getPlate) local checkOwnerResult = dbPoll(checkOwner, -1) if checkOwnerResult ~= 0 then dbExec(vehicleDb,"UPDATE vehicles SET veh_Health=? WHERE ownerName=? AND veh_plate=?", vehHealth, getAccName, getPlate) end end) the database connection works well but i don't know how to calculate exact vehicle health after loss to an integer number, any help appreciated!