-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE REQUEST] set_hudmessage add missing parameters #981
Conversation
plugins/include/amxmodx.inc
Outdated
| * | ||
| * @noreturn | ||
| */ | ||
| native set_hudmessage_ex(red = 200, green = 100, blue = 0, alpha = 0, red2 = 255, green2 = 255, blue2 = 250, alpha2 = 0, Float:x = -1.0, Float:y = 0.35, effects = 0, Float:fxtime = 6.0, Float:holdtime = 12.0, Float:fadeintime = 0.1, Float:fadeouttime = 0.2, channel = -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this new native needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed because we will have more flexibility on how hudmessages are displayed, so we can create more cool effects on them. (wondering why that value is hardcoded)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can extend the old native. Add parameters like "alpha1 = 255, color2[4] = {0, 0, 0, 0}" (or whatever the defaults should be for backward compatibility).
In the native, you can figure out the number of parameters passed by doing:
cell num_params = params[0] / sizeof(cell);
Then, if num_params >= 13 (the new count), you can safely extract the additional values. This will make the new signature work with old .amxx files as well as old scripts using the new include.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
Thanks! LGTM |
|
@dvander |
|
@dvander Glad they are merging this, but bad at the same time because I did a pull request for the same thing a long time ago but still didn't get any attention. I guess my only criticism is that this repository requires more active mainteners to avoid these situations. |
|
Sorry that got missed. Feel free to ping me if you want a review on something. I can't guarantee I'll see or get to everything though, especially for things that I don't know anything about. |
|
@dvander Okay, thanks! |
Same as alliedmodders#981 Co-Authored-By: Franco Romaniello <romax.cs@gmail.com>
Same as #981 Co-Authored-By: Franco Romaniello <romax.cs@gmail.com> Co-authored-by: Franco Romaniello <romax.cs@gmail.com>


Related to pull request #628 and #980 add set_hudmessage_ex with the missing params but for branch 1.9-dev