function playerPressedKey(button, press)
if (press) then -- Only output when they press it down
--outputChatBox("You pressed the "..button.." key!")
end
end
addEventHandler("onClientKey", root, playerPressedKey)
addEventHandler( "onClientKey", root, function(button,press)
if button == "1" then
triggerServerEvent("sportmod", localPlayer)
elseif button == "2" then
triggerServerEvent("business", localPlayer)
return true
end
return false
end )
function setVehicleVelocity(player, command)
local veh = getPedOccupiedVehicle(player)
if (not veh or veh == nil or getPedOccupiedVehicleSeat(player) ~= 0 ) then return end
if (command == "sportmod") then
setVehicleHandling(veh, "maxVelocity", 320)
setVehicleHandling(veh, "engineAcceleration", 20)
setVehicleHandling(veh, "driveType", "awd")
setVehicleHandling(veh, "handlingFlags", 0x1008000)
outputChatBox("Sport Mod Enabled", player, 255, 255, 0, true)
elseif (command == "business") then
setVehicleHandling(veh, "maxVelocity", 180)
setVehicleHandling(veh, "engineAcceleration", 20)
setVehicleHandling(veh, "driveType", "awd")
setVehicleHandling(veh, "handlingFlags", 0x1008000)
outputChatBox("Business Mod Enabled", player, 255, 255, 0, true)
end
end
addCommandHandler("sportmod", setVehicleVelocity)
addCommandHandler("business", setVehicleVelocity)
addEvent("sportmod", true)
addEvent("business", true)
addEventHandel("sportmod", root, setVehicleVelocity(sportmod))
addEventHandel("business", root, setVehicleVelocity(business))
server side