Skip to content

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

@rtxa

Description

@rtxa

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Not Started ⏱

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions