• Страница 1 из 1
  • 1
[GF]Война за бизнесы
ZioHikДата: Среда, 11.07.2012, 00:13 | Сообщение # 1
.::Offline::.
http://u.to/N46EAw
Сообщений: 831
[ 82 ]
Награды: 29

Статус отсутствует
Вверх мода ко все new:

Code
new OnmZONE[1][20];    
new ZoneOnBattlem[1];    
new ZoneTimerm[1];    
new allowedmfactions[] = { 5,6, 14};    
new MZSafeTime[1];    
new FrakCDm[20];    
enum MzoneInfo    
{    
      mFrakVlad,    
      mNapad,    
}    
new MZInfo[1][MzoneInfo];   

new war = 0;    
new startwar = 0;    
new zons;     
   


Добавляем forwardы:

Code
forward ISAMAFIA(playerid);
forward MzCheck();
   


Создаем public:

Code
public MzCheck()    
{    
      
      for(new i =0;i<sizeof(MZInfo);i++)    
      {    
          if(ZoneOnBattlem[i] == 1 && MZSafeTime[i] == 0)    
          {    
              ZoneTimerm[i] -=10;    
              if(ZoneTimerm[i] <=0)    
              {    
                  for(new h = 0; h < sizeof(BizzInfo); h++)    
                  {    
                  if(BizzInfo[h][bZahvat] == 1)    
                  {    
                  BizzInfo[h][bMafia] = BizzInfo[h][bMafia];    
                  SendFamilyMessage(BizzInfo[h][bMafia],COLOR_GREEN,":: Вам удалось отстоять свой бизнес ::");    
                  BizzInfo[h][bZahvat] = 0;    
                  }    
                  }    
                  SendFamilyMessage(MZInfo[i][mNapad],COLOR_RED,":: Вам не удалось взять под контроль новый бизнес ::");    
                  startwar = 0;    
                  ZoneOnBattlem[i] =0;    
                  GangZoneStopFlashForAll(zons);    
              }    
              for(new x =0;x<MAX_PLAYERS;x++)    
              {    
                  if(PlayerToKvadrat(x,328.755706, 2412.644531, 448.755706, 2564.644531))    
                  {    
                      new factionm;    
                      if(PlayerInfo[x][pLeader] !=0) {factionm = PlayerInfo[x][pLeader];}    
                      else { factionm = PlayerInfo[x][pMember];}    
                      OnmZONE[i][factionm] ++;    
                  }    
              }    
              new asd;    
              for(new x =0;x<20;x++)    
              {    
                  if(OnmZONE[i][x] > 0 && IsInAllowedM(x)) asd ++;    
              }    
              if(asd == 1)    
              {    
                  for(new x =0;x<20;x++)    
                  {    
                      if(OnmZONE[i][x] > 0)    
                      {    
                          new zx,zl;    
                          zx = x;    
                          zl = i;    
                          if(MZInfo[i][mFrakVlad] == x)    
                          {    
                           for(new h = 0; h < sizeof(BizzInfo); h++)    
                          {    
                          if(BizzInfo[h][bZahvat] == 1)    
                          {    
                          BizzInfo[h][bMafia] = BizzInfo[h][bMafia];    
                          SendFamilyMessage(BizzInfo[h][bMafia],COLOR_RED,":: Вы отстояли свой бизнес ::");    
                          BizzInfo[h][bZahvat] = 0;    
                          }    
                          }    
                          startwar = 0;    
                          SendFamilyMessage(MZInfo[i][mNapad],COLOR_RED,":: Вам не удалось завоевать ещё один бизнес ::");    
                          }    
                          else    
                          {    
                          startwar = 0;    
                          SendFamilyMessage(MZInfo[i][mNapad],COLOR_LIGHTGREEN,":: Вы завоевали новый бизнес ::");    
                          for(new h = 0; h < sizeof(BizzInfo); h++)    
                          {    
                          if(BizzInfo[h][bZahvat] == 1)    
                          {    
                            SendFamilyMessage(BizzInfo[h][bMafia],COLOR_RED,":: Вы потеряли контроль над одним из своих бизнесов ::");    
                          BizzInfo[h][bMafia] = MZInfo[i][mNapad];    
                          BizzInfo[h][bZahvat] = 0;    
                          }    
                          }    
                          }    
                          ZoneOnBattlem[zl] =0;    
                          MZInfo[zl][mFrakVlad] = 0;    
                          MZInfo[zl][mFrakVlad] = zx;    
                          GangZoneStopFlashForAll(zons);    
                          GangZoneHideForAll(zons);    
                          GangZoneShowForAll(zons,COLOR_NEWS);    
                          break;    
                      }    
                  }    
              }    
          }    
      }    
      for(new i =0;i<3;i++)    
      {    
          for(new z = 0;z<20;z++)    
          {    
              OnmZONE[i][z] =0;    
          }    
      }    
}    


