rprogress icon indicating copy to clipboard operation
rprogress copied to clipboard

Ability to spam completed callback

Open MichaelLoder opened this issue 3 years ago • 4 comments
trafficstars

Changed code to RegisterNUICallback('progress_minigame_input', function(data, cb) if(not MiniGameCompleted) then if OnComplete ~= nil then OnComplete(data.success == true) end StopAnimation() MiniGameCompleted = true end
cb('ok') end)

MichaelLoder avatar Apr 13 '22 10:04 MichaelLoder

Doesnt resolve that you can hold SPACE and spam the event that is triggered afterwards multiple times. You can essential do the process of

minigame > hold space > get unlimited amounts of items if the code in success gives items

image

@Mobius1 Are you still refactoring this code or is it abandoned?

JohnnyS avatar Jun 08 '22 18:06 JohnnyS

image

JohnnyS avatar Jun 08 '22 18:06 JohnnyS

You can fix this by changing the app.js file from line 190 to 212 to look like this window.addEventListener("keydown", e => { if ( e.key == " " && keyIsDown == false) { if ( miniGame && running ) { keyIsDown = true; miniGame.pause(); PostData("progress_minigame_input", { success: miniGame.progress > miniGame.zoneMin && miniGame.progress < miniGame.zoneMax }) setTimeout(() => { miniGame.hide(); setTimeout(() => { running = false; miniGame.stop(); miniGame = false; keyIsDown = false; PostData("progress_minigame_complete"); }, 1000) }, 1000) } } }); and on top declare let keyIsDown = false This will prevent the spamm, hope it helps

Ticko4 avatar Jun 11 '22 19:06 Ticko4

That seems to have fixed it thank you very much

JohnnyS avatar Jun 12 '22 14:06 JohnnyS