• Страница 1 из 1
  • 1
Модератор форума: dr40  
Баг с зарплатой
STOKEДата: Вторник, 19.07.2011, 10:49 | Сообщение # 1
.::Offline::.
Новичок
Сообщений: 9
[ 3 ]
Награды: 0

Статус отсутствует
У меня такая проблема:
Бывает зарплата приходит по 1 миллиону, мод cream life
Зарплата там по рангам
Я хотел бы сделать так,чтобы каждому давалось по одинаковому количеству денег

Code
public PayDay()
{
  new string[128];
  new account,interest;
  new rent = 0;
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
   if(IsPlayerConnected(i))
   {
       if(PlayerInfo[i][pLevel] > 0)
       {
     PlayerInfo[i][pRabotalLopatoy] = 0;
           DengiTime[i] = 15;
     new playername2[MAX_PLAYER_NAME];
     GetPlayerName(i, playername2, sizeof(playername2));
     account = PlayerInfo[i][pAccount];
     new key = PlayerInfo[i][pPhousekey];
     new ebill = SBizzInfo[4][sbPriceProd];
     new interestp = interest/100;
     new workpay;
     new oldm;
     if(key != 255)
     {
      rent = HouseInfo[key][hRent];
      if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
      {
       rent = 0;
      }
      else if(rent > GetPlayerMoney(i))
      {
       PlayerInfo[i][pPhousekey] = 255;
       SendClientMessage(i, COLOR_WHITE, "Âû áûëè âûñåëåíû ïî ïðè÷èíå âàøåé íåïëàò¸æåñïîñîáíîñòè!");
       rent = 0;
      }
      HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
     }
     if(PlayerInfo[i][pPayDay] >= 5)
     {
       if(PlayerInfo[i][pMember] == 1)
       {
           ServerGivePlayerMoney(i,500);
        }
        else if(PlayerInfo[i][pMember] == 2)
       {
           workpay = FbiSal * PlayerInfo[i][pRank];
           new Taxx = workpay * Tax / 50;
            PlayerInfo[i][pAccount] -= Taxx;
            Treasury += Taxx;
            Treasury -= workpay;
        }
        else if(PlayerInfo[i][pMember] == 3)
       {
           workpay = NGSal * PlayerInfo[i][pRank];
           new Taxx = workpay * Tax / 50;
            PlayerInfo[i][pAccount] -= Taxx;
            Treasury += Taxx;
            Treasury -= workpay;
        }
        else if(PlayerInfo[i][pMember] == 4)
       {
           workpay = MedSal * PlayerInfo[i][pRank];
           new Taxx = workpay * Tax / 50;
            PlayerInfo[i][pAccount] -= Taxx;
            Treasury += Taxx;
            Treasury -= workpay;

        }
        else if(PlayerInfo[i][pMember] == 7)
       {
           workpay = PolSal * PlayerInfo[i][pRank];
           new Taxx = workpay * Tax / 50;
            PlayerInfo[i][pAccount] -= Taxx;
            Treasury += Taxx;
            Treasury -= workpay;
        }
        else if(PlayerInfo[i][pMember] == 9)
       {
           workpay = ReportSal * PlayerInfo[i][pRank];
           new Taxx = workpay * Tax / 50;
            PlayerInfo[i][pAccount] -= Taxx;
            Treasury += Taxx;
            Treasury -= workpay;
        }
        else if(PlayerInfo[i][pMember] == 11)
       {
           workpay = LicSal * PlayerInfo[i][pRank];
           new Taxx = workpay * Tax / 50;
            PlayerInfo[i][pAccount] -= Taxx;
            Treasury += Taxx;
            Treasury -= workpay;
        }
        else if(PlayerInfo[i][pMember] == 17)
       {
           workpay = SwatSal * PlayerInfo[i][pRank];
           new Taxx = workpay * Tax / 50;
            PlayerInfo[i][pAccount] -= Taxx;
            Treasury += Taxx;
            Treasury -= workpay;
        }
                     else if(PlayerInfo[i][pPensija] == 1)
        {
            workpay += (CopSal * PlayerInfo[i][pRank]) / 2;
            Treasury -= workpay;
        }
        else if(PlayerInfo[i][pPensija] == 2)
        {
            workpay += (FbiSal * PlayerInfo[i][pRank]) / 2;
            Treasury -= workpay;
        }
        else if(PlayerInfo[i][pPensija] == 3)
        {
            workpay += (PolSal * PlayerInfo[i][pRank]) / 2;
            Treasury -= workpay;
        }
        else if(PlayerInfo[i][pPensija] == 4)
        {
            workpay += (MedSal * PlayerInfo[i][pRank]) / 2;
            Treasury -= workpay;
        }
        else if(PlayerInfo[i][pPensija] == 5)
        {
            workpay += (ReportSal * PlayerInfo[i][pRank]) / 2;
            Treasury -= workpay;
        }
        else if(PlayerInfo[i][pPensija] == 5)
        {
            workpay += (LicSal * PlayerInfo[i][pRank]) / 2;
            Treasury -= workpay;
        }
        else if(PlayerInfo[i][pPensija] == 8)
        {
            workpay += (NGSal * PlayerInfo[i][pRank]) / 2;
            Treasury -= workpay;
        }
        else
        {
            workpay = NonJobSal;
         }
         //Ñáðàñûâàåì âðåìÿ ðàáîò
         if(PlayerInfo[i][pOtkRabota1] > 0)
      {
       PlayerInfo[i][pOtkRabota1] -- ;
      }
      if(PlayerInfo[i][pOtkRabota2] > 0)
      {
          PlayerInfo[i][pOtkRabota2] -- ;
      }
      if(PlayerInfo[i][pOtkRabota3] > 0)
      {
          PlayerInfo[i][pOtkRabota3] -- ;
      }
      if(PlayerInfo[i][pOtkRabota7] > 0)
      {
          PlayerInfo[i][pOtkRabota7] -- ;
      }
      if(PlayerInfo[i][pOtkRabota8] > 0)
      {
          PlayerInfo[i][pOtkRabota8] -- ;
      }
      if(PlayerInfo[i][pOtkRabota12] > 0)
      {
          PlayerInfo[i][pOtkRabota12] -- ;
      }
      if(PlayerInfo[i][pOtkRabota14] > 0)
      {
                         PlayerInfo[i][pOtkRabota14] -- ;
      }
      if(PlayerInfo[i][pOtkRabota15] > 0)
      {
         PlayerInfo[i][pOtkRabota15] -- ;
      }
      if(PlayerInfo[i][pOtkRabota16] > 0)
      {
          PlayerInfo[i][pOtkRabota16] -- ;
      }
      if(PlayerInfo[i][pOtkRabota22] > 0)
      {
          PlayerInfo[i][pOtkRabota22] -- ;
      }
             if(PlayerInfo[i][pOtkRabota24] > 0)
      {
                 PlayerInfo[i][pOtkRabota24] -- ;
      }

         PlayerInfo[i][pAccount] += workpay;
         PlayerInfo[i][pAccount] -= Tax;
         PlayerInfo[i][pAccount] += interest;
      interest = PlayerInfo[i][pAccount]/1000;
      PlayerInfo[i][pExp]++;
      PlayerPlayMusic(i);
      new premia = 0;
         if(PlayerInfo[i][pJob] == 1 || PlayerInfo[i][pJob] == 2 || PlayerInfo[i][pJob] == 7 || PlayerInfo[i][pJob] == 8 || PlayerInfo[i][pJob] == 12
      || PlayerInfo[i][pJob] == 14 || PlayerInfo[i][pJob] == 15 || PlayerInfo[i][pJob] == 16 || PlayerInfo[i][pJob] == 22 || PlayerInfo[i][pJob] == 24)
      {
       premia = 50 + random(150);
       ServerGivePlayerMoney(i,premia);
      }
         SendClientMessage(i, COLOR_WHITE, "|_______Ðàñ÷¸ò_______|");
      if(IsAWorkGroup(i))
      {
       format(string, sizeof(string), "* Çàðïëàòà: $%d   Íàëîãè: -$%d  Ïðåìèÿ: $%d", workpay, Tax,premia);
       SendClientMessage(i, COLOR_GRAD1, string);
       }
       else
       {
           format(string, sizeof(string), "* Ïîñîáèå: $%d   Íàëîãè: -$%d  Ïðåìèÿ: $%d", workpay, Tax,premia);
       SendClientMessage(i, COLOR_GRAD1, string);
       }

       if(PlayerInfo[i][pMember] == 1||PlayerInfo[i][pMember] == 2||PlayerInfo[i][pMember] == 3)
      {
          if(qperc[i] > 0)
          {
              new quality;
           quality = qperc[i] * 50;
           PlayerInfo[i][pAccount] += quality;
           format(string, sizeof(string), "* Íàäáàâêà: $%d", quality);
        SendClientMessage(i, COLOR_GRAD1, string);
        qperc[i] = 0;
       }
       }
       if(PlayerInfo[i][pLevel] > 10)
      {
          oldm = 10 * PlayerInfo[i][pLevel];
       PlayerInfo[i][pAccount] += oldm;
          format(string, sizeof(string), "* Âûïëàòû îò Ãîñ-âà: $%d", oldm);
       SendClientMessage(i, COLOR_GRAD2, string);
       }
      if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255 ||PlayerInfo[i][pPapptkey] != 255)
      {
          PlayerInfo[i][pAccount] -= ebill;
       SBizzInfo[4][sbTill] += ebill;
          format(string, sizeof(string), "* Ýë. ýíåðãèÿ: -$%d", ebill);
       SendClientMessage(i, COLOR_GRAD1, string);
      }
      if(PlayerInfo[i][pPbiskey] != 255)
      {
          format(string, sizeof(string), "* Ïîäîõîäíûé íàëîã: -$%d", biztax);
       SendClientMessage(i, COLOR_GRAD1, string);
       PlayerInfo[i][pAccount] -= biztax;
      }
       SendClientMessage(i, COLOR_GRAD4, "|---------- ñ÷¸ò â áàíêå ---------------|");
      format(string, sizeof(string), "* Ñòàðûé áàëàíñ: $%d", account);
      SendClientMessage(i, COLOR_GRAD1, string);
      format(string, sizeof(string), " * Íîâûé áàëàíñ: $%d", PlayerInfo[i][pAccount]);
      SendClientMessage(i, COLOR_GRAD5, string);
      format(string, sizeof(string), "* Äîõîä: $%d", workpay);
      SendClientMessage(i, COLOR_GRAD3, string);
      SendClientMessage(i, COLOR_GRAD4, "|---------------------------------------|");
      format(string, sizeof(string), "* Çà êâàðòèðó: -$%d", rent);
      SendClientMessage(i, COLOR_GRAD5, string);
      format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
      GameTextForPlayer(i, string, 5000, 1);
      rent = 0;
      PlayerInfo[i][pPayDay] = 0;
      PlayerInfo[i][pPayCheck] = 0;
      PlayerInfo[i][pConnectTime] += 1;
                     adlimit[i] = 0;
      if(PlayerInfo[i][pExp] == levelexp*(PlayerInfo[i][pLevel]+1))
      {
          PlayerInfo[i][pExp] = 0;
          PlayerInfo[i][pLevel]++;
          PlayerInfo[i][gPupgrade] +=2;
          format(string, sizeof(string), "Bû äîñòèãëè %d óðîâíÿ.", PlayerInfo[i][pLevel]);
       SendClientMessage(i, COLOR_LIGHTBLUE , string);
          PlayerInfo[i][pAge]++;
                      format(string, sizeof(string), " Ñ Äí¸ì Ðîæäåíèÿ! Âû ïîñòàðåëè íà 1 ãîä, è òåïåðü Âàì %d.", PlayerInfo[i][pAge]);
                         SendClientMessage(i, COLOR_LIGHTBLUE , string);
       }
//------------------------------------------------------------------------------
         format(string, sizeof(string), "* Ó âàñ %d î÷./îï.", PlayerInfo[i][pExp]);
      SendClientMessage(i, COLOR_LIGHTBLUE , string);
      if(PlayerInfo[i][pNeSdal] == 1)
      {
          PlayerInfo[i][pNeSdal] = 0;
      }
      if(PlayerInfo[i][pAge] == 45)
                     {
                         SendClientMessage(i, COLOR_WHITE, "Íó âîò, Âàì óæå 45 ëåò. Òåïåðü Âû áîëüøå íå ðàáîòàåòå, à òîëüêî ïîëó÷àåòå ïåíñèþ.");
                         SendClientMessage(i, COLOR_WHITE, "Íå çíàþ, ïîçäðàâëÿòü Âàñ èëè íåò, ðåøàòü Âàì.  îáùåì óäà÷è.");
                         SendClientMessage(i, COLOR_WHITE, "Êîãäà Âàì èñïîëíèòñÿ 50 ëåò. Âû ñ êàæäûì ãîäîì ìîæåòå óìåðåòü îò ñòàðîñòè.");
                         PlayerInfo[i][pPensija] = PlayerInfo[i][pMember];
                         PlayerInfo[i][pMember] = 0;
                     }
      if(PlayerInfo[i][pAge] >= 50)
                     {
                         new chance = random(10);
                         if(chance > 0 && chance < 9)
                         {
                             return 1;
                         }
                         else
                         {
                             SendClientMessage(i, COLOR_WHITE, "Íó âîò, Âàøå âðåìÿ ïðèøëî. Âû óìåðëè îò ñòàðîñòè.");
                             SendClientMessage(i, COLOR_WHITE, "Çåìëÿ âàì áóäåò ïóõîì.");
                             PlayerInfo[i][pRPD] = 1;
                         }
                     }
     }
     else
     {
         SendClientMessage(i, COLOR_LIGHTRED, "* Âû ñëèøêîì ìàëî èãðàëè, ÷òîáû ïîëó÷èòü ÷åê.");
     }
    }
   }
  }
  Checkprop();
  return 1;
}


Мои работы:
Починка авто
GPS
 
  • Страница 1 из 1
  • 1
Поиск:


Copyright www.SAMP-TEAM.com (c) 2009-2024
Правила использования материалов сайта

При копировании материалов из нашего сайта
ссылка на www.SAMP-TEAM.com обязательна!
Нарушители правил будут строго наказаны!

Хостинг от uCoz   
Для корректного просмотра мы рекомендуем Вам использовать браузер Google Chrome.
Яндекс.Метрика
Яндекс.Метрика