[RELEASE] Badssentials (Your essential HUD script) (Revive/Respawn Script) {ALL IN ONE}

Documentation as well as updates to this resource have been moved to: Badssentials | Badger Docs

What is it?

Badssentials is essentially the most essential script you need. I saw multiple scripts split up and never saw a single script like this. I figured, I might as well make one, so I did. Badssentials includes AOP, PeaceTime, postal waypointing, and configurable placeholder watermarks! The amount of possibilities is endless with this script! Make sure you take a look at Screenshots to see what you can make with this!

Screenshots

https://i.gyazo.com/557c43a66a594cfda785ffeda51c8fc3.gif

Commands

/postal <code> - Sets your waypoint to this postal codeā€™s location

/postal - Cancels your waypoint

/aop <zone> - Sets the AOP to text you put in

/peacetime - Toggles PeaceTime on and off

/pt - Toggles PeaceTime on and off

/toggle-hud - Toggles your HUD on and off

Permissions

Badssentials.AOP - Gives permission to use the /aop command

Badssentials.PeaceTime - Gives permission to use both /peacetime and /pt command

Configuration

Check Documentation page for full configuration file [Was too big for here]

Essentially, you can add as many watermarks to this configuration that you want just by following the format of the previous ones. The placeholders all in this configuration can be used as well. Currently only EST time is supported, but there may be more coming in the future (pull request maybe please? lol)ā€¦

Download

Some code snippet credits (for some code) [also in case you just want separate scripts for this]:

@BigYoda ([Release] Area of Roleplay / Peacetime Display),

@lowheartrate ([Release] Street Label),

@BlockBa5her ([Release] Nearest Postal Script)

12 Likes

Any change to actually have a priority script included in this instead of the peace timer?

I could probably add the priority script in this as well. The whole point of this is to have like all of these scripts together and have placeholders to maximize customization ability. I will try to see if I can add it later today.

Iā€™m already kinda looking and it might be possible by changing the PEACETIME_STATUS block in the client.lua with the priority code snippet, adapted to your HUD

			if (disp:find("{PEACETIME_STATUS}")) then 
				if peacetime then 
					disp = disp:gsub("{PEACETIME_STATUS}", "~g~Enabled")
				else 
					disp = disp:gsub("{PEACETIME_STATUS}", "~r~Disabled")
				end
			end

to

			if (disp:find("{PRIORITY_STATUS}")) then 
				if ishold then 
					disp = disp:gsub("{PRIORITY_STATUS}", "~b~Priorities Are On Hold")
				elseif ispriority == true then 
					disp = disp:gsub("{PRIORITY_STATUS}", "~r~Active ~w~(".. name ..")")
				elseif cooldown == 0 then
					disp = disp:gsub("{PRIORITY_STATUS}", "~g~Inactive")
				elseif ispriority == false then
					disp = disp:gsub("{PRIORITY_STATUS}", "~r~Cooldown ~w~(".. cooldown .."m)")
				end
			end

If this works, go for it lol, just possibly make a fork on GitHub, so I can link your version getting rid of PeaceTime for the priority status instead. (Iā€™ll credit of course too)

I will try :slight_smile: Will keep you updated

Ok, if you check the fork, itā€™s updated for the priority now but it doesnā€™t reacts to the priority commands but I also need to look into the postal script because due to our CAD I need to use the nearest postal script from here and need to adapt that to the HUD as well

I had to adapt the Postal Script as well, it was actually really easy. Just had to change the line 56 in config.lua to match up with the Postal Code map I was using.

1 Like

That might take quite long in our case probably since we are using the new-postals-map from the nearest postal script

Iā€™m using the same one, do you want the code for it?

1 Like

Hi, very bad optimization.

It was actually a lot worse before, was up in like 4 ms. Iā€™m still looking into how to get it down further. If anyone has any solutions, they can pull request the GitHub for it. I got it staying under 1 ms for the most part right now. I think a lot of the math for cardinal directions really puts it up there. The MS was gonna be higher of course when I put multiple resources together though too, so it makes sense. Take a resource with .15 ms and put it with another .15, you get .30 ms. So ye, if anyone has any ideas on how to better optimize it, I am all ears.

NEW UPDATE
I just pushed a new update to the script on GitHub. I tested it with using all of the variables enabled on the display. It now gets up to a maximum of .30 ms, but stays around a steady .20 ms! Hopefully that is optimal enough, if not, hopefully someone else here can look into optimizing it even more. I do know a way to make it .15 ms or under, but then the {NEAREST_POSTAL_DISTANCE} kinda seems like it is lagging behind. If thatā€™s not a huge deal then I can inform you how to change that.

Best Regards,
Badger

3 Likes

For some reason my permissions is not working.

server.cfg
start Badssentials
add_ace group.moderator Badssentials.AOP allow
add_ace group.moderator Badssentials.PeaceTime allow

You may not being getting your permission group then. The permissions work fine, works on my server. You should probably look into if you are in the correct permission group.

You should just need to add:

add_ace group.moderator allow

Above:
add_ace group.moderator Badssentials.AOP allow
add_ace group.moderator Badssentials.PeaceTime allow

That should allow you to access the commands.

1 Like

Thank!

1 Like

NEW UPDATE
There is now /revive and /respawn commands included

Check out https://docs.badger.store/fivem-misc.-scripts/badssentials for more information!

NEW UPDATE
There is now a new death screen when someone dies!

Any thing you are able to salvage from my fork?