Like this
timer = {}
---------------------------
-- Repair vehicle
---------------------------
function repairVehicle()
local vehicle = getPedOccupiedVehicle(g_Me)
if vehicle then
if not isTimer(timer[g_Me]) then
-- local remaining, executesRemaining, totalExecutes = getTimerDetails(timer)
timer[g_Me] = setTimer(function() timer[g_Me] = nil end,30000,1)
server.fixVehicle(vehicle)
local time_left_ms, executes_lesft, total_executes_count = getTimerDetails(timer[g_Me])
if (remaining and executesRemaining and totalExecutes) then
outputChatBox("#006400• Vehicle successfully repaired", 0, 100, 0,true)
else
errMsg("• Please wait at least "..time_left_ms.." seconds before repairing again.")
end
end
end end
addCommandHandler('repair', repairVehicle)
addCommandHandler('rp', repairVehicle)