#1

Hey guys, can't get iZCMD to work..

Pasted the code from pastebin (cause there was no file download, only the code) into pawn and compiled, get a lot of errors. Not sure how I can fix it.. Could someone please send me a link to the .inc file if possible?

OR... how can I convert iZCMD back to ZCMD. The only reason I'm trying to download izcmd is because I'm getting an error in a filterscript "cannot read from file izcmd". If I could change it back, would it be quicker than fixing the other problem?

The code I'm pasting and compiling and saving as "izcmd.inc" in Pawn->Includes
pawn Код:
/**********************************
 *                                *
 *   @Author:      ZeeX           *
 *   @Version:     0.3.1          *
 *   @Released:    31/10/2009     *
 *                                *
 **********************************/


#if defined _zcmd_included
        #endinput
#endif
#define _zcmd_included

#define MAX_FUNC_NAME (32)

#define COMMAND:%1(%2)          \
                        forward cmd_%1(%2); \
                        public cmd_%1(%2)

#define CMD:%1(%2) \
                        COMMAND:%1(%2)

#define command(%1,%2,%3) \
                        COMMAND:%1(%2, %3)

#define cmd(%1,%2,%3) \
                        COMMAND:%1(%2, %3)

#if !defined isnull
        #define isnull(%1) \
                                ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif


forward OnPlayerCommandReceived(playerid, cmdtext[]);
forward OnPlayerCommandPerformed(playerid, cmdtext[], success);


static
        bool:zcmd_g_HasOPCS = false,
        bool:zcmd_g_HasOPCE = false;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
        zcmd_g_HasOPCS = funcidx("OnPlayerCommandReceived") != -1;
        zcmd_g_HasOPCE = funcidx("OnPlayerCommandPerformed") != -1;
    return CallLocalFunction("zcmd_OnFilterScriptInit", "");
}

#if defined _ALS_OnFilterScriptInit
    #undef OnFilterScriptInit
#else
    #define _ALS_OnFilterScriptInit
#endif
#define OnFilterScriptInit zcmd_OnFilterScriptInit
forward zcmd_OnFilterScriptInit();

#else /*not a filterscript*/

public OnGameModeInit()
{
        zcmd_g_HasOPCS = funcidx("OnPlayerCommandReceived") != -1;
        zcmd_g_HasOPCE = funcidx("OnPlayerCommandPerformed") != -1;
        if (funcidx("zcmd_OnGameModeInit") != -1)
        {
                return CallLocalFunction("zcmd_OnGameModeInit", "");
        }
        return 1;
}

#if defined _ALS_OnGameModeInit
    #undef OnGameModeInit
#else
    #define _ALS_OnGameModeInit
#endif
#define OnGameModeInit zcmd_OnGameModeInit
forward zcmd_OnGameModeInit();

#endif /*if defined FILTERSCRIPT*/

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (zcmd_g_HasOPCS && !CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
    {
        return 1;
    }
    new
        pos,
        funcname[MAX_FUNC_NAME];
    while (cmdtext[++pos] > ' ')
        {
                funcname[pos-1] = tolower(cmdtext[pos]);
        }
        format(funcname, sizeof(funcname), "cmd_%s", funcname);
    while (cmdtext[pos] == ' ') pos++;
        if (!cmdtext[pos])
        {
                if (zcmd_g_HasOPCE)
                {
                        return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, "\1"));
                }
                return CallLocalFunction(funcname, "is", playerid, "\1");
        }
        if (zcmd_g_HasOPCE)
        {
                return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, cmdtext[pos]));
        }
        return CallLocalFunction(funcname, "is", playerid, cmdtext[pos]);
}

#if defined _ALS_OnPlayerCommandText
    #undef OnPlayerCommandText
#else
    #define _ALS_OnPlayerCommandText
#endif
#define OnPlayerCommandText zcmd_OnPlayerCommandText
forward zcmd_OnPlayerCommandText(playerid, cmdtext[]);
The errors:
Код:
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(62) : warning 235: public function lacks forward declaration (symbol "OnGameModeInit")
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(64) : error 017: undefined symbol "funcidx"
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(65) : error 017: undefined symbol "funcidx"
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(66) : error 017: undefined symbol "funcidx"
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(68) : error 017: undefined symbol "CallLocalFunction"
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(83) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandText")
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(85) : error 017: undefined symbol "CallLocalFunction"
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(94) : error 017: undefined symbol "tolower"
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(96) : warning 217: loose indentation
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(96) : error 017: undefined symbol "format"
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(96) : warning 202: number of arguments does not match definition
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(96) : warning 202: number of arguments does not match definition
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(96) : warning 202: number of arguments does not match definition
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(97) : warning 217: loose indentation
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(98) : warning 217: loose indentation
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(102) : error 017: undefined symbol "CallLocalFunction"
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(104) : error 017: undefined symbol "CallLocalFunction"
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(108) : error 017: undefined symbol "CallLocalFunction"
C:\Users\Logan\Desktop\AZRP\pawno\include\izcmd.pwn(110) : error 017: undefined symbol "CallLocalFunction"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


11 Errors.
Reply
#2

Include a_samp first and then any other include. What you are saving as izcmd is the old zcmd by the way.
Reply
#3

Thank you! My only problem is...
Any script I try to compile now is giving me an a_actor error on line 1, but theres nothing there? lol
Код:
C:\Users\Josh\Desktop\AZRP\pawno\include\a_actor.inc(1) : error 010: invalid function or declaration
Reply
#4

I think it may be a problem with one of my include files?
Reply
#5

Fixed! Just redownloaded the pawn folder with all the includes
Reply
#6

Quote:
Originally Posted by Josh_Main
Посмотреть сообщение
The code I'm pasting and compiling and saving as "izcmd.inc" in Pawn->Includes
You don't compile includes, you just place them in the includes file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)