#1

I have a few questions related to YCMD

1. What is better to use YCMD comes with dual commands

Code:
YCMD:r(playerid, params[], help)
{
    return Command_ReProcess(playerid, "/reply", 0);
}

or

// In OnGameModeInit ():
Command_AddAltNamed("/reply", "/r");
2. do I make the switch from ZCMD to YCMD and I like each command to transfer

Code:
CMD:r(playerid, params[])  >> YCMD:r(playerid, params[], help)
So I'd like where it's going

Code:
#pragma unused help
#pragma unused params
Reply
#2

1. Yes, its better use Command_AltNamed

2. Good Syntax

if have error with parameters params[] and help use #pragma
Reply
#3

Now I have a problem not ejected me this

Code:
forward OnPlayerCommandPerformed(playerid, cmdtext[], success);
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(isnull(cmdtext)) { return 0; }
	if(!success)
	{
		new string[128];
		format(string, sizeof(string), "No commands (%s)!", cmdtext);
		SCM(playerid, COLOR_NICERED, string);
		return 1;
	}
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	return 1;
}
]
Reply
#4

you using YSI 4.0? if itґs correctly

Change Public OnPlayerCommandPerformed to

PHP Code:
/*
        Error & Return type

    COMMAND_ZERO_RET      = 0 , // The command returned 0.
    COMMAND_OK            = 1 , // Called corectly.
    COMMAND_UNDEFINED     = 2 , // Command doesn't exist.
    COMMAND_DENIED        = 3 , // Can't use the command.
    COMMAND_HIDDEN        = 4 , // Can't use the command don't let them know it exists.
    COMMAND_NO_PLAYER     = 6 , // Used by a player who shouldn't exist.
    COMMAND_DISABLED      = 7 , // All commands are disabled for this player.
    COMMAND_BAD_PREFIX    = 8 , // Used "/" instead of "#", or something similar.
    COMMAND_INVALID_INPUT = 10, // Didn't type "/something".
*/

public e_COMMAND_ERRORSOnPlayerCommandReceived(playeridcmdtext[], e_COMMAND_ERRORS:success)
{
    switch (
success)
    {
        case 
COMMAND_UNDEFINED:
        {
             
SendClientMessage(playerid0xFF0000"Error: use /Help for mor commands");
        }
    }
    return 
COMMAND_OK;

Reply
#5

error undefined COMMAND_UNDEFINED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)