SA-MP Forums Archive
Number Of Arguments Doesn't match definition - 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: Number Of Arguments Doesn't match definition (/showthread.php?tid=643217)



Number Of Arguments Doesn't match definition - BlackLineCnR - 15.10.2017

I Created a cmd, for admins who remain on-duty, to force them off-duty, But it coming up with this error!

Код:
COMMAND:forceaod(playerid, params[])
{
	if(playerData[playerid][playerLoggedIn])
	{
		if(playerData[playerid][playerLevel] >= 4)
		{

			new otherID, reason[300];

			if(sscanf(params, "us[300]", otherID, reason))
			{
				SendClientMessage(playerid, COLOR_ORANGE, "Usage: \"forceaod <playername/id> <reason>\"");
			}


			{
				// Admin is already on duty, so we'll now put them off duty
				SendClientMessage(otherID, COLOR_WHITE, "{FE9A2E}[ADMIN] {FFFFFF}You Have Been Forced Off-Duty by %s! Reason:- %s", playerData[playerid][tempAdminName], reason);
                                new admnotification[128];
                                format(admnotification, sizeof(admnotification), "[SERVER] Administrator %s(%i) is now Off-Duty!", playerData[playerid][tempAdminName], playerid);
                                SendClientMessageToAll(COLOR_LIGHTBLUE, admnotification);
				playerData[otherID][playerAdminDuty] = false;
				Delete3DTextLabel(playerData[otherID][playerAdminLabel]);

				// Give them default health
				SetPlayerHealth(otherID, 100);
                                SetPlayerArmour(otherID, 0);
				newPlayerColour(otherID);
				TextDrawHideForPlayer(otherID, Text:AdminDuty);
			}
		}
		else
		{
			return 0;
		}
	}
	else
	{
		SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You must be logged in to use commands.");
	}

	return 1;
}
Need help, +rep for help!


Re: Number Of Arguments Doesn't match definition - Kyle - 15.10.2017

Quote:
Originally Posted by BlackLineCnR
Посмотреть сообщение
I Created a cmd, for admins who remain on-duty, to force them off-duty, But it coming up with this error!

Код:
COMMAND:forceaod(playerid, params[])
{
	if(playerData[playerid][playerLoggedIn])
	{
		if(playerData[playerid][playerLevel] >= 4)
		{

			new otherID, reason[300];

			if(sscanf(params, "us[300]", otherID, reason))
			{
				SendClientMessage(playerid, COLOR_ORANGE, "Usage: \"forceaod <playername/id> <reason>\"");
			}


			{
				// Admin is already on duty, so we'll now put them off duty
				SendClientMessage(otherID, COLOR_WHITE, "{FE9A2E}[ADMIN] {FFFFFF}You Have Been Forced Off-Duty by %s! Reason:- %s", playerData[playerid][tempAdminName], reason);
                                new admnotification[128];
                                format(admnotification, sizeof(admnotification), "[SERVER] Administrator %s(%i) is now Off-Duty!", playerData[playerid][tempAdminName], playerid);
                                SendClientMessageToAll(COLOR_LIGHTBLUE, admnotification);
				playerData[otherID][playerAdminDuty] = false;
				Delete3DTextLabel(playerData[otherID][playerAdminLabel]);

				// Give them default health
				SetPlayerHealth(otherID, 100);
                                SetPlayerArmour(otherID, 0);
				newPlayerColour(otherID);
				TextDrawHideForPlayer(otherID, Text:AdminDuty);
			}
		}
		else
		{
			return 0;
		}
	}
	else
	{
		SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You must be logged in to use commands.");
	}

	return 1;
}
Need help, +rep for help!
What error?


Re: Number Of Arguments Doesn't match definition - BlackLineCnR - 15.10.2017

Leave It Already Fixed!