Форум

  • Страница 1 из 1
  • 1
Модератор форума: AlexPPPP  
Форум | www.SAMP-TEAM.com » Wiki SA-MP » Команды » [C.M.D] Делаем команду /setskill
[C.M.D] Делаем команду /setskill
Code
    else if(strcmp(cmd, "/setskill", true) == 0)  
     {  
         if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 5)  
          {  
             tmp = strtok(cmdtext, idx);  
             if(!strlen(tmp))  
                {  
                         SendClientMessage(playerid, COLOR_WHITE, "{F74848}» Введите:{FFFFFF} /setstat [id] [номер] [количество]");  
                         SendClientMessage(playerid, COLOR_GRAD4, "[1] SDPistol | [2] DesertEagle {3300FF}|[3] M4 | [4] M5 {CC3300}| [5] ShotGun | [6] AK-47");  
                         return true;  
             }  
               giveplayerid = ReturnUser(tmp);  
             if(IsPlayerConnected(giveplayerid))  
             {  
                 if(giveplayerid != INVALID_PLAYER_ID)  
                 {  
                     tmp = strtok(cmdtext, idx);  
                     if(!strlen(tmp))  
                     {  
                         SendClientMessage(playerid, COLOR_WHITE, "{F74848}» Введите:{FFFFFF} /setstat [id] [номер] [количество]");  
                         SendClientMessage(playerid, COLOR_GRAD4, "[1] SDPistol | [2] DesertEagle {3300FF}|[3] M4 | [4] M5 {CC3300}| [5] ShotGun | [6] AK-47");  
                         return true;  
                     }  
                     new stat;  
                     stat = strval(tmp);  
                     tmp = strtok(cmdtext, idx);  
                     if(!strlen(tmp))  
                     {  
                         SendClientMessage(playerid, COLOR_WHITE, "{F74848}» Введите:{FFFFFF} /setstat [id] [номер] [количество]");  
                         SendClientMessage(playerid, COLOR_GRAD4, "[1] SDPistol | [2] DesertEagle {3300FF}|[3] M4 | [4] M5 {CC3300}| [5] ShotGun | [6] AK-47");  
                         return true;  
                     }  
                     new amount;  
                     amount = strval(tmp);  
                     if (PlayerInfo[playerid][pAdmin] >= 5)  
                     {  
                         switch (stat)  
                         {  
                             case 1:  
                             {  
                    PlayerInfo[giveplayerid][pSDPistol] = amount;  
                    format(string, sizeof(string), "SDPistol: %d", amount);  
                             }  
                             case 2:  
                             {  
                    PlayerInfo[giveplayerid][pDesertEagle] = amount;  
                    format(string, sizeof(string), "DesertEagle: %d ", amount);  
                             }  
                    case 3:  
                             {  
                    PlayerInfo[giveplayerid][pM4] = amount;  
                    format(string, sizeof(string), "M4: %d ", amount);  
                             }  
                             case 4:  
                             {  
                    PlayerInfo[giveplayerid][pMP5] = amount;  
                    format(string, sizeof(string), " M5: %d", amount);  
                             }  
                             case 5:  
                             {  
                    PlayerInfo[giveplayerid][pShotGun] = amount;  
                    format(string, sizeof(string), "ShotGun: %d", amount);  
                             }  
                             case 6:  
                             {  
                    PlayerInfo[giveplayerid][pAK47] = amount;  
                    format(string, sizeof(string), "AK-47: %d", amount);  
                             }  
                    default:  
                             {  
                    format(string, sizeof(string), "[Ошибка]", amount);  
                             }  

                         }  
                         SendClientMessage(playerid, COLOR_GRAD1, string);  
                     }  
                     else  
                     {  
                         SendClientMessage(playerid, COLOR_GRAD1, "Нет прав доступа!");  
                     }  
                     OnPlayerUpdateRL(playerid);  
                 }//not valid id  
             }//not connected  
         }  
         return true;  
     }
02.10.2012 в 22:05
Форум | www.SAMP-TEAM.com » Wiki SA-MP » Команды » [C.M.D] Делаем команду /setskill
  • Страница 1 из 1
  • 1
Поиск: