How do I avoid activating twice?
-- Back
if IsControlJustPressed(1, 202) and GetLastInputMethod(2) then
self.conf.backlock = true
self:BackBtn()
PlaySound(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", 0, 0, 1)
end
if IsControlJustReleased(1, 202) and GetLastInputMethod(2) then
self.conf.backlock = false
end
I assume you are looping it… maybe try a break in there?
I use a timer in my script:
if IsControlJustPressed(1, 202) then
if GetTimeDifference(GetGameTimer(), self._lastPressedBack) > 300 then
self._lastPressedBack = GetGameTimer()
PlaySound(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", 0, 0, 1)
self:BackBtn()
end
end
1 Like
Are those traces? If so, its just an error with the console. Its not actually activating twice. Its a bug they know about. FiveM update - May 16th, 2017
2 Likes