[Include] [INC] zcmd 0.3.1 | Fast & Simple Command Processor (updated 30/10/2009)
#61

Quote:
Originally Posted by anonymousx
Посмотреть сообщение
Yeah there compatible, check this.
Oh, that's interesting. Thanks for pointing that out!
Reply
#62

The best command processor, but I have a problem: when I type any command I get "Unknown Command" message, but the command have return 1; and exists:

Reply
#63

Hey guys i have a problem when i try compile the compiler show me this errors

Код:
\pawno\include\ZCMD.inc(78) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
\pawno\include\ZCMD.inc(118) : warning 201: redefinition of constant/macro (symbol "OnPlayerCommandText")
i have this version of zcmd

Код:
/**********************************
 *                                *
 *   @Author:      ZeeX           *
 *   @Version:     0.3.1          *
 *   @Released:    31/10/2009     *
 *                                *
 **********************************/
and this sccanf version
I read this thread and i understand this error happend when i have a old version of zcmd or sscanf, exist a new version of zmcd?
Reply
#64

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
The best command processor, but I have a problem: when I type any command I get "Unknown Command" message, but the command have return 1; and exists:

Bump ...
Reply
#65

Quote:
Originally Posted by ******
What other includes do you have? It is caused by scripts not using the latest version of ALS (which is still fairly old), however sscanf doesn't use ALS so it can't be that.
This are my includes
Код:
#define YSI_NO_MODULES
#define YSI_NO_OBJECTS
#define YSI_NO_RACES
#define YSI_NO_CHECKPOINTS
#define YSI_NO_AREAS
#define YSI_NO_PROPERTIES
#define YSI_NO_ZONES
#define SKINTYPE 1
#include <a_samp>
#include <YSI>
#include <ZCMD>
#include <seif_text>
The version of YSI is this
Reply
#66

Quote:
Originally Posted by Tupac
Посмотреть сообщение
is it posssible to return a command in like onplayerkeystatechange?

newkeys & firekey)
{
new params[];
cmd_sell(playerid,params[]);
}

i know theres no params, but for a command like this. it doesnt use any params
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & firekey) cmd_sell(playerid, "");
    return 1;
}
Reply
#67

Very Cool Thanks Man
Reply
#68

Quote:
Originally Posted by NoahF
Посмотреть сообщение
I use this for EVERY script. ZCMD is the easiest, fastest command processor out there. I love it. Thank you for this.
Well for multiple commands YCMD is much faster.
Reply
#69

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
Well for multiple commands YCMD is much faster.
Thanks. I didn't know. :P
Reply
#70

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
Well for multiple commands YCMD is much faster.
Here.
If you are planning to make a smaller gamemode, ZCMD is really a better choice. (YCMD is for advanced users)
Reply
#71

Quote:
Originally Posted by Seven_of_Nine
Посмотреть сообщение
Here.
If you are planning to make a smaller gamemode, ZCMD is really a better choice. (YCMD is for advanced users)
What do you suppose to say? The image is from YCMD topic, and I said that YCMD is faster for multiple commands. Also YCMD is not for advaned users, it has the same paramers like ZCMD, but it has "help" parameter extra.
Reply
#72

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
What do you suppose to say? The image is from YCMD topic, and I said that YCMD is faster for multiple commands. Also YCMD is not for advaned users, it has the same paramers like ZCMD, but it has "help" parameter extra.
The help parameter is only a VERY small part of the extra functions YCMD contains, I suggest you read the YCMD topic before trying to start a debate.
Reply
#73

Was going to use the default OnPlayerCommand on a new script I'm making. Should I use zcmd instead? What's the advantage/benefit?

Note: First time scripting since the 0.2.2X days, I'm still trying to get used to all the new changes!
Reply
#74

Quote:
Originally Posted by Camacorn
Посмотреть сообщение
The help parameter is only a VERY small part of the extra functions YCMD contains, I suggest you read the YCMD topic before trying to start a debate.
LOL dude I'm not talking about extra features of YCMD but the CMDs itselfs!

Quote:
Originally Posted by Y_Less
Why do we need another command processing system? ZCMD is already very fast!

y_commands is actually now FASTER than ZCMD and is designed to handle huge numbers of commands. Additionally included in that speed is permission checks (to set exactly who can use the command), a help system, command renaming and removal plus more.
Other extra features such as....
pawn Код:
Command_GetID(funcname[])
or
pawn Код:
Command_SetPlayer(command, playerid, set)
then we're talking about something else. I also didn't debate anything and read again before posting. Thank you
Reply
#75

best (after ycmd release one of the best) command processor since 2009..
Reply
#76

One of the best SA-MP releases!
Reply
#77

Код:
[11:17:27] [OPCT]: /ftfrdggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
[11:17:27] [debug] Run time error 4: "Array index out of bounds"
[11:17:27] [debug]   Accessing element at index 32 past array upper bound 31
[11:17:27] [debug] AMX backtrace:
[11:17:27] [debug] #0  0000298c in public OnPlayerCommandText (playerid=26, cmdtext[]=@0x000fb9e0 "") at C:\Users\...\zcmd.inc:102
[OPCT] = OnPlayerCommandText

Tried to do a strlen check but seemed to fail...

Type: /ftfrdggggggggggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggggggggg

and it will print the crash warning. If you have a fix, your input would be greatly appreciated. Don't have much time on my hands to investigate through.

Thanks.
Reply
#78

The array funcname[MAX_FUNC_NAME] is getting indexed by the size of the command, so if the command is bigger than the define MAX_FUNC_NAME, it gets a runtime error and the function stops.

You could add a check to prevent the error occuring.

Example:

pawn Код:
new
    pos,
    funcname[MAX_FUNC_NAME];
while (cmdtext[++pos] > ' ')
{
    if(pos > MAX_FUNC_NAME) return 1; // added
    funcname[pos-1] = tolower(cmdtext[pos]);
}
format(funcname, sizeof(funcname), "cmd_%s", funcname);
Reply
#79

Quote:
Originally Posted by Lightning[SV]
Посмотреть сообщение
The array funcname[MAX_FUNC_NAME] is getting indexed by the size of the command, so if the command is bigger than the define MAX_FUNC_NAME, it gets a runtime error and the function stops.

You could add a check to prevent the error occuring.

Example:

pawn Код:
new
    pos,
    funcname[MAX_FUNC_NAME];
while (cmdtext[++pos] > ' ')
{
    if(pos > MAX_FUNC_NAME) return 1; // added
    funcname[pos-1] = tolower(cmdtext[pos]);
}
format(funcname, sizeof(funcname), "cmd_%s", funcname);
Shots mate! The return statement fails however, break works.

pawn Код:
while (cmdtext[++pos] > ' ')
    {
        if(pos > MAX_FUNC_NAME)
            break;
        else
            funcname[pos-1] = tolower(cmdtext[pos]);
    }
Thanks, now works.
Reply
#80

how I do it using zcmd?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        new cmd[100], arg[100];
        sscanf(cmdtext, "p< >s[100]s[100]", cmd, arg);
        if(!strcmp(cmd, "/move", true))
        {
                new Float:pX, Float:pY, Float:pZ;
                sscanf(arg, "p< >fff", pX, pY, pZ);
                SetPlayerPos(playerid, pX, pY, pZ);
        }
        else if(!strcmp(cmd, "/colete", true))
        {
                SetPlayerArmour(playerid, 100);
        }
        else
        {
                SendClientMessage(playerid, -1, "Invalid command!!!");
        }
        return 1;
}
Thanks.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)