Mutear
#1

Hola, me podrнa decir como hago, para que estй comando sea asi, /mutear ID tiempo razуn, porque lo normal siempre se mutea 5 minutos, gracias.


pawn Код:
zcmd(mutear, playerid, params[])
    {
       new giveplayerid;
        if(Info[playerid][pAdminZC] < 1 &&Info[playerid][pHelper] < 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "ЎNo puedes usar este comando!");
       if(!sscanf(params, "d", giveplayerid))
       {
           if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "Esa ID es invбlida.");
             if(Info[giveplayerid][pAdminZC] >= 1)
          {
             return SendClientMessageEx(playerid, COLOR_LIGHTRED, "No puedes mutear a administradores.");
          }
           if(Info[giveplayerid][pNMute] == 0)
          {
              new string[128];
                Info[giveplayerid][pNMute] = 1;
                NewbieTimer[giveplayerid] = 3000;
                Info[giveplayerid][pNMuteTotal]++;
             if(Info[giveplayerid][pNMuteTotal] == 30)
             {
                format(string, sizeof(string), "%s fue kickeado automбticamente. Razуn: 30 muteos en total.", GetPlayerNameEx(giveplayerid));
                BroadCast(COLOR_RED,string);
                Kick(giveplayerid);
                return 1;
             }
             format(string, sizeof(string), "%s te ha silenciado del canal de ayuda por 5 minutos, razуn: Mal uso.", GetPlayerNameEx(playerid));
             SendClientMessageEx(giveplayerid,COLOR_WHITE,string);
             Info[playerid][pAccount]-= 6000;
             SendClientMessageEx(playerid, COLOR_GRAD2, "Se te ha descontado 6000$ de tu cuenta bancaria.");
             foreach(Player, n)
             {
                if (gNewbie[n] == 0 || Info[n][pNMute] == 0)
                {
                    format(string, sizeof(string), "A %s no se le permite hablar en el chat de ayuda. Razуn: Mal uso.", GetPlayerNameEx(giveplayerid));
                   SendClientMessageEx(n, COLOR_RED, string);
                }
             }
             SetTimerEx("NewbieUnMuted", 300000, 0, "d", giveplayerid);
          }
       } else SendClientMessageEx(playerid, COLOR_GRAD2, "Utiliza: {6E9AFF}/mutear{FFFFFF} <PlayerID>");
       return 1;
    }
pawn Код:
function NewbieUnMuted(playerid)
{
    Info[playerid][pNMute] = 0;
    SendClientMessage(playerid, COLOR_WHITE, "Ahora ya no estas silenciado del canal de ayuda recuerda usarlo sуlo para preguntas.");
    SendClientMessage(playerid, COLOR_WHITE, "Si sigues recuerda que puedes resultar baneado automбticamente del servidor.");
    return 1;
}
Reply
#2

pawn Код:
zcmd(mutear, playerid, params[])
{
    new giveplayerid, time, reason[128];
    if(Info[playerid][pAdminZC] < 1 &&Info[playerid][pHelper] < 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "ЎNo puedes usar este comando!");
    if(!sscanf(params, "uis[128]", giveplayerid, time, reason))
    {
        if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "Esa ID es invбlida.");
        if(Info[giveplayerid][pAdminZC] >= 1)
        {
            return SendClientMessageEx(playerid, COLOR_LIGHTRED, "No puedes mutear a administradores.");
        }
        if(Info[giveplayerid][pNMute] == 0)
        {
            new string[128];
            Info[giveplayerid][pNMute] = 1;
            NewbieTimer[giveplayerid] = time*60;
            Info[giveplayerid][pNMuteTotal]++;
            if(Info[giveplayerid][pNMuteTotal] == 30)
            {
                format(string, sizeof(string), "%s fue kickeado automбticamente. Razуn: 30 muteos en total.", GetPlayerNameEx(giveplayerid));
                BroadCast(COLOR_RED,string);
                Kick(giveplayerid);
                return 1;
            }
            format(string, sizeof(string), "%s te ha silenciado del canal de ayuda por %i minutos, razуn: %s.", GetPlayerNameEx(playerid), time, reason);
            SendClientMessageEx(giveplayerid,COLOR_WHITE,string);
            Info[playerid][pAccount]-= 6000;
            SendClientMessageEx(playerid, COLOR_GRAD2, "Se te ha descontado 6000$ de tu cuenta bancaria.");
            foreach(Player, n)
            {
                if (gNewbie[n] == 0 || Info[n][pNMute] == 0)
                {
                    format(string, sizeof(string), "A %s no se le permite hablar en el chat de ayuda. Razуn: %s.", GetPlayerNameEx(giveplayerid), reason);
                    SendClientMessageEx(n, COLOR_RED, string);
                }
            }
            SetTimerEx("NewbieUnMuted", time*60*1000, 0, "d", giveplayerid);
        }
    } else SendClientMessageEx(playerid, COLOR_GRAD2, "Utiliza: {6E9AFF}/mutear{FFFFFF} <PlayerID> <time> <reason>");
    return 1;
}
Deberнa funcionar, pero no lo probй.

Te cambiй en el sscanf "i" por "u" asн te toma tanto id como parte de nombres.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)