17.04.2016, 10:25 
	
	
	
		Hey guys, I scripted a faction MOTD command
Everything works good when I type the command, but it still tells me that the CMD is invalid
Code:
CommandPerformed:
	
	
	
	
Everything works good when I type the command, but it still tells me that the CMD is invalid
Code:
PHP код:
CMD:adjustfacmotd(playerid, params[])
{
    new motd, string[128];
    if(!IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use this command.");
    if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
    if(sscanf(params, "s[128]", motd)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adjustfacmotd [MOTD]");
    format(FacInfo[PlayerInfo[playerid][pFac]][facMOTD], 128, "%s", motd);
    format(string, sizeof(string), " %s %s has edited the faction Message of The Day.", RPFRN(playerid), RPN(playerid));
    SendPlayerFactionMessage(playerid, 0, COLOR_RADIO, string);
    format(string, sizeof(string), " %s", motd);
    SendPlayerFactionMessage(playerid, 0, COLOR_RADIO, string);
    SendClientMessage(playerid, COLOR_WHITE, "You have edited your faction's MOTD");
    return 1;
} 
PHP код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    new string[128];
    format(string, sizeof(string), "[cmd] [%s]: %s", RPN(playerid), cmdtext);
     print(string);
    if(!success)
    {
        SendClientMessage(playerid, COLOR_RED, "** The command you attempt to use doesn't exist on our server.");
    }
    return 1;
} 


