• Help making a progress bar for my DarkRP money printers
    3 replies, posted
Hello everyone I was wondering if any of you kind fellas could point me in the direction of making a progress bar that will be displayed on my money printers for DarkRP the way I want it to work is that a progress bar will be displayed and will load to 100% for when the printer will print money then reset back to 0% once the money has been printed.. Its probably something simple that I just cant see or have learned yet
I'm going to assume basic lua knowledge, so instead lets break down all of the prerequisites you'll need to get that to work. You're going to have to be able to determine what "progress" is, whether that's a variable that's increasing every few seconds, or the time until the next money print will be. I'm going to assume this is the case. Because this is something that will be rendered on the player's screen, that means it will need to be client-side. So you're going to have to find a way for the player's client to know what the current progress is. You need to actually draw your progress bar somehow. I'm going to assume you want to go for the DarkRP 3d2d look, so you'll have to research and apply the functions that make that work. Here are my recommendations on what you should do. every-time a money printer prints money, server-side you should set a networked variable on it called "lastPrint" or something along those lines tot he current time. Then, you can create a Shared ENT:GetProgress() function (in shared.lua of the entity) so that it can be used by the server and the client. the function will determine the current progress based on the time since the last print, the current time the function is called at, and the time it takes to print. From there, you've solved the first two requirements because this function can be used from the client because it's shared and uses Networked Variables. After that, have a look at cam.Start3D2D for drawing the progress bar which will use the self:GetProgress() function Take a look at these functions aswell. Entity/SetNWInt setting networked numbers CurTime getting the current time LocalToWorld offsetting the position of the 3D2D Good luck!
Thank you so much exactly what I was looking for!
Awesome! don't be afraid to put it up on WAYWO when you get it working, It would be cool to see.
Sorry, you need to Log In to post a reply to this thread.