Skip to content

Improvements and fixes #102

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

Merged
merged 36 commits into from
May 21, 2025
Merged

Conversation

NexiusTailer
Copy link
Contributor

@NexiusTailer NexiusTailer commented May 15, 2025

This pull request implements a few missed functions and fixes some minor issues here and there.

  1. Many corrections and improvements to special actions. Every special action now can be stopped by pressing Enter key and doesn't apply if the player is in vehicle; animations of most special actions set to the same ones as in SA-MP.
  2. Improved amx resource structure by splitting all images into their own folder. This is done like in other MTA resources which come with MTA server.
  3. Implemented PlayerPlaySound, SFX offsets for "script" container were taken from here.
  4. Implemented OnPlayerClickMap which means now there is an ability to put map waypoint (target blip) on the F11 world map.
  5. Added frontend sounds across the systems: when you click on ">>" and "<<" in class selection, choose an item or close menu created with CreateMenu, set or remove map waypoint. The sounds completely matches those which used in SA-MP in all those mentioned systems.
  6. Implemented DisableInteriorEnterExits. All this actually do is stopping the interiors resource which in turn implements enter/exit markers from singleplayer. Added a note into the readme file about that you should have interiors resource to use enex markers, and only then DisableInteriorEnterExits will "disable" them.
  7. Fix for possible errors in GetPlayerCameraFrontVector related to arithmetics on nil value (#99).
  8. Zone names now properly work if they are enabled with EnableZoneNames, but disabled by default like in SA-MP.
  9. Implemented DisableNameTagLOS and SetNameTagDrawDistance functions.
  10. Many corrections and improvements for nametags. Now it's correctly colored according to the player color and also works again for peds (bots) like they worked initially, judging by commits history.
  11. GameModeExit will now work even if mapcycler and votemanager resources aren't running.
  12. All debug messages into client and server console which are not errors (but just debug prints left from implementing and testing) are commented out like the rest of similar messages.
  13. SendDeathMessage and SendDeathMessageToPlayer now actually works, calling killmessages resource events (previously there was just a stub with a comment to use killmessages resource by yourself, but now it has a real integration). A note is also added into the readme file. Also solves #30.
  14. OnPlayerGive/TakeDamage are re-implemented and now client event is taken as a base for those SA-MP callbacks, since onClientPlayerDamage gives much more precise loss values for damage amount thus fully matches SA-MP behavior.
  15. Added some new functions into a_amx.inc: blended weather, rain level, fog distance, occlusions related. Also added GetWeaponSlot and ForcePlayerMap/IsPlayerMapForced (script interaction with world map seems more justified now after OnPlayerClickMap was added).
  16. Better bots support across the systems logic. Mainly some vehicle checks are improved to consider bots in them as well as player occupants.
  17. AttachElementToElement from a_mta.lua, which probably was meant to be included in a_amx.inc as pawn native is removed. The reason is that it wasn't implemented on pawn side and actually cannot be, because it operates with two elements not IDs, so it hardly can be passed to a pawn native and look sane. Moreover, there is already everything needed to attach objects to objects, vehicles and players. SA-MP functionality is fully implemented in this matter by the separate natives (btw exactly all from #33, which is solved for this moment).
  18. Fixes for StopAudioStreamForPlayer: some sounds which has finished playing was passed into this function as not valid sound elements and thus produced some warnings.

for nametags, float parameters passed to callbacks and special actions
More correct content separation like in other MTA default resources
- added GetWeaponSlot into a_amx.inc
- implemented DisableNameTagLOS and SetNameTagDrawDistance
- fixed other bugs with nametags (returned back bots support)
in the most easy way possible
not considering whether they are generally enabled or not
as it gives precise loss values for damage amount
and also put in class selection only if it's allowed, like in other cases
if they are not errors
so that it's not needed to be duplicated in spectate function
@NexiusTailer
Copy link
Contributor Author

NexiusTailer commented May 15, 2025

Other updates which could be made on the side of repository itself (on wiki pages):

  1. Update "MTA:SA 1.0" to "MTA:SA 1.6" version in INSTALLATION.md article.
  2. In the same article, change string:
Extract the "mods" folder into your MTA "server" directory.

to

- All needed binary files are in the archive provided on Releases
  page. Unpack amx.zip and extract the `mods` folder into your MTA
  `server` directory.

- `amx` folder located in mods/deathmatch/resources is a place for the
  mentioned Lua resources. It will be empty at this point, so you need
  to copy all the latest files of `amx` folder from this repository
  into your `amx` folder.

to match the current readme file instructions.

UPD:

  1. In README.md-(draft) article, update this string:
- SA-MP server **plugins** work unmodified.

to

- SA-MP server **plugins** work unmodified, if they don't use memory hacking.
  1. In the same article, right after this string:
- You can **load plugins dynamically**, while the server is running. Use the `loadplugin` console command for this.

add

- There is no hard-coded max filterscript count, the **number of running filterscripts is unlimited**.

@colistro123
Copy link
Collaborator

Thanks so much for your contribution! I’ve had a quick look on my phone, but haven’t had much free time lately. I’ll review this in more detail soon 😊

Copy link
Collaborator

@colistro123 colistro123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this and it LGTM. Will test soon, thank you! 😊

@@ -40,7 +40,7 @@ Compatibility is quite high:
- Almost all SA-MP **scripting functions** and **callbacks** are
implemented.
- **Database** functions (`db_*`) are implemented.
- SA-MP server **plugins** work unmodified.
- SA-MP server **plugins** work unmodified, if they don't use memory hacking.
Copy link
Collaborator

@colistro123 colistro123 May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is very true, especially for plugins such as Pawn.CMD, which I had to modify for it to work on MTA by getting rid of the byte pattern lookup when compiling for such with a preprocessor macro 😅

Copy link
Contributor Author

@NexiusTailer NexiusTailer May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh Pawn.CMD is a very lite example of a plugin for which there are many non-memhacking replacements (zcmd, dc_cmd etc). Meanwhile there are really crucial memhack plugins which cannot be replaced and they kinda based today just to make any advanced functionality, like Pawn.RakNet. Sometimes I even think that similar tool would be useful for MTA as well (at least a module which would give ability to intercept incoming packets like bylletsync, unoccupied or other sync types serverside, making possible to additionally handle every single packet in your script).

Copy link
Collaborator

@colistro123 colistro123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works fine on my end. Merging, thank you!

@colistro123 colistro123 merged commit 3d4c32c into multitheftauto:develop May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants