Jump to content

[REL] weaponhud


Ransom

Recommended Posts

DOWNLOAD ON COMMUNITY: https://community.multitheftauto.com/index.php?p= ... ls&id=1777

This is a customizable weapons HUD. Its purpose is to add shortcuts to your weapons and to display them all at the same time on your HUD.

Features include:

*Bind any key as a weapon slot shortcut, including alt, ctrl, shift key modifiers. (NOTE: THE DEFAULT SHIFT+2 MAY NOT WORK ON NON-USB KEYBOARDS!)

*Color your binds and ammo displays

*Choose text fonts

*Stylize texts with shadows or borders

*Position binds and ammo manually

*HUD X,Y positioning

*Show, fade after X seconds, or completely hide the HUD

*Traditional or weapon model style icons

*Row or column orientation

*Set the number of rows or columns

*Icon X,Y size

*Text size for binds and ammo

*Show/hide binds & ammo

*Show/hide empty slots

*Replace GTA HUD icons with weapon models

*Highlight equipped slot

*Cancel, Restore Defaults, and Save buttons. Saved settings are stored clientside and will be recalled if the user has saved the settings, no matter what server they are on.

Holding tab and then pressing enter will take you to the configuration screen. The purpose here is to remind users they can configure the HUD whenever they use the scoreboard, which is TAB by default.

License: http://creativecommons.org/licenses/by-nc-nd/3.0/

In short: You may use this script but you may not edit or build upon it. I may change this later on. For now it is protected.

Special thanks to:

Kayl - GUI Maker (viewtopic.php?f=91&t=27739)

Ryden - Color Picker (Part of MTA map editor)

Talidan - Textlib code for shadowing and borders on text (viewtopic.php?f=108&t=24262) and his wonderful scripting ethics :P

QA Team - Scrutiny, Suggestions and Testing

3524.png

3521.png

3522.png

3525.png

3523.png

Link to comment
Wow, now that's a combat improvement. 8)

And, did you work with someone, what is that license?

Creative commons is just an easy way to put on a license without having to write it yourself. It has a full licensing contract being the basics presented on that link.

Its all my own code aside from the assistance I mentioned in special thanks. Talidan helped eliminate my bad scripting practices. :P I started designing this around Nov. 2010, its been a long WIP.

Link to comment
Thanks!

Why do you need to protect that script btw?

Because I don't want someone to steal it or modify it? I may do further work on it and I don't want spin-offs. There is a lot of resource theft going on. There isn't much to be added onto it either so no reason not to. I know some people probably want to learn from my script, but its pretty confusing and about 1,500 lines.

Link to comment
ohh... Alright then.

Well that's one advanced script you got there. Must have done lots of work.

Some of it is unfactored code, meaning I have some parts that are unnecessarily spammed several times over instead of feeding everything into a function. Mostly this occured on my GUI logic, because I just lacked any experience with it. It was difficult to refactor as I overhauled the GUI design a few times after using the GUI generator, eg:

http://img522.imageshack.us/img522/8299/uthudgui.jpg

http://img710.imageshack.us/img710/4413/inputworks.png

http://img441.imageshack.us/img441/2918/failedi.jpg

http://img822.imageshack.us/img822/5163/capturege.png

Anyway, that is why I don't want people to look at it as a good script to learn from, next time I can do better since I learned some things. As a general tip I have learned: try to plan your GUI as well as possible and script it minimally to try and find the final design. Always get a 2nd and 3rd opinion also. Proof of concept is important! The other thing I would say is if you find yourself repeating pieces of script over and over, you really need to stop and think about a better and easier way of doing things using tables and central functions.

Link to comment

It's similar to my HUD concept and its progress. I just try as simple, then later adding weapon icons, ammo, and so on :)

I had many more ideas, but my newbie scripting capabilities makes my ideas blocked. :(

You ara great scripter, you're capable of many things. That is the reason you were able to make such script.

I should learn more. Only I was able to be as experienced as you are, my script would be much more complex.

Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...