YCMD problem
#4

Hello ******,

Thanks for your help.
I've tried different returns in the OnPlayerCommandReceived callback, but anyone doesn't help me. I still receive SERVER: Unknown command after the handled error:
Quote:

Cmd executing is forbidden when Dialog is opened.
SERVER: Unknown command



I have no idea what I missed...

There is my public below:

Код:
public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success)
{
	if(pData[playerid][pCmdFlood] - GetTickCount() > 0) return COMMAND_DENIED;
	pData[playerid][pCmdFlood] = GetTickCount() + ANTI_FLOOD_TIME;
	
	if(!gPlayerLogged[playerid]
	|| gPlayerNeedPassChange[playerid]
	|| pData[playerid][pBlocked] > 0) return COMMAND_DENIED;

	if(pTemp[playerid][pDialog])
	{
		SendClientMessageEx(playerid, CGREY, "Cmd executing is forbidden when Dialog is opened.");
		return COMMAND_DENIED;
	}

	switch (success)
	{
		case COMMAND_ZERO_RET: return COMMAND_ZERO_RET;
		case COMMAND_OK: WriteMysqlLog(playerid, LogTypeOnPlayerCommandReceived, cmdtext);
		case COMMAND_UNDEFINED, COMMAND_HIDDEN, COMMAND_DISABLED, COMMAND_BAD_PREFIX:
		{
			SendClientMessageEx(playerid, CGREY, "No such command.");
			return COMMAND_OK;
		}
		case COMMAND_DENIED: return COMMAND_DENIED;
		case COMMAND_NO_PLAYER: return COMMAND_NO_PLAYER;
		case COMMAND_INVALID_INPUT: return COMMAND_INVALID_INPUT;
	}

	return COMMAND_OK;
}
Reply


Messages In This Thread
YCMD problem - by C0oL3r - 21.03.2018, 12:46
Re: YCMD problem - by CKA3KuH - 12.02.2019, 22:27
Re: YCMD problem - by ComDuck - 13.02.2019, 09:54
Re: YCMD problem - by CKA3KuH - 05.03.2019, 13:17

Forum Jump:


Users browsing this thread: 1 Guest(s)