Skip to content

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

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from

Conversation

NexiusTailer
Copy link
Contributor

@NexiusTailer NexiusTailer commented Apr 29, 2025

  1. Many formatting fixes, bringing code style to a more consistent level based on how most of the code in the project has been formatted up to this point. Updated previously broken links (like here or here), correct spelling of SA-MP name everywhere where it's mentioned
  2. Fixes for many typos which were found with Lua linter, pretty critical examples are this, this or this
  3. A bit more clear explanation of installation in README.md according to the latest improvements on releases page
  4. Update min client version from 1.5.5-9.14060 to 1.6.0-9.22457 since some functions require it now, also update notes about it in README.md
  5. Significant improvements in RCON implementation: server variables (those which printed on "varlist" in the server console or obtained via 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's ase -> SA-MP's announce) and integrated with meta.xml or settings.xml, which means you can obtain any custom config variables from those config files with GetConsoleVarAs* 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 (including password) were implemented, and it's now also noted in README.md
  6. More consistent return values: if some function returns IDs starting from 0, invalid ID won't be "false" anymore (because false is anyway 0 in pawn), it uses more appropriate error return values instead. The same with bare 'return's which were presented in some places before, even considering that the function should return some specific value
  7. All functions which write strings in args by reference now return the string length which they just written, like SA-MP does. There is also improvements related to buffer size validation before it will write anything into it (early return if it's invalid; truncate string if it's less than needed and return the length of the final string written)
  8. Vehicles and objects start with ID 1 in SA-MP, while all other entities start with 0. Now objects follow this pattern as well as vehicles
  9. Implemented OnPlayerClickPlayer callback and fixed previously broken scoreboard functions (they depend on scoreboard default resource which is now correctly validated if it's running and only then it's used)
  10. Implemented OnPlayerWeaponShot and GetPlayerLastShotVectors
  11. Implemented OnPlayerGiveDamage, OnPlayerTakeDamage and OnPlayerGiveDamageActor
  12. Implemented OnVehicleDamageStatusUpdate callback
  13. Fixed OnPlayerDeath and OnBotDeath. killerid parameter can be only player type and now it's explicitly validated
  14. Fixed OnPlayerPickUpPickup callback, previously it didn't really work because of wrong event source
  15. CreatePlayerObject now has the same logic as CreateObject: if the object model was invalid (probably SA-MP object model passed), it will create an invisible dummy and throw a warning
  16. Fully completed PVar system and implemented SVar system
  17. Added all NPC functions as stubs/dummies (#16)
  18. Implemented GetPlayerVersion, GetGravity and GetPlayerTargetPlayer
  19. Bugfix in SA-MP classes system since the previous PR (there was an issue with spawning from class selection if pawn script didn't add any classes at all)
  20. Implemented GetNetworkStats and GetPlayerNetworkStats (based on MTA's getNetworkStats info)
  21. Implemented AttachCameraToPlayerObject, AttachObjectToObject and AttachPlayerObjectToVehicle (#33)
  22. Fixed gametext/textdraw color mapping, now all colors fully match GTA SA and SA-MP default colors (~g~, ~r~, ~y~ etc)
  23. GetVehicleParamsSirenState now returns whether a siren is added (as it should), and not the fact that it is currently toggled on
  24. Fixed SetPlayerArmedWeapon behaviour (previously it has wrongly taken weapon slot instead of weapon ID in it parameter)
  25. Implemented SetActorInvulnerable and IsActorInvulnerable
  26. Fixed IsValidActor which didn't work at all because of accessing to the wrong (objects) pool
  27. Implemented SetVehicleAngularVelocity (#60) and GetVehicleModelInfo (#88)
  28. Now ShowPlayerMarker has global/streamed mode toggler, and SetPlayerMapIcon has global/local style like in SA-MP. Mode "streamed" or style "local" is a feature to show marker or mapicon only if it's more or less near the player position (it's in his stream zone). Global mode will still show marker or mapicon for player not considering the distances
  29. MoveObject and MovePlayerObject now has support for object rotations
  30. Implemented IsObjectMoving and IsPlayerObjectMoving (#87)
  31. GetPlayerWeaponState now does return WEAPONSTATE_RELOADING when actual reloading (#82)
  32. ShowPlayerDialog now handles dialogid -1 and closes the current shown dialog for a player like SA-MP does
  33. Fixed GetPlayerWeaponData, now it correctly updates the weapons data once per second (if it changed). Previous behaviour of "update every 5 seconds" caused SA-MP script bugs as it was too big delay
  34. Implemented GetAnimationName (#83) and ApplyActorAnimation (#20)
  35. Fixed GetPlayerFacingAngle since it used deprecated getPedRotation function, moreover doing it incorrectly
  36. Implemented GetPlayerSurfingObjectID and GetPlayerSurfingVehicleID (#85)
  37. Implemented GetPlayerObjectModel and IsPlayerAttachedObjectSlotUsed
  38. Obsolete custom made functions binor, binand, binshr and binshl replaced with built-in and more relevant bitOr, bitAnd, bitRShift and bitLShift
  39. Implemented LimitPlayerMarkerRadius function (#15)
  40. ShowCursor has been renamed to ShowPlayerCursor on pawn side, since it's specifically player related (this is a more common naming pattern in SA-MP). Also, a counterpart has been implemented: IsPlayerCursorShowing
  41. SetScoreBoardData has been renamed to SetPlayerScoreBoardData on pawn side for the same reason
  42. Implemented additional db_ functions (#56) and improved parameter validations in existent ones
  43. Fixed return values ​​for GetWaveHeight and NetStats_PacketLossPercent (should've return float, although they returned int without proper conversion so it failed on the pawn script side)
  44. Added additional functions in a_amx.inc (from a_mta.lua) for players, vehicles and objects - mainly those which looks like were missed for some reason but still very useful
  45. Added additional functions in a_amx.inc (from a_mta.lua) for bots: (Add/Remove/Get)BotClothes, (Get/Set)BotInterior, (Get/Set)BotVirtualWorld, (Get/Set)BotSkillLevel, GetBotVehicleID, IsBotIn(Any)Vehicle, GetBot(Ammo/Weapon) to be a more substantial replacement for NPC/actors
  46. Glitches like 'quickreload', 'fastmove', 'fastfire', 'crouchbug', 'fastsprint' and 'quickstand' are now all enabled to be in line with SA-MP default gameplay
  47. World special properties like 'randomfoliage' and 'roadsignstext' are now disabled and 'snipermoon' is enabled to be in line with SA-MP default gameplay
  48. Ambient sounds of 'gunfire' type is now disabled to be in line with SA-MP default gameplay

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
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