Unkown Command
#1

I cant figure out why its doing this...
Even though the command works it still says "Unknown Command".

Anyone see the problem?

Код:
CMD:am(playerid, params[])
{
	if(pInfo[playerid][pAMMute] == 0)
	{
		new text, str[128];
		if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /am [text]");
		format(str, sizeof(str), "%s [ID: %i] : %s", GetName(playerid), playerid, text);
		SendClientMessageToAdmins(COLOR_ORANGE, str, 1);
		SendClientMessage(playerid, COLOR_ORANGE, "Admin message sent.");
	}
	else return SendClientMessage(playerid, COLOR_ORANGE, "You have been muted from using am.");
	return 1;
}
Reply
#2

Код:
CMD:am(playerid, params[])
{
	if(pInfo[playerid][pAMMute] == 0)
	{
		new text, str[128];
		if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /am [text]");
		format(str, sizeof(str), "%s [ID: %i] : %s", GetName(playerid), playerid, text);
		SendClientMessageToAdmins(COLOR_ORANGE, str, 1);
		SendClientMessage(playerid, COLOR_ORANGE, "Admin message sent.");
                return 1;
	}
	else return SendClientMessage(playerid, COLOR_ORANGE, "You have been muted from using am.");
	return 1;
}
Rep+ if i helped you
Reply
#3

Quote:
Originally Posted by SlimDkhili
Посмотреть сообщение
Код:
CMD:am(playerid, params[])
{
	if(pInfo[playerid][pAMMute] == 0)
	{
		new text, str[128];
		if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /am [text]");
		format(str, sizeof(str), "%s [ID: %i] : %s", GetName(playerid), playerid, text);
		SendClientMessageToAdmins(COLOR_ORANGE, str, 1);
		SendClientMessage(playerid, COLOR_ORANGE, "Admin message sent.");
                return 1;
	}
	else return SendClientMessage(playerid, COLOR_ORANGE, "You have been muted from using am.");
	return 1;
}
Rep+ if i helped you
and uh, what exactly did you change in that code? lol
Reply
#4

ye lol its same -_-
Reply
#5

return 1; added
Reply
#6

The unknown command message is shown even if a run time error occurs in the command's code, not only if it returns 0.

I guess the problem is in SendClientMessageToAdmins, a loop which the variable of it exceeds the valid bounds of an array (the one for checking the admin's level). Anyways, you can load crashdetect plugin and compile with debug info and it'll show you exactly what caused it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)