[FREE] [ESX + QBCORE] Scratch Tickets đŸŽ«

Omg awesome! TY so much!!

1 Like

Unfortunately there is a problem that people can bypass the cooldown if they break off the rubles. Is there any way to do it in such a way that you can only use 50 loose items a day?

1 Like

ehh. I don’t exactly know what rubles means. I sent you a DM with my Discord in it if you care giving some more information!

I personally don’t think this max items/day is really wanted and a bit TOO specific for me to add in the source code, soOOooo would be a bit unnecessary for everyone else (or are people saying: “no I want/need this”?). It should be pretty straight forward to add. Again, can help you out with that in DMs.

+rep
+rep

1 Like

Still have the Issue. When i use the Scratch + Win, i cant go out of the Inventory and cant move anymore

Do you have the latest version? Also, if you’re using esx_inventoryhud please read this:
https://github.com/xDreamLand/esx_dreamscratching#using-esx_inventoryhud

1 Like

That was it!!! Thank you so much!!!

1 Like

what if your using disc-inventoryhud and being frozen after use of the scratch off?

ESX itself has no way to close the inventory with an event, so I can personally not make a global fix for this.

I checked the source code of disc-inventoryhud and they have no close on usage of an item. You could technically use exports in the source code of the scratch card and ‘manually’ call the close of the inventory on usage I think.

1 Like

V2.1.0 Rename, version control, Wiki, debugging & major code cleanup! :mascot:

  • esx_dreamresources is now dr-scratching (you can however still change the resource name to your likings. I just personally want to have it fall under the dr- category!
  • Added version control. You’ll receive a message in console in case of an update!
  • Added a Wiki on GitGub.
  • Added a debugmode.
  • Major code cleanup. Redid a bunch of code thanks to GitHub - project-error/fivem-lua-style: A mostly reasonable style & convention guide for FiveM' (if you’re a developer yourself this is a great thing to read through)

Code indents have been partially changed, so on update please keep in mind that it’ll probably remove your prices. Copy them first, update, than put 'em in again.

I will soon be adding support for more frameworks. Still looking for suggestions. If you find any issues, please let me know!

xDreamLand aka Ruwbix :mascot:

Still looking for new ideas, let me know if you have any.

Is it possible to get webhooks if players won item or money ?

Hi. You could surely add your own logging/webhook system for now if you know how to.

I’ll look into adding it though!

Nice but please make the Option to Turn on/off Webhooks in Config

And to put the webhook serversided so i cant get dumped by modder

Hello, what can trigger the following?

[script:dr-scratching] dr-scratching nil USERNAME) somehow managed to trigger the deposit event with a non-matching price matching to his/her name. Possible cheating attempt.

It has to do with this. So the script has a temporary array which is basically something to ensure nobody sends random triggers to the script or triggers it from another script
 etc. Whenever someone scratches a ticket his/her identifier is added to that temporary array and it’ll assign his identifier as key and the price as a value. Soo for example:

players = {
   12345 = "water"
}

now somehow this ‘person’ has triggered this event but his price is not matching his identifier. So normally it checks the temporary array and if 12345 has won water it’ll continue giving that item, but now 12345 has a different price (not water).

So this guy has sent a trigger to try and get some free moneys OR there is some bug I’m unaware of. Can you recreate this somehow? I’ll push out a small update for now to get some extra information whenever this happens.

PS. I also just noticed that I’m never clearing this array so if a server never restarts it is basically just causing this array to get really big, also if someone just triggers the event after winning big once he can just keep triggering it and “saying” he won the big price. I’ll fix that too.

V2.2.0 Security fixes

  • Fixed an important issue which could use up a bit of server memory and cause a security issue.

Still looking for suggestions. If you find any issues, please let me know! I keep delaying the QBCore version but I’ll get to it eventually. :zipper_mouth_face:

xDreamLand aka Ruwbix :mascot:

V3.0.0 Finally added QBCore and Webhooks! :confetti_ball:

  • QBCore has finally been released. I got a lot of DMs about it but I finally just spent some time on it and it wasn’t too hard after all. I will be pushing updates/fixes to both platforms at once. Check it out
  • Implemented Discord Webhooks. You’re finally able to receive messages on Discord whenever someone wins/loses! You can read more about how to set it up here.

If you found any issues please let me know as this was a fairly big one. btw
 Happy holidays! :christmas_tree:

xDreamLand aka Ruwbix :mascot:

V3.1.0 Resolve cooldown exploit

  • New update resolved an exploit which would let you skip the cooldown if pressed esc before fully scratching the ticket. Also wouldn’t send a webhook message. (enable earlyMessage in config if you want this)

If you found any further issues please let me know!

xDreamLand aka Ruwbix :mascot:

Where is the updated zip?? its not on github

1 Like