Skip to content
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

Split vote code in different files instead of filling ag.sma code #39

Open
rtxa opened this issue Aug 6, 2024 · 0 comments
Open

Split vote code in different files instead of filling ag.sma code #39

rtxa opened this issue Aug 6, 2024 · 0 comments

Comments

@rtxa
Copy link
Owner

rtxa commented Aug 6, 2024

We can use pawn #include feature like other plugin developers did. Examples:

https://github.com/SmileYzn/PugMod/blob/master/addons/amxmodx/scripting/PugMenus.sma

https://github.com/leobrines/pug_for_cs

https://github.com/SmileYzn/MatchBot/blob/main/MatchBot/MatchVoteMenu.h

More info at https://forum.open.mp/showthread.php?tid=2192

How to use

To split votes in differents files, we need to add in agmodx.sma
#include <agmodx/votes> and create a file named votes

Drawbacks

We loss syntax highlighting and obfuscates what functions or variables the votes are using, no way to locate the references without adding support to AMXXPawn by Klippy. In that case, it would be better to add a new plugin named agmodx_votes.sma, it would be more intuitive and easy for other scripters to look at.

Bonus: Pseudo-members

#if __COMPILER_MODIFIED
    #define this,) this)
    #define Object::%0(%1) Object_%0(Object:this,%1)
#else
    #define Object::%0(%1) Object.%0(%1)
#endif
@rtxa rtxa added this to AG Mod X Jul 20, 2024
@rtxa rtxa converted this from a draft issue Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Not Started
Development

No branches or pull requests

1 participant