Доступ к архиву

Переход в группу "Пользователь"

300.00
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info
Статус
В этой теме нельзя размещать новые ответы.

PIRU

The world on the edge of reality
Administrator
Регистрация
10 Ноя 2010
Сообщения
11,641
Лучшие ответы
39
Репутация
6,756
Награды
1
Ко всем forward добавить
PHP:
forward PropertyDialogs();
добавить public
PHP:
public PropertyDialogs()//by snoowker 
{ 
       new Float:oldposx, Float:oldposy, Float:oldposz; 
       new string[128]; 
       for(new i = 0; i < MAX_PLAYERS; i++) 
       { 
        if(IsPlayerConnected(i)) 
        { 
         GetPlayerPos(i, oldposx, oldposy, oldposz); 
         if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0) 
         { 
          for(new h = 0; h < sizeof(SBizzInfo); h++) 
          { 
           if(PlayerToPoint(2.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ])) 
           { 
            if(SBizzInfo[h][sbOwned] == 1) 
            { 
             format(string, sizeof(string), "Название: %s\nПлата за вход: $%d\n\nВладелец: %s\nExtortion by: %s\nLevel: %d",SBizzInfo[h][sbMessage],SBizzInfo[h][sbEntranceCost],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbLevelNeeded]); 
            } 
            else 
            { 
             format(string, sizeof(string), "Этот бизнес продаётся!\nНазвание: %s\nЦена: $%d\nLevel: %d\nВведите /buybiz для приобретения собственности.",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice],SBizzInfo[h][sbLevelNeeded]); 
            } 
            ShowPlayerDialog(i,27,DIALOG_STYLE_MSGBOX,"Информация о бизнесе",string,"ENTER","CANCEL"); 
            return 1; 
           } 
          } 
          for(new h = 0; h < sizeof(HouseInfo); h++) 
          { 
           if(PlayerToPoint(2.0, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez])) 
           { 
            if(HouseInfo[h][hOwned] == 1) 
            { 
             if(HouseInfo[h][hRentabil] == 0) 
             { 
              format(string, sizeof(string), "Владелец: %s\nLevel: %d\nID дома: %d",HouseInfo[h][hOwner],HouseInfo[h][hLevel],h); 
             } 
             else 
             { 
              format(string, sizeof(string), "Владелец: %s\nСтоимость аренды: $%d\nLevel: %d\nID дома: %d\nВведите /rentroom чтобы арендовать комнату.",HouseInfo[h][hOwner],HouseInfo[h][hRent],HouseInfo[h][hLevel], h); 
             } 
             ShowPlayerDialog(i,27,DIALOG_STYLE_MSGBOX,"Информация о доме",string,"ENTER","CANCEL"); 
             return 1; 
            } 
            else 
            { 
             format(string, sizeof(string), "Этот дом продается!\n\nОписание: %s\nЦена: $%d\nLevel: %d\nID дома: %d\nВведите /buyhouse для приобретения собственности.",HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel], h); 
            } 
            ShowPlayerDialog(i,27,DIALOG_STYLE_MSGBOX,"Информация о доме",string,"ENTER","CANCEL"); 
            return 1; 
           } 
          } 
          for(new h = 0; h < sizeof(BizzInfo); h++) 
          { 
           if(PlayerToPoint(2.0, i, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ])) 
           { 
            if(BizzInfo[h][bOwned] == 1) 
            { 
             format(string, sizeof(string), "Название:%s\nПлата за вход: $%d\n\nВладелец: %s\nExtortion by: %s\nУровень: %d",BizzInfo[h][bMessage],BizzInfo[h][bEntranceCost],BizzInfo[h][bOwner],BizzInfo[h][bExtortion],BizzInfo[h][bLevelNeeded]); 
            } 
            else 
            { 
             format(string, sizeof(string), "Этот бизнес продаётся!\n\nНазвание:%s\nЦена: $%d\nLevel: %d\nВведите /buybiz для приобретения собственности.",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice],BizzInfo[h][bLevelNeeded]); 
            } 
            ShowPlayerDialog(i,27,DIALOG_STYLE_MSGBOX,"Информация о бизнесе",string,"ENTER","CANCEL"); 
            return 1; 
           } 
          } 
         }//custompickups end 
        } 
       } 
       return 1; 
}
В public OnDialogResponse
PHP:
if(dialogid == 27)//by snoowker 
        { 
            if(response) 
            { 
         new string[256]; 
         for(new i = 0; i < sizeof(HouseInfo); i++) 
         { 
          if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez])) 
          { 
           //printf("Found House :%d",i); 
           if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0) 
           { 
            SetPlayerInterior(playerid,HouseInfo[i][hInt]); 
            SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]); 
            GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1); 
            PlayerInfo[playerid][pInt] = HouseInfo[i][hInt]; 
            PlayerInfo[playerid][pLocal] = i; 
           } 
           else 
           { 
            GameTextForPlayer(playerid, "~r~Locked", 5000, 1); 
           } 
          } 
         } 
         for(new i = 0; i < sizeof(BizzInfo); i++) 
         { 
          if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ])) 
          { 
           //printf("Found House :%d",i); 
           /*if(!IsACop(playerid) && i == 3) 
           { 
               SendClientMessage(playerid, COLOR_GREY, "   Только для копов !"); 
               return 1; 
           }*/ 
           if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost]) 
           { 
            if(PlayerInfo[playerid][pPbiskey] != i) 
            { 
             if(BizzInfo[i][bLocked] == 1) 
             { 
              GameTextForPlayer(playerid, "~r~Closed", 5000, 1); 
              return 1; 
             } 
             if(BizzInfo[i][bProducts] == 0) 
             { 
              GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1); 
              return 1; 
             } 
             GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]); 
             format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]); 
             BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost]; 
             ExtortionBiz(i, BizzInfo[i][bEntranceCost]); 
             BizzInfo[i][bProducts]--; 
             OnPropUpdate(); 
             GameTextForPlayer(playerid, string, 5000, 3); 
            } 
            SetPlayerInterior(playerid,BizzInfo[i][bInterior]); 
            SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]); 
            PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior]; 
            PlayerInfo[playerid][pLocal] = i+99; 
            new dood[MAX_PLAYER_NAME]; 
            GetPlayerName(playerid, dood, sizeof(dood)); 
            format(string, sizeof(string), "%s payed $%d to enter biz %d", dood, BizzInfo[i][bEntranceCost], i); 
            printf("%s", string); 
            PayLog(string); 
            //PlayerInfo[playerid][pLocal] = i; 
           } 
           else 
           { 
            GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1); 
           } 
          } 
         } 
         for(new i = 0; i < sizeof(SBizzInfo); i++) 
         { 
          if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ])) 
          { 
           if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost]) 
           { 
            if(PlayerInfo[playerid][pPbiskey] != i) 
            { 
             if(SBizzInfo[i][sbLocked] == 1) 
             { 
              GameTextForPlayer(playerid, "~r~Closed", 5000, 1); 
              return 1; 
             } 
             if(SBizzInfo[i][sbProducts] == 0) 
             { 
              GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1); 
              return 1; 
             } 
             if(i == 10) 
             { 
                 PaintballPlayers ++; 
                 PlayerPaintballing[playerid] = 1; 
                 new rand = random(sizeof(PaintballSpawns)); 
              SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]); 
              TogglePlayerControllable(playerid, 0); 
             } 
             else if(i == 11) 
             { 
                 PlayerKarting[playerid] = 1; 
                 SendClientMessage(playerid, TEAM_GROVE_COLOR, "Теперь Вы можете участвовать в гонках на картах, садитесь в карт."); 
             } 
             else 
             { 
                 return 1; 
             } 
             GivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]); 
             gSpentCash[playerid] = GetPlayerMoney(playerid); 
             SBizzInfo[i][sbProducts]--; 
             SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost]; 
             ExtortionSBiz(i, SBizzInfo[i][sbEntranceCost]); 
             new dood[MAX_PLAYER_NAME]; 
             GetPlayerName(playerid, dood, sizeof(dood)); 
             format(string, sizeof(string), "%s payed $%d to enter sbiz %d", dood, SBizzInfo[i][sbEntranceCost], i); 
             printf("%s", string); 
             PayLog(string); 
             OnPropUpdate(); 
            } 
           } 
           else 
           { 
            GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1); 
           } 
          } 
         } 
        } 
        else 
        { 
            // -_- 
            return 1; 
        } 
       }
И не забудьте заменить ид диалога на свой.
27 - ИД диалога, в ShowPlayerDialog(i, вместо 27 поставьте свой ид диалога
В dialogid == 27 так-же поставьте свой ид диалога.

В public OnGameModeInIt вставляем
PHP:
SetTimer("PropertyDialogs",5000,1);//by snoowker
Автор: Snoowker
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу