The best command procesor
#1

Just this cuestion, what command procesor is the more faster and efficent, i wanna script my gm but i want choose the right coomand procesor.
Thanks.
Reply
#2

ZCMD + sscanf
Reply
#3

pawn Код:
Strcmp
Is going to be easier if your new to scripting, or in a hurry to do some work for someone or something idk
Reply
#4

can give me the post of zcmd i dont find it, and you can giveme a example for zmcd + sccanf plz.
Thanks.
Reply
#5

Quote:
Originally Posted by Steven82
Посмотреть сообщение
pawn Код:
Strcmp
Is going to be easier if your new to scripting, or in a hurry to do some work for someone or something idk
No. That is horrible compared to the other processors.


Quote:
Originally Posted by [SOB]Chris
Посмотреть сообщение
can give me the post of zcmd i dont find it, and you can giveme a example for zmcd + sccanf plz.
Thanks.
Use the advanced search next time; (ZCMD)

Here is my code for a /me command with zcmd + sscanf.

pawn Код:
CMD:me(playerid, params[])
{
    if(sscanf(params, "s[128]", str))
    {
        return SendClientMessage(playerid, LBLUE, "Usage: /me (action)") &&
        SendClientMessage(playerid, ORANGE, "Function: make a me action");
    }
    format(str, sizeof(str), "* %s %s", pName(playerid), str);
    SendClientMessageToAll(PURPLE, str);
    return 1;
}
Reply
#6

dcmd

the message was too lo... ahh screw it.
Reply
#7

Quote:
Originally Posted by CuervO
Посмотреть сообщение
dcmd

the message was too lo... ahh screw it.
Just wondering, why do you think dcmd is the best?
Reply
#8

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
ZCMD + sscanf
Here here!!

Quote:
Originally Posted by Steven82
Посмотреть сообщение
pawn Код:
Strcmp
Is going to be easier if your new to scripting, or in a hurry to do some work for someone or something idk
You do make a good point though strcmp can be used with ZCmd quite easily.

Quote:
Originally Posted by CuervO
Посмотреть сообщение
dcmd

the message was too lo... ahh screw it.
No, don't recommend that junk. Zcmd has been proven to process commands faster and with far less code.

Quote:
Originally Posted by The Toni
Посмотреть сообщение
Here is my code for a /me command with zcmd + sscanf.

pawn Код:
CMD:me(playerid, params[])
{
    if(sscanf(params, "s[128]", str))
    {
        return SendClientMessage(playerid, LBLUE, "Usage: /me (action)") &&
        SendClientMessage(playerid, ORANGE, "Function: make a me action");
    }
    format(str, sizeof(str), "* %s %s", pName(playerid), str);
    SendClientMessageToAll(PURPLE, str);
    return 1;
}
You really do not need to sscanf the params on a /me command. The way you have it makes the command inefficient.
Reply
#9

Quote:
Originally Posted by nemesis-
Посмотреть сообщение
You really do not need to sscanf the params on a /me command. The way you have it makes the command inefficient.
How does it make it inefficient?
Reply
#10

Quote:
Originally Posted by The Toni
Посмотреть сообщение
Here is my code for a /me command with zcmd + sscanf.

pawn Код:
CMD:me(playerid, params[])
{
    if(sscanf(params, "s[128]", str))
    {
        return SendClientMessage(playerid, LBLUE, "Usage: /me (action)") &&
        SendClientMessage(playerid, ORANGE, "Function: make a me action");
    }
    format(str, sizeof(str), "* %s %s", pName(playerid), str);
    SendClientMessageToAll(PURPLE, str);
    return 1;
}
You can make that less lines if you want to, and in my eyes still not messy. Take a look at this (Its just for showing, theres nothing wrong with it)

pawn Код:
CMD:me(playerid, params[])
{
    if(sscanf(params, "s[128]", str)) return SendClientMessage(playerid, LBLUE, "Usage: /me (action)") &&
        SendClientMessage(playerid, ORANGE, "Function: make a me action");
    format(str, sizeof(str), "* %s %s", pName(playerid), str);
    SendClientMessageToAll(PURPLE, str);
    return 1;
}
or you can do

pawn Код:
CMD:me(playerid, params[])
{
    if(sscanf(params, "s[128]", str))return SendClientMessage(playerid, LBLUE, "Usage: /me (action)") && SendClientMessage(playerid, ORANGE, "Function: make a me action");
    format(str, sizeof(str), "* %s %s", pName(playerid), str);
    SendClientMessageToAll(PURPLE, str);
    return 1;
}
And i always put an 'else' in, like this

pawn Код:
CMD:me(playerid, params[])
{
    if(sscanf(params, "s[128]", str)) return SendClientMessage(playerid, LBLUE, "Usage: /me (action)") && SendClientMessage(playerid, ORANGE, "Function: make a me action");
    else {
         format(str, sizeof(str), "* %s %s", pName(playerid), str);
         SendClientMessageToAll(PURPLE, str);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)