Strcmp or ZCMD?
#10

How is

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/command", true))
    {
        // Code
        return 1;
    }
    else if(!strcmp(cmdtext, "/test", true))
    {
        // Code
        return 1;
    }
    return 0;
}
easier than

pawn Код:
CMD:command(playerid, params[])
{
    // Code
    return 1;
}

CMD:test(playerid, params[])
{
    // Code
    return 1;
}
?

And then you have params to deal with. It's also slower. So let's summarise:

STRCMP:
- Slow
- Worse parameter handling
- More 'complicated' to write (relative)

ZCMD:
- Much faster
- Easy parameter handling
- Extremely easy to write

You decide which is better. It's a tough one! (not.)
Reply


Messages In This Thread
Strcmp or ZCMD? - by Giroud12 - 12.05.2013, 15:09
Re: Strcmp or ZCMD? - by Windrush - 12.05.2013, 15:20
Re: Strcmp or ZCMD? - by Giroud12 - 12.05.2013, 15:21
Re: Strcmp or ZCMD? - by SchurmanCQC - 12.05.2013, 15:22
Re: Strcmp or ZCMD? - by Riddy - 12.05.2013, 15:23
Re: Strcmp or ZCMD? - by playbox12 - 12.05.2013, 15:31
Re: Strcmp or ZCMD? - by Giroud12 - 12.05.2013, 15:39
Re: Strcmp or ZCMD? - by FUNExtreme - 12.05.2013, 15:46
Re: Strcmp or ZCMD? - by Giroud12 - 12.05.2013, 15:47
Re: Strcmp or ZCMD? - by MP2 - 12.05.2013, 15:50

Forum Jump:


Users browsing this thread: 1 Guest(s)