Форум

  • Страница 1 из 1
  • 1
Модератор форума: AlexPPPP  
Форум | www.SAMP-TEAM.com » Wiki SA-MP » Команды » [C.M.D] Заморозить/разморозить игрока
[C.M.D] Заморозить/разморозить игрока
Заморозить игрока


Code
if(strcmp(cmd, "/freeze", true) == 0)
     {
         if(PlayerInfo[playerid][pAdmin] >= 1)
         {
             tmp = strtok(cmdtext, idx);
             if(!strlen(tmp)) return    SendClientMessage(playerid, COLOR_WHITE, " Введите: /freeze [id]");
             new playa;
             playa = ReturnUser(tmp);
             if(PlayerInfo[playa][pAdmin] > 0) return SendClientMessage(playerid, COLOR_GRAD2, "Администратор не может быть заморожен!");
             if (PlayerInfo[playerid][pAdmin] >= 2)
             {
                 if(IsPlayerConnected(playa))
                 {
                     if(playa != INVALID_PLAYER_ID)
                     {
                         GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                         GetPlayerName(playerid, sendername, sizeof(sendername));
                         TogglePlayerControllable(playa, 0);
                         format(string, sizeof(string), "{00CDFF}Администратор{CD0000} %s заморозил %s",sendername,  giveplayer);
                         printf("%s",string);
                         format(string, sizeof(string), "%s был заморожен администратором %s",giveplayer ,sendername);
                         ABroadCast(COLOR_LIGHTRED,string,1);
                     }
                 }
             }
             else
             {
                 SendClientMessage(playerid, COLOR_GRAD1, "Вы не уполномочены использовать эту команду!");
             }
         }
         return true;
     }  


Разморозить игрока


Code
if(strcmp(cmd, "/unfreeze", true) == 0)
     {
         if(PlayerInfo[playerid][pAdmin] >= 1)
         {
             tmp = strtok(cmdtext, idx);
             if(!strlen(tmp))
             {
                 SendClientMessage(playerid, COLOR_WHITE, " Введите: /unfreeze [id]");
                 return true;
             }
             new playa;
             playa = ReturnUser(tmp);
             if (PlayerInfo[playerid][pAdmin] >= 2)
             {
                 if(IsPlayerConnected(playa))
                 {
                     if(playa != INVALID_PLAYER_ID)
                     {
                         GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                         GetPlayerName(playerid, sendername, sizeof(sendername));
                         TogglePlayerControllable(playa, 1);
                         format(string, sizeof(string), "{00CDFF}Администратор{CD0000} %s разморозил %s",sendername,  giveplayer);
                         printf("%s",string);
                         format(string, sizeof(string), "{00CDFF}Администратор{CD0000} %s разморозил %s ",sendername, giveplayer);
                         ABroadCast(COLOR_LIGHTRED,string,1);
                     }
                 }
             }
             else
             {
                 SendClientMessage(playerid, COLOR_GRAD1, "Вы не уполномочены использовать эту команду!");
             }
         }
         return true;
     }  
02.10.2012 в 16:46
Форум | www.SAMP-TEAM.com » Wiki SA-MP » Команды » [C.M.D] Заморозить/разморозить игрока
  • Страница 1 из 1
  • 1
Поиск: