#[FREE] [QBCore & ESX] Inventory Weight System!
1 messages · Page 1 of 1 (latest)
Anything above 0 will cause issues with things that needs to be looped every frame
Also, instead of converting a string to a number to convert percentages, just do percentage / 100, this divides it by 100 to get the decimal number of the percentage
Btw, you can add use_experimental_fxv2_oal 'yes' to your fxmanifest.lua to speed up native invocation, so essentially optimize natives in your resource
The only downside is it disables vector unpacking but you don't use that
Thanks for the advise buddy! Appriciate it! ❤️
No problem
No reason to be 0 buddy, Check out what it effects when having 0 and 2 wait.
Literally nothing so your losing out on performance for no reason.
Thanks for the suggestion with experimental fxv2 but as it says in the title its experimental.. What possible issues could this cause?
I will edit the code now for the percentage suggestion.
Check out what it effects when having 0 and 2 wait
Literally no difference besides whenever someone with a bad or incredibly good (forgot which one it was) pc comes along, they will experience stutters from that native as it needs to be run every frame, not every frame that occurs every 2 milliseconds, which means it'll skip every occasional frame as a frame takes about 16 milliseconds on average on the average pc and that wait stacks up on frame skips the longer it runs
your losing out on performance for no reason.
There is literally no performance loss for waiting 2 milliseconds less
experimental fxv2 but as it says in the title its experimental
We use it in all of qbox and I added it to qb when I was a dev there, no issues since 1.5 years ago
The experimental title was only added because an issue occurred and to keep people away from what could be something that breaks occasionally, but it's not broken
And it hasn't been for some time now
It won't ruin your resource if it breaks either, if it breaks it'll only disable itself meaning your resource will only be a little slower
In the past I have used multiple different low values and not ran into any issues (server with +40 players) and noticed that in most cases using 0 as a wait will cause more issues in terms of fps loss.. Regardless of if you have a s*** pc or a god tier pc I don't think 2 frames are going to cause any issues.
Granted most of these issues was back when I used esx.. way before legacy was released but still maybe I'm using ancient tech đź‘€
Thanks for the explanation I will also add experimental fxv2 now I know it wont completely render the script useless if it disables itself!
noticed that in most cases using 0 as a wait will cause more issues in terms of fps loss
2ms can't make that difference unless you're doing things you shouldn't be doing every frame
And also, where you visibly notice 2ms is when you draw text on your screen
But still, you don't want to be skipping frames
It's literal advice from cfx, never do a Wait(2) unless you're doing something like an animation with alpha reducing like I did here https://github.com/BerkieBb/CircuitBreakerMinigame_lua/blob/5165ef54160274b578d6d700bc4633ff06f079a7/cursor.lua#L48-L49
That's 20, but still
Ive actually been up to wait(7) multiple times while drawing text on screen and with all the players I have uncounted no one of them have had issues with it?
you cant say calling something every 2 frames over 0 frames wont impact performance because that's just facts
The loops getting called to go through stuff such as the entire inventory for esx users which if they have 200+ items its going to cause more issues for performance.
But I appriciate your suggestion
The loops getting called to go through stuff such as the entire inventory for esx users which if they have 200+ items its going to cause more issues for performance.
This is exactly what you shouldn't do every frame
yes hence why it don't do that.. Idk why I just said that actually lmao
And you can go upto Wait(7) on the average machine yeah, but outside of that people get affected by less and less the more you go one direction
I got lost in my own train of thought there
but still wait(0) and wait(2) have 0 effects for me and every player I have ran into
One direction as in either to worse or better pc, as I said I forgot which one it was but I'm thinking better pc
In this case, you're looping a native that needs to be run every frame, hence why I'm saying you need to change it to 0
Internally it requires it to be 0, otherwise it doesn't function as it's supposed to
You may not visibly notice as it's internal
It wont have any affect changing it to 0 for this script anyway as its already so lightweight my worry was the more shit you add to the pile in terms of resources like this the more performance issues people will have later on.
Yes its only 2 frames difference but that could make all the difference out there for someone on a potato machine.
And since it has 0 issues so far if I run into issues with it in the future I'll be the first thing I look at thanks to this conversation!
I'm trying to teach you that it doesn't have performance loss in this case, as what you're doing in the loop is almost nothing
You need to understand what the difference is between expensive natives and cheap natives (expensive and cheap meaning the amount of performance it takes)
A computer can handle more than you think in this case
Even a potato
I've been doing this for 4 years and had no issues buddy I appreciate it I do but I'll always look out for the little guys
I've been doing this for 5 years and have experimented with all kinds of pcs, high end low end, mid end
I've learned it when I was 2 years in and have studied it ever since
A computer can handle a ton, but when a requirement is there, you adhere to it to avoid issues even if you don't notice the issues visibly
As stacking up issues can cause visible issues
In this case the stacking issue is the frames it skips
When it requires to not skip any frames for SetPedMoveRateOverride
okay how about we meet half way and I set it to wait(1)?
I told you it requires it to run every frame, that's not every frame as it waits 1 millisecond
All Wait(0) does is make sure the loop acknowledges the frames and runs within them
Without a Wait it runs on your systems frames which move faster than the game and will make you crash
yes I have had my fair share of forgetting waits in loops in the past.. I do enjoy a good crash sometimes.
What if I set it to 0.5?
I don't think you can do that and that still makes it wait if it works
It has to be 0
Otherwise it's not running every frame occasionally
Wait requires an integer aka a round number so you can't put in a float according to the docs
I pushed a update for Wait(0) now anyway.
I was just joking with the (set it to 1 meet half way) joke but it seems you did not understand.
Thanks for the insight buddy
BuddyB
Dang it that flew right over my head

I am too serious about teaching people sometimes
Keep it that way you're the best
Closing post, heated discussion

Capped at 90fps, with 10ms wait. Slight and barely flickers. Alt tabbed capped at 50fps. No stutters.
190fps, constant flickering with 10ms wait
5ms wait
Even slight flickering at 4 and 3
Save too say and this has been debunked many times before, adding a wait of 2ms doesn't do anything really @low nest 
4 years experience btw
stupid comment btw
Just like your comments have been in this entire thread. SHows you have no clue what you're talking about
Nice, If u want a argument go talk to ur kids and wife that u abuse you animal.

A gay man does not have a wife and kids
let me know if you find them tho
ah makes sense why your toxic then dont it, Stop talking you muppet and go to bed
Im toxic because Im gay?
bit homophobic dont you think?
Your toxic because your being toxic.
interesting
your gay because your gay
u wanted a argument little man
shame you don't have anything better do to with your time.
Adios gay boy
Why you have to say "gay boy"?
You trying to use "gay" as a negative term?
Yes, its a less offensive way to say the f word 
Should of spend the 4 years of developing to evolve as a human being 

Watch out, if you’re not careful he’ll call you toxic and tell you to go home to your wife and kid and abuse them
lmao hes gay I better take his side even though hes running in here being toxic to people whos trying to help out the community!
Wow nice one buddy get a grip 🤣
Full of backwards monkeys in here I can see, Cya 🤣
Bro I took no side just didn't want to see someone clearly be homophobic? and I am the bad one?
Jeez this guy really wasted 4 years of developing