-
-
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
Modernize admincmd.sma #567
base: master
Are you sure you want to change the base?
Conversation
|
It's funny calling Hungarian notation "modernizing". I like g_ for globals. Not a fan of hungarian though. Everything else, from the description (barely read the diff), seems good. |
What about |
@Arkshine I personally find prefixed variables easier to understand what and how they're used for. The variable type helps a lot in some situations, especailly when you have two separate variables for string and integer. Take for example the ban commands, they use a @WPMGPRoSToTeMa Yes, I can implement that too. |
In my mind hungarian notation make sense for global variables, for local variables you just write more code. https://github.com/Mistrick/MapManager/blob/ed09e4d78ab5c6cb617b2e37c06a08df2cea7648/mapmanager.sma#L1598 |
Anyways, we should decide which style to use. I see the style is mixed up in most of the plugins and I want to make it consistent. |
I can't find the example you're talking about, show me some code. |
Lines
|
This is not a good example, because here you could use directly new szMinutes[32];
read_argv(2, szMinutes, charsmax(szMinutes));
new iMinutes = str_to_num(szMinutes); new minutesArgument[32];
read_argv(2, minutesArgument, charsmax(minutesArgument));
new minutes = str_to_num(minutesArgument); The latter is easier to read and less confusing. |
@Arkshine I reverted the variable names. |
German translation is partially outdated, maybe you want to include possible changes from #620? |
@Daniele386 I'll do it when the PR gets merged. |
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.
@@ -91,10 +123,10 @@ PERM = für immer | |||
CLIENT_BANNED = Spieler "%s" gebannt |
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.
FOR_MIN = für %d Minuten
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's no param for %d in the .sma file.
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.
I thought at line 89?
In the other languages you changed %s to %d?
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.
Line 89 doesn't even have any %s/%d parameters.
I didn't change any %s to %d.
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.
Am I blind?
I'm talking about lines
- 89 (in your version line 121)
there is "%s"
and there are "%d":
- 12
- 164 (in your version line 196)
- 239 (in your version line 271)
- 314 (in your version line 346)
- 389 (in your version line 421)
- 464 (in your version line 496)
- 539 (in your version line 571)
- 614 (in your version line 646)
- 689 (in your version line 721)
- 764 (in your version line 796)
and so on...
But you haven't change the .sma in that point, have you?
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 are not blind. FOR_MIN
takes now an integer, so it should be %d
.
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.
I see, I thought you meant line 89 in my version. I'll do the changes soon.
The changes include:
read_argv_int
,get_players_ex
,create_cvar
, etc).%N
instead of%s<%d><%s><>
in log messages.%n
instead ofget_user_name
where possible.%l
instead of%L
where possible.