setPedAimTarget does not work properly if it is called less than every 95-100 milliseconds with the standard configuration. If the code is executed while standing somewhere in front of the ped, it hits the player. However, if you move directly back and forth or hide behind a wall and then go somewhere in front of the ped, the ped will no longer hit you. This problem also affects the well-known "Slothman/Slothbot" resource for bots. I read in the Discord that other players also had this problem. But if you execute the code below with a timer only every 95-100 milliseconds then there are no problems. I also tried lowering the <ped_sync_interval> from 400 to 100 but that had no effect. The function setPedAimTarget can be called as often as the <player_sync_interval> is called.
Steps to reproduce
Execute this code on the client:
local cj = createPed(0, 2498.5, -1684.0, 13.5, 20) -- create a ped at cjs house in grove street
givePedWeapon(cj, 30, 3000, true)
function renderHandler()
local x,y,z = getElementPosition(localPlayer)
setPedAimTarget(cj, x, y, z)
setPedControlState(cj, "fire", true)
end
addEventHandler("onClientRender", getRootElement(), renderHandler)
Move quickly back and forth or hide behind a wall and then go back in front of the ped or execute the code in another place and then go to the ped.
Describe the bug
setPedAimTarget
does not work properly if it is called less than every 95-100 milliseconds with the standard configuration. If the code is executed while standing somewhere in front of the ped, it hits the player. However, if you move directly back and forth or hide behind a wall and then go somewhere in front of the ped, the ped will no longer hit you. This problem also affects the well-known "Slothman/Slothbot" resource for bots. I read in the Discord that other players also had this problem. But if you execute the code below with a timer only every 95-100 milliseconds then there are no problems. I also tried lowering the<ped_sync_interval>
from400
to100
but that had no effect. The functionsetPedAimTarget
can be called as often as the<player_sync_interval>
is called.Steps to reproduce
Version
Client: v.1.6.0-release-22556 (Windows) Server: v.1.6.0-release-22556 (Windows)
Additional context
No response
Relevant log output
No response
Security Policy