-
Notifications
You must be signed in to change notification settings - Fork 9
Lots of fixes and improvements #98
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
Conversation
also returned SetPlayerDisabledWeapons deprecation, many fixes to string length return in functions
and add a couple of earlier unimplemeted functions
No more "Sorry, but [native] is not implemented" when the server start, now all dummies are included and some of previously unimplemented dummies are implemented into working functions
and also new natives from MTA in a_amx.inc
by changing them to native bit* functions
obtain announce and lanmode correctly
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 have reviewed and tested the changes, and overall, they look good. I have left a few comments on some code I'd like to see adjusted.
For future PRs, it would be helpful if they were broken down a little bit more. This makes the review process more efficient for the person that has to go through it. I also noticed a couple of redundant elements, which add unnecessary noise to the review (I commented on those so said things can be avoided in the future).
Overall, creating smaller PRs makes it easier to spot issues and revert changes when needed, while also allowing other contributions to be merged more quickly. As the saying goes, it’s best not to put all your eggs in one basket.
Have a great weekend and thanks for your awesome contribution! 😊
spawnPlayerBySelectedClass(player) | ||
--In samp calling TogglePlayerSpectating also unsets camera interpolation | ||
clientCall(player, 'removeCamHandlers') | ||
setElementAlpha(player, 255) |
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.
Up above we're disabling all controls when spectating, but never re-enabling them.
I also add PLAYER_STATE_NONE
to mirror OpenMP's behavior to some degree.
setElementAlpha(player, 255) | |
setElementAlpha(player, 255) | |
toggleAllControls(player, true, true, false) | |
setPlayerState(player, PLAYER_STATE_NONE) |
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.
We're actually enabling all player controls when he is spawned unconditionally (here), since SA-MP does it as well (you can freeze a player even directly with TogglePlayerControllable and he will be unfrozen after spawn anyway, so I replicated this behaviour). I can add some comment inside TogglePlayerSpectating to make it more clear because it can look like we really forgot about it.
As for setting state none when leaving spectate like in omp, it is actually a critical behaviour difference with SA-MP server and I reported about it there with reasons why. I suppose they did it to bypass some other issue, but created a new one.
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.
We're actually enabling all player controls when he is spawned unconditionally (here), since SA-MP does it as well (you can freeze a player even directly with TogglePlayerControllable and he will be unfrozen after spawn anyway, so I replicated this behaviour). I can add some comment inside TogglePlayerSpectating to make it more clear because it can look like we really forgot about it.
As for setting state none when leaving spectate like in omp, it is actually a critical behaviour difference with SA-MP server and I reported about it there with reasons why. I suppose they did it to bypass some other issue, but created a new one.
I agree on your points, but the current logic assumes we only spectate during one specific stage. It won't unfreeze the player or re-enable their controls if we for example say, behave as an administrator in a server and spectate a vehicle or player using TogglePlayerSpectating
. When we're done spectating we will be frozen in place.
if g_Players[playerID].doingclasssel then | ||
return | ||
end |
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.
If we're spectating don't send an event to show the UI. I believe this is what SA-MP does and it mirrors my gamemode's behavior in SA-MP (I tested this).
if g_Players[playerID].doingclasssel then | |
return | |
end | |
if g_Players[playerID].doingclasssel or g_Players[playerID].state == PLAYER_STATE_SPECTATING then | |
return | |
end |
I will merge this, in the future do please break down your PRs, I can't stress that enough. Do multiple PRs (Pull Requests) if needed so it gets easier to review. Thanks! 😊 |
Thank you for merge, sure. As for class selection logic and your latest fixes, I'll try to test it further and probably make a new PR with final improvements and solutions for it since yesterday I got stuck with some of MTA AMX specific features (namely Also about some stale issues which seems not relevant anymore and probably could be closed with "Solved" label: #63, #33, #20, #15 and #4 |
GetConsoleVarAs*
pawn natives) updated for actual SA-MP 0.3.7 version list. They now also sync with MTA config settings where it's possible (where they fully match, like MTA'sase
-> SA-MP'sannounce
) and integrated with meta.xml or settings.xml, which means you can obtain any custom config variables from those config files withGetConsoleVarAs*
functions (if a console variable isn't found in default variables list, it will try to get it from config files). New ACL right requests for "function.getServerPassword" and "function.setServerPassword" were added because more rcon variables (includingpassword
) were implemented, and it's now also noted in README.mdscoreboard
default resource which is now correctly validated if it's running and only then it's used)getNetworkStats
info)~g~
,~r~
,~y~
etc)WEAPONSTATE_RELOADING
when actual reloading (#82)getPedRotation
function, moreover doing it incorrectlybinor
,binand
,binshr
andbinshl
replaced with built-in and more relevant bitOr, bitAnd, bitRShift and bitLShift