В SetPlayerUnjail():(если есть,если нету создать таймер с обновлением 1 секунда)

Code
for(new f =0;f<3;f++)    
      {    
          if(MZSafeTime[f]>0)    
          {    
              MZSafeTime[f] --;    
              if(MZSafeTime[f] == 200 || MZSafeTime[f] == 450)    
              {    
                  format(string,sizeof(string),"::: У вас осталось %d секунд. Место встречи: Заброшенный аэропорт:::",MZSafeTime[f]);    
                  SendFamilyMessage(MZInfo[f][mNapad],COLOR_RED,string);    
                  for(new h = 0; h < sizeof(BizzInfo); h++)    
                  {    
                  if(BizzInfo[h][bZahvat] == 1)    
                  {    
                  SendFamilyMessage(BizzInfo[h][bMafia],COLOR_RED,string);    
                  }    
                  }    
              }    
          }    
      }  


В OnGameModeInit():

Code
SetTimer("MzCheck",10000,1);   


Теперь добавьте команды:

Code
if(strcmp(cmd, "/bizwar", true) == 0)    
      {    
      new factionm=0;    
      if(PlayerInfo[playerid][pLeader] !=0){ factionm = PlayerInfo[playerid][pLeader];}    
      else if(PlayerInfo[playerid][pMember] != 0 && PlayerInfo[playerid][pLeader] == 0) {factionm = PlayerInfo[playerid][pMember];}    
      else {factionm = 0;}    
      if(ISAMAFIA(playerid))    
      {    
      if(startwar == 1) return SendClientMessage(playerid, COLOR_WHITE, "Война уже начата!");    
      //if(FrakCDm[factionm] > 0) return SendClientMessage(playerid, COLOR_GRAD1, "Следующий захват возможен через пол часа...");    
      for(new h = 0; h < sizeof(BizzInfo); h++)    
      {    
      if(PlayerInfo[playerid][pMember] == 5 && PlayerInfo[playerid][pRank] >= 7 || PlayerInfo[playerid][pMember] == 6 && PlayerInfo[playerid][pRank] >= 7 || PlayerInfo[playerid][pMember] == 14 && PlayerInfo[playerid][pRank] >= 7)    
      {    
      if(PlayerToPoint(3, playerid,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]) && BizzInfo[h][bMafia] != PlayerInfo[playerid][pMember])    
      {    
      if(war > 0)    
      {    
      format(string,sizeof(string),"::: Войну можно начать через %d секунд(ы):::",war);    
      SendClientMessage(playerid,-1,string);    
      return 1;    
      }    
      if(BizzInfo[h][bMafia] == 0)    
      {    
      BizzInfo[h][bMafia] = PlayerInfo[playerid][pMember];    
      SendClientMessage(playerid, COLOR_WHITE, "::: Бизнес взят под контроль :::");    
      return 1;    
       }    
      if(BizzInfo[h][bMafia] > 0)    
      {    
      startwar = 1;    
      format(string,sizeof(string),"%s назначил стрелу за %s мафии %s",Name(playerid),BizzInfo[h][bMessage],GetMafiaName(BizzInfo[h][bMafia]));    
      SendFamilyMessage(PlayerInfo[playerid][pMember],COLOR_RED,string);    
      format(string,sizeof(string),"::: Бизнес %s захватывает мафия %s :::",BizzInfo[h][bMessage],GetMafiaName(PlayerInfo[playerid][pMember]));    
      SendFamilyMessage(BizzInfo[h][bMafia],COLOR_RED,string);    
      SendFamilyMessage(BizzInfo[h][bMafia],COLOR_WHITE,"Место встречи - Заброшенный аэропорт");    
      SendFamilyMessage(BizzInfo[h][bMafia],COLOR_WHITE,"У Вас есть 10 минуты, чтобы отбить бизнес...");    
      BizzInfo[h][bZahvat] = 1;    
      war = 1200;    
      MZSafeTime[0] = 600;    
      FrakCDm[factionm]  = 1800;    
      MZInfo[0][mNapad] = PlayerInfo[playerid][pMember];    
      ZoneTimerm[0] = 130;    
      ZoneOnBattlem[0] = 1;    
      zons = GangZoneCreate(328.755706, 2412.644531, 448.755706, 2564.644531);    
      GangZoneShowForAll(zons, COLOR_NEWS);    
      GangZoneFlashForAll(zons,COLOR_REDD);    
      }    
      }    
       }    
       }    
       }    
      return 1;    
}    
if(strcmp(cmd, "/bizlist", true) == 0)    
      {    
      SendClientMessage(playerid, COLOR_YELLOW2, "Завоёваные Бизнесы");    
      for(new h = 0; h < sizeof(BizzInfo); h++)    
      {    
      switch(PlayerInfo[playerid][pMember])    
      {    
      case 6:    
      {    
                      format(string, sizeof(string), "");    
                      if (BizzInfo[h][bMafia] == 6) format(string, sizeof(string), "- %s",BizzInfo[h][bMessage]);    
                      if (strlen(string) > 1) SendClientMessage(playerid, COLOR_YELLOW2, string);    
      }    
      case 5:    
      {    
                      format(string, sizeof(string), "");    
                      if (BizzInfo[h][bMafia] == 5) format(string, sizeof(string), "- %s",BizzInfo[h][bMessage]);    
                      if (strlen(string) > 1) SendClientMessage(playerid, COLOR_YELLOW2, string);    
      }    
      case 14:    
      {    
                      format(string, sizeof(string), "");    
                      if (BizzInfo[h][bMafia] == 14) format(string, sizeof(string), "- %s",BizzInfo[h][bMessage]);    
                      if (strlen(string) > 1) SendClientMessage(playerid, COLOR_YELLOW2, string);    
      }    
      }    
       }    
      return 1;     
      }  


