MUTE PLAYER FOR TIME.
#11

Another script without timer

pawn Код:
new gMuted[MAX_PLAYERS];
pawn Код:
CMD:mute(playerid, params[]) {
    if(sscanf(params, "dd", params[0], params[1]) || (params[1] < 1)) {
        SendClientMessage(playerid, -1, "Usage: /mute [playerid][time]");
    } else {
        new
            tmp[128];
        GetPlayerName(params[0], tmp, MAX_PLAYER_NAME);
        gMuted[params[0]] = GetTickCount() + (params[1] * 1000);
        format(tmp, sizeof tmp, "Player \"%s\" (%d) muted for %d seconds", tmp, params[0], params[1]);
        SendClientMessage(playerid, 0xFFFFFFFF, tmp);
    }
    return true;
}
pawn Код:
//OnPlayerText
    if(gMuted[playerid]) {
        if(GetTickCount() < gMuted[playerid]) {
            new
                tmp[64];
            format(tmp, sizeof tmp, "Muted!, %d seconds remaining",
                ((gMuted[playerid] - GetTickCount()) / 1000));
            SendClientMessage(playerid, 0xFF0000FF, tmp);
            return false;
        } else {
            gMuted[playerid] = 0;
        }
    }
pawn Код:
//OnPlayerDisconnect or OnPlayerConnect
    muted[playerid] = 0;
Reply


Messages In This Thread
MUTE PLAYER FOR TIME. - by budelis - 24.07.2011, 12:42
AW: MUTE PLAYER FOR TIME. - by Forbidden - 24.07.2011, 12:43
Re: MUTE PLAYER FOR TIME. - by MadeMan - 24.07.2011, 12:47
Re: MUTE PLAYER FOR TIME. - by budelis - 26.07.2011, 06:27
Re: MUTE PLAYER FOR TIME. - by budelis - 26.07.2011, 09:23
Re: MUTE PLAYER FOR TIME. - by Cjgogo - 26.07.2011, 09:24
Re: MUTE PLAYER FOR TIME. - by [MG]Dimi - 26.07.2011, 10:06
Re: MUTE PLAYER FOR TIME. - by Mean - 26.07.2011, 10:30
Re: MUTE PLAYER FOR TIME. - by budelis - 26.07.2011, 11:36
Re: MUTE PLAYER FOR TIME. - by Mean - 26.07.2011, 14:04
AW: MUTE PLAYER FOR TIME. - by Nero_3D - 26.07.2011, 14:37
Re: MUTE PLAYER FOR TIME. - by budelis - 26.07.2011, 16:37
Re: MUTE PLAYER FOR TIME. - by budelis - 28.07.2011, 07:55
Re: MUTE PLAYER FOR TIME. - by budelis - 28.07.2011, 09:36

Forum Jump:


Users browsing this thread: 2 Guest(s)