Y_Commands: all commands disabled for all players
#1

Hi, this is my problem: As the title says, I use YCMD. As is normal, I combine it with Y_groups for restrict commands, for example, only to admins, only to team X, only to team Y, etc. But when I run the code and I try to execute any command in game, I am disallowed to execute it (also if is a global command like /chat). I don't know what I am doing wrong, thanks for read, and thanks in advance if you have any possible solution.
Reply
#2

Can you show us the script / part of the script with some commands?
Reply
#3

Quote:
Originally Posted by HireMe
Посмотреть сообщение
Can you show us the script / part of the script with some commands?
of course...

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(!PlayerIsLoggedIn[playerid]){
        SendClientMessage(playerid, -1, "Please log in!");
        return -1;
    }
    return 1;
}
here the commands part, something like...
pawn Код:
YCMD:commands(playerid, params[], help)
{
    if ( help ) return SendClientMessage(playerid, -1, "Shows the command list");
    new count = Command_GetPlayerCommandCount( playerid ), cmd[32];
    for ( new i = 0; i != count; ++i){
        format(cmd, sizeof(cmd), "/%s ", Command_GetNext ( i, playerid ));
                SendClientMessage(playerid, -1, cmd);
    }
   
    return 1;
}
finally...
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success){
    switch (success)
    {
        case 1:
        {
            return 1;
        }
        case -1:
        {
            return 0;
        }
        case 0:
        {
            SendClientMessage(playerid, -1, "Command not found, please use /commands to display the command list.");
            return 1;
        }
        default:
            return -1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)