Portal SAMP
[Tutorial] Macros - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Guias e Tutoriais (https://portalsamp.com/forumdisplay.php?fid=7)
+--- Tópico: [Tutorial] Macros (/showthread.php?tid=2770)



Macros - LouzinDS - 08/09/2022

[font=Consolas, "Courier New", monospace]<![/font]
Ola a todos  Big Grin

Código:
#define MAX_CARROS (10)
#define @public%0%1 forward %0(%1);\
                    public %0(%1)

enum pInfo {
    pAdmin,
    pOrg
}
new PlayerInfo[MAX_PLAYERS][pInfo];

#define User:%0(%1) PlayerInfo[%1][%0]

#if defined MAX_PLAYERS
    #undef MAX_PLAYERS
    #define MAX_PLAYERS 200
#endif

public OnPlayerUpdate(playerid)
{
   
    #if defined new_OnPlayerUpdate
        return new_OnPlayerUpdate(playerid);
    #else
        return 1;
    #endif
}

#if defined _ALS_OnPlayerUpdate
    #undef OnPlayerUpdate
#else
    #define _ALS_OnPlayerUpdate
#endif

#define OnPlayerUpdate new_OnPlayerUpdate
#if defined new_OnPlayerUpdate
    forward new_OnPlayerUpdate(playerid);
#endif
Hoje irei explicar um conteudo que e um pouco confuso para novatos, enfim, anexarei aqui um arquivo .html para voces abrirem em seu navegador e lerem o conteudo que escrevi sobre macros e defines...


RE: Macros - White_Blue - 08/09/2022

Ótimo tutorial! Irá ajudar muitos novatos na linguagem Pawn. +REP! Achei muito legal você ter desenvolvido uma página web para o tutorial.