Mute CMD
#1

When I mute someone he can talks :/


pawn Код:
CMD:mute(playerid, params[])
{

    new string[256];
    if(!IsAdmin(playerid)) return NotAdmin(playerid);
    new muteid, mutetime, reason[256];
    new nameid[20];
    if(sscanf(params, "s[20]I(2)S(No reason)[80]", nameid, mutetime, reason)){
        return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /mute [id] [minutes] [reason]");

    }
    if(ReturnUser(nameid,playerid) == -1)
    {

        return 1;
    } else {

        muteid = ReturnUser(nameid, playerid);
    }
    if(!IsPlayerConnected(muteid)){
        return SendClientMessage(playerid, COLOR_YELLOW, "Player is not connected !");
    }
    new file[256];
    file = GetUserPath(muteid,1);


    if(dini_Int(file,"muted")){

        return SendClientMessage(playerid, COLOR_YELLOW, "Player is already muted !");

    }

    mutetime = mutetime * 60;



    format(string, sizeof string, "%s has been muted %i seconds by %s for %s", GetName(muteid), mutetime, GetName(playerid), reason);
    SendClientMessageToAll(COLOR_RED_SHINY, string);

    format(string, sizeof string, "You have been muted %i seconds !", mutetime);
    SendClientMessage(muteid,COLOR_RED_SHINY, string);



    dini_IntSet(file, "mute_t", GetTickCount() + mutetime * 1000);
    dini_IntSet(file, "muted", 1);
    dini_IntSet(file, "mute_s", mutetime * 1000);


    return 1;

}

pawn Код:
public OnPlayerText(playerid, text[])
{
    new file[256];
    file = GetUserPath(playerid);
    LogChat(playerid, text);
    if(dini_Int(file, "muted")) {
        SendClientMessage(playerid, COLOR_YELLOW, "You are muted PM an administrator if you think you were muted incorrectly");
        return 0;
    }
    return 1;

}
*Edit: This is an include.
Reply


Messages In This Thread
Mute CMD - by Alex_Obando - 10.04.2011, 03:48
Re: Mute CMD - by willsuckformoney - 10.04.2011, 04:51
Re: Mute CMD - by [DJ]Boki - 10.04.2011, 04:57
Respuesta: Mute CMD - by Alex_Obando - 10.04.2011, 14:42
Re: Mute CMD - by willsuckformoney - 10.04.2011, 15:16
Respuesta: Mute CMD - by Alex_Obando - 12.04.2011, 20:29
Respuesta: Mute CMD - by Alex_Obando - 13.04.2011, 23:43
Respuesta: Mute CMD - by Alex_Obando - 14.04.2011, 02:32
Re: Mute CMD - by Scenario - 14.04.2011, 03:04
Respuesta: Mute CMD - by Alex_Obando - 14.04.2011, 03:25

Forum Jump:


Users browsing this thread: 3 Guest(s)