Hello @ Kelton , @ Tupi .
I’ve optimized and converted the drift mod from CLEO to Lua, which is now smoother and more realistic in terms of car rotation and acceleration during drifts. It’s posted and also approved in B-Zone Rules and also Forum, and does the same thing as the original but with more logical handling and no unfair advantage.
Please take a moment to check it out and compare it with the CLEO version. I’ve included a YouTube video showing the CLEO version that’s currently being used by a lot of players and the improvements in my Lua code. All I did was convert the CLEO code to Lua and lower a single variable, and it works perfectly without issues.
require "lib.moonloader"
local playerCar
local carSpeed
function main()
if not isSampLoaded() and isSampAvailable() then return end
while true do
wait(0)
if isCharInAnyCar(playerPed) then
playerCar = storeCarCharIsInNoSave(playerPed)
carSpeed = getCarSpeed(playerCar)
isCarInAirProper(playerCar)
setCarCollision(playerCar, true)
if isKeyDown(VK_LSHIFT) and isVehicleOnAllWheels(playerCar) and doesVehicleExist(playerCar) and carSpeed > 5.0 then
setCarCollision(playerCar, false)
if isCarInAirProper(playerCar) then
setCarCollision(playerCar, true)
if isKeyDown(VK_A) then
addToCarRotationVelocity(playerCar, 0, 0, 0.05) -- in Drift.cs this variable is 0.15
end
if isKeyDown(VK_D) then
addToCarRotationVelocity(playerCar, 0, 0, -0.05) -- in Drift.cs this variable is -0.15
end
end
end
end
end
end
The CLEO drift mod (drift.cs) has caused numerous bugs and crashes for players due to its limitations and lack of optimization. In contrast, the Lua version resolves these issues, performing flawlessly thanks to its streamlined code and optimizations. By converting the mod to Lua, I was able to significantly reduce the resource usage, which not only improves performance but also stabilizes the mod on various setups:
In short, Lua is superior to CLEO for this type of modification because it's more versatile, has a smaller footprint, and provides a more stable environment - leading to fewer bugs and crashes. Many players have reported issues with the CLEO version, while the Lua version runs perfectly without any problem.
Looking forward to your feedback, and can I get a approval of using this. if not, I would love to hear your comment.
Best regards. ❤️