24.11.2010, 01:13
[Include] [INC] zcmd 0.3.1 | Fast & Simple Command Processor (updated 30/10/2009)
28.11.2010, 17:55
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:
30.11.2010, 04:36
Hey guys i have a problem when i try compile the compiler show me this errors
i have this version of zcmd
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?
Код:
\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")
Код:
/********************************** * * * @Author: ZeeX * * @Version: 0.3.1 * * @Released: 31/10/2009 * * * **********************************/
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?
30.11.2010, 16:08
01.12.2010, 03:21
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.
|
Код:
#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>
21.01.2011, 20:03
Quote:
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;
}
23.02.2011, 19:27
Very Cool Thanks Man
09.09.2012, 10:57
09.09.2012, 11:47
09.09.2012, 17:37
Here.
If you are planning to make a smaller gamemode, ZCMD is really a better choice. (YCMD is for advanced users)
If you are planning to make a smaller gamemode, ZCMD is really a better choice. (YCMD is for advanced users)
09.09.2012, 17:52
Quote:
Here.
If you are planning to make a smaller gamemode, ZCMD is really a better choice. (YCMD is for advanced users) |
11.09.2012, 02:33
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.
24.09.2012, 22:47
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!
Note: First time scripting since the 0.2.2X days, I'm still trying to get used to all the new changes!
25.09.2012, 15:54
Quote:
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.
|
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. |
pawn Код:
Command_GetID(funcname[])
pawn Код:
Command_SetPlayer(command, playerid, set)
25.09.2012, 17:38
best (after ycmd release one of the best) command processor since 2009..
28.10.2012, 11:38
One of the best SA-MP releases!
20.11.2012, 08:01
Код:
[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
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.
20.11.2012, 17:08
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:
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);
21.11.2012, 07:02
Quote:
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 Код:
|
pawn Код:
while (cmdtext[++pos] > ' ')
{
if(pos > MAX_FUNC_NAME)
break;
else
funcname[pos-1] = tolower(cmdtext[pos]);
}
24.11.2012, 14:45
how I do it using zcmd?
Thanks.
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;
}
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)