Help needed with YCMD
#1

Hi and thanks for read my post.

I am having a little problem with YSI command processor "Y_Commands". When I try to run a command in game the server returns me a "Server: Unknown command" message, even if the command exists. I know all the commands are being correctly stored into the YCMD internal data because I got in console the whole command list of the server running this simple code:

Код:
for (new i = 0; i != 25; ++i)
{
     printf("%s",Command_GetName(i));
}
I don't know what's going on with my commands, a few days ago the system was running correctly and reverting the recent changes to my game mode are not solving my problem.

Again thanks and I hope you can help me.

EDIT: I continued testing and I discovered that all the commands are disallowed for all the users, in the code the only restriction is for the administrative commands, the rest of the commands are supposed to work for the global group (I use Y_groups too).

EDIT 2: I used another function to allow the player to use all commands ( a loop through all commands in onplayerconnect using this function "Command_SetPlayer(i,playerid,true);" where "i" is the local variable defined in the "for" loop, but the commands are still disallowed for the player who try use them.
Reply
#2

Maybe you have return 0 in OnPlayerCommandText?
Reply
#3

Quote:
Originally Posted by Dragony92
Посмотреть сообщение
Maybe you have return 0 in OnPlayerCommandText?
I've deleted OnPlayerCommandText on my gamemode, but btw defining it returning 0 not makes the difference (tested).
Reply
#4

1.try converting to ZCMD
2.see that you don't have any other command processor included as well
Reply
#5

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
1.try converting to ZCMD
2.see that you don't have any other command processor included as well
1. I just created a simple command using ZCMD, In-Game it works fine.

2. The only command processor I've defined was YCMD (right now I have defined ZCMD and YCMD, only for make a test that allow me to reply you).

the ZCMD command works fine, however, the YCMD commands are returning 0 in the variable "success" at OnPlayerCommandPerformed, even existing. (All my YCMD commands returns 1 at the end of the function).
Reply
#6

Quote:
Originally Posted by deb014
Посмотреть сообщение
1. I just created a simple command using ZCMD, In-Game it works fine.

2. The only command processor I've defined was YCMD (right now I have defined ZCMD and YCMD, only for make a test that allow me to reply you).

the ZCMD command works fine, however, the YCMD commands are returning 0 in the variable "success" at OnPlayerCommandPerformed, even existing. (All my YCMD commands returns 1 at the end of the function).
You are returning 0 in variable success but they are also returning 1.
how can they return both of them
Reply
#7

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
You are returning 0 in variable success but they are also returning 1.
how can they return both of them
I will explain...

Let's supose I have a Y_command called heybro
Код:
YCMD:heybro(playerid, params[], help)
{
    if (help)
    {
        return SendClientMessage(playerid, 0xFF0000AA, "Just a greeting.");
    }
    else
    {
          SendClientMessage(playerid, -1, "Hey yo!");
     }
    return 1;
}
and supose I have the following code at OnPlayerCommandPerformed

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success){
	printf("%s: %d", cmdtext, success);
        return -1;
}
Typing the command In-game the output given in console is...
Код:
/heybro: 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)