I want to disable bike melee (bike kick)
Someone can help me?
You need to disable the controls related to attacking when players are on a bike.
This can be achieved using DisableControlAction - Natives @ Cfx.re Docs and GetVehicleClass - Natives @ Cfx.re Docs.
1 Like
CreateThread(function()
while true do
local playerPed = PlayerPedId() -- Get the player's ped
local isOnBike = IsPedOnAnyBike(playerPed) -- Check if the player is on a bike
if isOnBike then
DisableControlAction(0, 345, true)
end
Wait(0) -- Always include a wait to avoid crashing the game
end
end)
2 Likes