The best command procesor -
[SOB]Chris - 18.10.2010
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.
Re: The best command procesor - [L3th4l] - 18.10.2010
ZCMD + sscanf
Re: The best command procesor -
Steven82 - 18.10.2010
Is going to be easier if your new to scripting, or in a hurry to do some work for someone or something idk
Respuesta: The best command procesor -
[SOB]Chris - 18.10.2010
can give me the post of zcmd i dont find it, and you can giveme a example for zmcd + sccanf plz.
Thanks.
Re: Respuesta: The best command procesor -
Toni - 18.10.2010
Quote:
Originally Posted by Steven82
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;
}
Re: The best command procesor -
CuervO - 18.10.2010
dcmd
the message was too lo... ahh screw it.
Re: The best command procesor -
Toni - 18.10.2010
Quote:
Originally Posted by CuervO
dcmd
the message was too lo... ahh screw it.
|
Just wondering, why do you think dcmd is the best?
Re: The best command procesor -
nemesis- - 18.10.2010
Quote:
Originally Posted by [L3th4l]
ZCMD + sscanf
|
Here here!!
Quote:
Originally Posted by Steven82
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.
Re: The best command procesor -
Toni - 18.10.2010
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?
Re: Respuesta: The best command procesor -
Niixie - 18.10.2010
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;
}