Jump to content

Help Me


orcun99

Recommended Posts

Posted

function repairPlayerVehicle(vehicleID) 
    if vehicleID and tonumber(vehicleID) then 
        vehicleID = tonumber(vehicleID) 
        local dataQuery = executeSQLQuery("SELECT * FROM `personalvehicles` WHERE `id` = ?", vehicleID) 
        if #dataQuery == 1 then 
            local vehicleData = dataQuery[1] 
            if not getElementByID("personalVehicle"..vehicleID) then 
                local damage = 100 - tonumber(vehicleData['health']) 
                local price = damage * 50 
                 
                local missingFuel = 100 - tonumber(vehicleData['fuel']) 
                local fuelPrice = missingFuel * 10 
                 
                local price = fuelPrice + price 
                if price > 0 then 
                    if price <= tonumber(getElementData(source, "money")) then 
                        takePlayerMoney(source, price) 
                        local query = executeSQLQuery("UPDATE `personalvehicles` SET `health`=100, `fuel`=100 WHERE `id`=?", vehicleID) 
                        if query then 
                            triggerClientEvent(source, "clientRefreshVehicles", root, getVehicles(source)) 
                            exports.ORCcommands:sendMessage("Vehicle repaired successfully.", 0, 255, 0, source) 
                        else 
                            givePlayerMoney(source, price) 
                            exports.ORCcommands:sendMessage("An error occured. Please contact an HQ admin with error code PV2.", 0, 255, 0, source) 
                        end 
                    else 
                        exports.ORCcommands:sendMessage("Yeterince Paran yok fakir.", 255, 255, 0, source) 
                    end 
                else 
                    exports.ORCcommands:sendMessage("Vehicle doesn't need repairs.", 255, 255, 0, source) 
                    triggerClientEvent(source, "clientRefreshVehicles", root, getVehicles(source)) 
                end 
            else 
                exports.ORCcommands:sendMessage("Vehicle needs to be parked to be repaired.", 255, 255, 0, source) 
                triggerClientEvent(source, "clientRefreshVehicles", root, getVehicles(source)) 
            end 
        else 
            exports.ORCcommands:sendMessage("Vehicle could not be found in vehicle database!", 255, 255, 0, source) 
            triggerClientEvent(source, "clientRefreshVehicles", root, getVehicles(source)) 
        end 
    end 
end 
addEvent("onPlayerRepairVehicle", true) 
addEventHandler("onPlayerRepairVehicle", root, repairPlayerVehicle) 

Repair does not fix the pressure button please help

Posted

Error: can not be repaired vehicle repair key pressure

In this script for me that people have the same problem I was hoping you can fix

Posted

select the tool buttons in repair of pressure to go into the tray needs to be repaired, but nothing happens when pressing the buttons in repair

Posted
select the tool buttons in repair of pressure to go into the tray needs to be repaired, but nothing happens when pressing the buttons in repair
Debug errors?
  • 3 weeks later...
Posted

ERROR: Ohousing/housing_vehicles_server.lua:157: attempt to compare number with nil

157: if price <= tonumber(getElementData(source, "money")) then

Posted
ERROR: Ohousing/housing_vehicles_server.lua:157: attempt to compare number with nil

157: if price <= tonumber(getElementData(source, "money")) then

Replace that with this:

if ( price <= getPlayerMoney ( source ) ) then 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...