nuclearsilo583 / zephyrus-store-preview-new-syntax

My rewritten zephyrus store
61 stars 40 forks source link

added vip buy for request #154 #155

Open originalaidn opened 1 year ago

originalaidn commented 1 year ago

In this PR I added purchase VIP with VIP Core (by R1KO). #154 requested this and I upload my own code (I had to change a few things, so it needs to be tested)

✅ Compiled in 1.12 :x: Not tested in game

azalty commented 1 year ago

You should use a more distinct name than just "buyvip" as there are other vip plugins out there

originalaidn commented 1 year ago

Yes, thats true, i'll change it.

originalaidn commented 1 year ago

one problem with the "Store_RegisterHandler" false value, if someone have VIP status but buy it, their credits and the item is disappearing

azalty commented 1 year ago

Indeed. Is there a way we could give the item back or not remove it? 🤔 or prevent it from being used?

adyshark commented 1 year ago

i need to remove vip from database after expires, how do i do that?

azalty commented 1 year ago

one problem with the "Store_RegisterHandler" false value, if someone have VIP status but buy it, their credits and the item is disappearing

So yea, about that, I think the best way to bypass this problem would be to add RequestFrame to hook the next frame, and give the item back on that next frame. Doing all the necessary verifications (IsClientInGame...) should also be needed on that next frame, for safety. That would mean that players that disconnect right after using the item could lose it, but it is not likely, and I guess we could always add a way to give an item to a disconnected user (?, didn't check if possible)

azalty commented 1 year ago

i need to remove vip from database after expires, how do i do that?

@adyshark shouldn't the VIP Core plugin handle that, since we specify a duration for the VIP rank?