Pragma unused (zcmd question)
#10

Quote:
Originally Posted by Kilou
Посмотреть сообщение
STRCMP:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/mycommand", cmdtext, true)==0)
    {
        //Lol
        return 1;
    }
    return 0;
}
ZCMD:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    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]);
}

COMMAND:mycommand(playerid, params[])
{
    //lol
    return 1;
}
So you're wrong.
You don't know what you're talking about.. zcmd and ycmd is far more better AND faster than strcmp..
And what's all that in OnPlayerCommandText !? I do
pawn Код:
CMD:mycommand(playerid, params[])
{
    //code
    return 1;
}
And my OnPlayerCommandText only have a spam checker..
Reply


Messages In This Thread
Pragma unused (zcmd question) - by Tanush123 - 06.02.2012, 01:13
Re: Pragma unused (zcmd question) - by Buzzbomb - 06.02.2012, 01:43
Re: Pragma unused (zcmd question) - by 2KY - 06.02.2012, 01:48
Re: Pragma unused (zcmd question) - by Tanush123 - 06.02.2012, 02:42
Re: Pragma unused (zcmd question) - by jamesbond007 - 06.02.2012, 02:49
Re: Pragma unused (zcmd question) - by iPLEOMAX - 06.02.2012, 05:15
Re : Pragma unused (zcmd question) - by Kilou - 08.02.2014, 17:14
Re: Pragma unused (zcmd question) - by AndreT - 08.02.2014, 17:26
Re : Pragma unused (zcmd question) - by Kilou - 08.02.2014, 17:50
Re: Re : Pragma unused (zcmd question) - by Don_Cage - 08.02.2014, 18:19

Forum Jump:


Users browsing this thread: 1 Guest(s)