SA-MP Forums Archive
Unkown Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Unkown Command (/showthread.php?tid=528058)



Unkown Command - Blademaster680 - 26.07.2014

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;
}



Re : Unkown Command - SlimDkhili - 26.07.2014

Код:
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


Re: Re : Unkown Command - Smileys - 26.07.2014

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


Re: Unkown Command - SHE790 - 26.07.2014

ye lol its same -_-


Re : Unkown Command - SlimDkhili - 26.07.2014

return 1; added


Re: Unkown Command - Konstantinos - 26.07.2014

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.