renzuzu / renzu_clothes

Fivem Advanced Clotheshop and Wardrobe
GNU General Public License v3.0
38 stars 19 forks source link

Blacklisted ID #24

Open Sariban15 opened 2 years ago

Sariban15 commented 2 years ago

Hello, i have an issue with the blacklisted ID It work when you put only one ID when you put another nothing is blacklisted, i have tried many format like : {10,20} {[10,20]} {'10','20'} etc....

but none work or just the first ID is blacklisted :( I tried to search in script.js but im not familiar with this.

darektion commented 2 years ago

Hey Sariban15,

I encountered this issue as well, found a bug in the script.js which attempts to do a for-loop through the array of blacklist values.

for (var i = 0; blacklist > i; i++) { if (this.value == blacklist[i]) { this.value = this.value + 1 } }

The for-loops are not working properly, because the length of the blacklist isn't used. It only takes in the first value, because the existence of the blacklist is either 1 (true) or 0 (false), so the loop will only go through the first element of the array before dropping out of it.

Change "blacklist > i" to "blacklist.length > i", which would take the length of the entire array.