Бан чата по минутам

Description: Готовые команды
Moderator: SJplayer

May
Topic author, Ефрейтор
Ефрейтор
Avatar
May
Topic author, Ефрейтор
Ефрейтор
Posts: 22
Joined: 8 May 2013
With us: 11 years 6 months

#1by May » 12 May 2013, 14:46

Всем привет,решил выложить команду ""Бан чата по минутам".

В OnPlayerCommandText:

Code: Select all

else if(strcmp(cmd"/mute"true) == 0)
    {
        if (
PlayerInfo[playerid][pAdmin] >= 1)
            {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp)) return    SendClientMessage(playeridCOLOR_WHITE"Введите: /mute [id] [минуты]");
            if (
dostup[playerid] != 1) return ShowPlayerDialog(playerid,2934,DIALOG_STYLE_INPUT,"Доступ администратора","Введите свой key в окошко и нажмите 'Ок'","Ок","Отмена");
            new 
playa;
            
playa ReturnUser(tmp);
               
tmp strtok(cmdtextidx);
               
GetPlayerName(playagiveplayersizeof(giveplayer));
            
GetPlayerName(playeridsendernamesizeof(sendername));
              if(!
strlen(tmp))
              {
              if(
PlayerInfo[playa][pMuted] == 1)
            {
                            
PlayerInfo[playa][pMuted] = 0;
                            
PlayerInfo[playa][pMuteTime] = 0;
                            
printf("%s ????? ????????",giveplayer);
                            
format(stringsizeof(string), "Администратор %s снял бан чата у %s ",sendernamegiveplayer);
                            
SendClientMessageToAll(COLOR_LIGHTREDstring);
            }
              return 
1;
              }
              new 
mins strval(tmp);
                  if (
PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(
IsPlayerConnected(playa))
                {
                    if(
playa != INVALID_PLAYER_ID)
                    {
                        if(
PlayerInfo[playa][pMuted] == 0)
                        {
                            
PlayerInfo[playa][pMuteTime] = mins*60;
                            
PlayerInfo[playa][pMuted] = 1;
                             
printf("%s ??????? %s",sendername,  giveplayer);
                            
format(stringsizeof(string), "%s получил бан чата от администратора %s ",giveplayersendername );
                            
SendClientMessageToAll(COLOR_LIGHTREDstring);
                        }
                        else
                        {
                            
PlayerInfo[playa][pMuted] = 0;
                            
PlayerInfo[playa][pMuteTime] = 0;
                            
printf("%s ????? ????????",giveplayer);
                            
format(stringsizeof(string), "Администратор %s снял бан чата у %s ",sendernamegiveplayer);
                            
SendClientMessageToAll(COLOR_LIGHTREDstring);
                        }
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Вы не уполномочены использовать эту команду!");
            }
        }
        return 
1;
    }   


Return to “Команды”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest