[Include] DRCMD - Fast and easy command process!
#9

Код:
#if defined _drcmd_included
        #endinput
#endif
#define _drcmd_included
 
#define DRCMD:%1(%2,%3) \
                forward drcmd_%1(%2,%3); \
                public drcmd_%1(%2,%3)
 
#define DRCMD_%1(%2,%3) \
                DRCMD:%1(%2,%3)
 
#define drcmd(%1,%2,%3) \
                DRCMD:%1(%2,%3)
               
#define CMD:%1(%2,%3) \
                DRCMD:%1(%2,%3)
 
#define COMMAND:%1(%2,%3) \
                DRCMD:%1(%2,%3)
 
#if !defined isnull
        #define isnull(%1) \
                                ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
 
#if defined FILTERSCRIPT
public
        OnFilterScriptInit()
#else
public
        OnGameModeInit()
#endif
{
        #if defined FILTERSCRIPT
                if(funcidx("OnFilterScriptInit") != -1)
                    return CallLocalFunction("OnFilterScriptInit", "");
        #else
            if(funcidx("OnGameModeInit") != -1)
                return CallLocalFunction("OnGameModeInit", "");
        #endif
        return 1;
}
#if defined FILTERSCRIPT
        #if defined _ALS_OnFilterScriptInit
            #undef OnFilterScriptInit
        #else
            #define _ALS_OnFilterScriptInit
        #endif
        #define OnFilterScriptInit drcmd_OnFilterScriptInit
        forward drcmd_OnFilterScriptInit();
#else
        #if defined _ALS_OnGameModeInit
            #undef OnGameModeInit
        #else
            #define _ALS_OnGameModeInit
        #endif
        #define OnGameModeInit drcmd_OnGameModeInit
        forward drcmd_OnGameModeInit();
#endif
 
 
public OnPlayerCommandText(playerid, cmdtext[])
{
        new
                function[32],
                szokozmeddig = -1;
        while(++szokozmeddig < strlen(cmdtext)) if((cmdtext[szokozmeddig] == ' ')) break;
        strmid(function, cmdtext, 1, szokozmeddig);
        format(function, sizeof(function), "drcmd_%s", function);
        while(cmdtext[szokozmeddig] == ' ') szokozmeddig++;
        if(funcidx(function) != -1)
        {
                if(szokozmeddig == strlen(cmdtext))
                {
                        return CallLocalFunction(function, "is", playerid, "\1");
                }
                return CallLocalFunction(function, "is", playerid, cmdtext[szokozmeddig]);
        }
        return 0;
}
 
#if defined _ALS_OnPlayerCommandText
    #undef OnPlayerCommandText
#else
    #define _ALS_OnPlayerCommandText
#endif
#define OnPlayerCommandText drcmd_OnPlayerCommandText
forward drcmd_OnPlayerCommandText(playerid, cmdtext[]);
This is mine code. And i don't copied anything from zcmd -.-
Reply


Messages In This Thread
DRCMD - Fast and easy command process! - by Drake1994 - 27.01.2012, 13:41
Re: DRCMD - Fast and easy command process! - by Lorenc_ - 27.01.2012, 13:44
Re: DRCMD - Fast and easy command process! - by Drake1994 - 27.01.2012, 13:46
Re: DRCMD - Fast and easy command process! - by Lorenc_ - 27.01.2012, 13:47
Re: DRCMD - Fast and easy command process! - by Drake1994 - 27.01.2012, 13:48
Re: DRCMD - Fast and easy command process! - by Drake1994 - 27.01.2012, 14:46
Re: DRCMD - Fast and easy command process! - by Drake1994 - 09.03.2012, 13:30
Re: DRCMD - Fast and easy command process! - by System64 - 09.03.2012, 17:30
Re: DRCMD - Fast and easy command process! - by Drake1994 - 09.03.2012, 18:33
Respuesta: DRCMD - Fast and easy command process! - by Kurama - 10.03.2012, 05:21
Re: DRCMD - Fast and easy command process! - by Drake1994 - 10.03.2012, 05:48
Re: DRCMD - Fast and easy command process! - by Reklez - 10.03.2012, 05:56
Re: DRCMD - Fast and easy command process! - by Ballu Miaa - 10.03.2012, 06:17
Re: DRCMD - Fast and easy command process! - by Drake1994 - 10.03.2012, 07:22
Re: DRCMD - Fast and easy command process! - by System64 - 10.03.2012, 08:45
Re: DRCMD - Fast and easy command process! - by Drake1994 - 10.03.2012, 09:13
Re: DRCMD - Fast and easy command process! - by Danee - 10.03.2012, 09:32
Re: DRCMD - Fast and easy command process! - by Chaster - 10.03.2012, 09:46
Re: DRCMD - Fast and easy command process! - by System64 - 10.03.2012, 10:17
Re: DRCMD - Fast and easy command process! - by Drake1994 - 10.03.2012, 10:20
Re: DRCMD - Fast and easy command process! - by System64 - 10.03.2012, 10:32
Re: DRCMD - Fast and easy command process! - by Drake1994 - 10.03.2012, 11:07

Forum Jump:


Users browsing this thread: 2 Guest(s)