В конец enum bInfo:

Code
bMafia,    
bZahvat


В конец enum sbInfo:

Code
sbLevelNeeded


Добавьте public:

Code
public ISAMAFIA(playerid)    
{    
      if(IsPlayerConnected(playerid))    
      {    
          new leader = PlayerInfo[playerid][pLeader];    
          new member = PlayerInfo[playerid][pMember];    
          if(member==5 || member==6 || member==14 )    
          {    
              return 1;    
          }    
          if(leader==5|| leader==6 || leader==14)    
          {    
              return 1;    
          }    
      }    
      return 0;    
}


Создаем stockи:

Code
stock GetMafiaName(fnumbwer)    
{    
      new string[256];    
      switch(fnumbwer)    
      {    
          case 6: format(string,sizeof(string),"Yakuza");    
          case 14: format(string,sizeof(string),"Russian Mafia");    
          case 5: format(string,sizeof(string),"LCN");    
      }    
      return string;    
}


Code
stock IsInAllowedM(mnumbers)     
{     
      for(new i =0;i<sizeof(allowedmfactions);i++)     
      {     
          if(mnumbers == allowedmfactions[i]) return 1;     
      }     
      return 0;     
}  
 
troyzn1996Дата: Пятница, 24.06.2016, 22:21 | Сообщение # 2
.::Offline::.
Новичок
Сообщений: 1
[ 0 ]
Награды: 0

Статус отсутствует
Помогите ПЖ поставить!!! а то ошибки выдаёт

Код

D:\Всё для проекта SAMP [ZINGER]\SENSATION\1\gamemodes\ST.pwn(2280) : error 021: symbol already defined: "sbLevelNeeded"
D:\Всё для проекта SAMP [ZINGER]\SENSATION\1\gamemodes\ST.pwn(3236) : error 017: undefined symbol "PlayerToKvadrat"
D:\Всё для проекта SAMP [ZINGER]\SENSATION\1\gamemodes\ST.pwn(35071) : error 017: undefined symbol "COLOR_REDD"
Pawn compiler 3.2.3664     Copyright (c) 1997-2006, ITB CompuPhase

3 Errors.
мой скайп Blazer681 Заранее большое спасибо


Сообщение отредактировал troyzn1996 - Пятница, 24.06.2016, 22:21
 
  • Страница 1 из 1
  • 1
Поиск:


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

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

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