Unknown command with ZCMD
#1

What am i doing wrong here? It keeps saying unknown command when im using /mute

http://pastebin.com/Hq93waQc
Reply
#2

Код:
COMMAND:mute(playerid, params[])
{
        if(IsPlayerAdmin(playerid))
	{
		//place your mute code here
	}
	else SendClientMessage(playerid, COLOR_RED, "You can not use this command!");
        return 1;// if you return 0 you will get "unknown command" text
}
Reply
#3

pawn Код:
CMD:mute(playerid, params[])
{
    new id;
    new reason[128];
    new str[256];
    new AdminName[MAX_PLAYER_NAME];
    new Target[MAX_PLAYER_NAME];
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't authorized to use this command!");
    if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, grey, "Usage:/mute (playerid/partofname) (reason)");
    else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!");
    else
    {
        GetPlayerName(playerid, AdminName, sizeof(AdminName));
        GetPlayerName(id, Target, sizeof(Target));
        format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has muted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s. {FF6347}Reason; {B4B5B7}%s .", AdminName, Target, reason);
        SendClientMessageToAll(lightred, str);
        PlayerInfo[id][isMuted] = 1;
    }
     return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(PlayerInfo[playerid][isMuted] >= 1)
    {
        SendClientMessage(playerid, lightred, "[INFO]: {B4B5B7}You were muted by an Admin!");
        return 0;
    }
    return 1;
}
pawn Код:
enum pInfo
{
    isMuted,
    isJailed
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)