-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Add menu_getprop() function #507
base: master
Are you sure you want to change the base?
Conversation
Update to latest dev build
Thanks for contributin, but just a word when you create a PR:
|
Thanks. I'll have this in mind for my next PR. I added the required description, but I'm not sure if I can remove the unrelated changes. Guess it's happening because I was doing it directly from Github rather than using Git on Desktop. |
Do you have any usage/situation/context example in mind? |
@Arkshine A good example would be when using the |
Checking by title or others properties doesn't look reliable for me. Not the best example I would say. Do you have another concrete & useful usage? |
an usefull use is when you need to remember the players current page, somthing like this :
|
amxmodx/newmenus.cpp
Outdated
{ | ||
GETMENU(params[1]); | ||
|
||
int len = params[0] / sizeof(cell); |
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.
len
is not really a good variable name. It could be numParams
or count
or something like that.
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.
@Arkshine Done.
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.
Would be nice to put the native header as comment above and using an enum as you did in others PRs.
Also, using brace everywhere.
@Arkshine Done. |
We should avoid natives which are not type-safe. |
@Arkshine Since |
@Arkshine BUMP |
Did you test properly? |
@Arkshine - pretty sure I did, if I recall correctly. The code is very straight forward. Not sure how to compile the modules anymore so I can test again. The tutorial from the forum doesn't seem to work after the 1.10 updates. |
This native is something that was requested many times, even by myself. The goal is to be able to get all values that are set with the
menu_setprop
function.Discussed here - https://forums.alliedmods.net/showthread.php?t=303560