[Урок] Создание дипломатии банд. - Форум Cheat-Master.ru
  • Страница 1 из 1
  • 1
Модератор форума: Phoenixxx_Czar, Getbackthere, [CM]OlegEhtler  
[Урок] Создание дипломатии банд.
[CM]ExtazZz Дата: Суббота, 29.09.2012, 13:32 | Сообщение # 1
Боец
Сообщений: 158
Статус: Offline
/diplomation
http://roleplay-samp.ucoz.com/sa-mp-045.png

Начнём

Ко всем forward'ам
Code
forward LoadDip();
forward SaveDip();


Ко всем new
Code
new TotalGzR;//rifa  
new TotalGzA;//actek  
new TotalGzB;//ballas  
new TotalGzG;//grove  
new TotalGzV;//vagos  
enum dInfo
{
     dRGrove,
  dRAztec,
  dRVagos,
  dRBallas,
  //
  dBGrove,
  dBAztec,
  dBVagos,
  dBRifa,
  //
  dAGrove,
  dAVagos,
  dABallas,
  dARifa,
  //
  dGRifa,
  dGAztec,
  dGVagos,
  dGBallas,
  //
  dVGrove,
  dVAztec,
  dVBallas,
  dVRifa,
};
new Dip[1][dInfo];

public LoadDip()
{
    new iniFile = ini_openFile("logs/LoadDip.cfg");
    ini_getInteger(iniFile,"Dip[0][dRGrove]",Dip[0][dRGrove]);
    ini_getInteger(iniFile,"Dip[0][dRAztec]",Dip[0][dRAztec]);
    ini_getInteger(iniFile,"Dip[0][dRVagos]",Dip[0][dRVagos]);
    ini_getInteger(iniFile,"Dip[0][dRBallas]",Dip[0][dRBallas]);
    //
    ini_getInteger(iniFile,"Dip[0][dBGrove]",Dip[0][dBGrove]);
    ini_getInteger(iniFile,"Dip[0][dBAztec]",Dip[0][dBAztec]);
    ini_getInteger(iniFile,"Dip[0][dBVagos]",Dip[0][dBVagos]);
    ini_getInteger(iniFile,"Dip[0][dBRifa]",Dip[0][dBRifa]);
    //
    ini_getInteger(iniFile,"Dip[0][dAGrove]",Dip[0][dAGrove]);
    ini_getInteger(iniFile,"Dip[0][dAVagos]",Dip[0][dAVagos]);
    ini_getInteger(iniFile,"Dip[0][dABallas]",Dip[0][dABallas]);
    ini_getInteger(iniFile,"Dip[0][dARifa]",Dip[0][dARifa]);
    //
    ini_getInteger(iniFile,"Dip[0][dGRifa]",Dip[0][dGRifa]);
    ini_getInteger(iniFile,"Dip[0][dGAztec]",Dip[0][dGAztec]);
    ini_getInteger(iniFile,"Dip[0][dGVagos]",Dip[0][dGVagos]);
    ini_getInteger(iniFile,"Dip[0][dGBallas]",Dip[0][dGBallas]);
    //
    ini_getInteger(iniFile,"Dip[0][dVGrove]",Dip[0][dVGrove]);
    ini_getInteger(iniFile,"Dip[0][dVAztec]",Dip[0][dVAztec]);
    ini_getInteger(iniFile,"Dip[0][dVBallas]",Dip[0][dVBallas]);
    ini_getInteger(iniFile,"Dip[0][dVRifa]",Dip[0][dVRifa]);
    ini_closeFile(iniFile);
return 1;
}
public SaveDip()
{
       new iniFile = ini_openFile("logs/LoadDip.cfg");
       ini_setInteger(iniFile, "Dip[0][dRGrove]",Dip[0][dRGrove]);
       ini_setInteger(iniFile, "Dip[0][dRAztec]",Dip[0][dRAztec]);
       ini_setInteger(iniFile, "Dip[0][dRVagos]",Dip[0][dRVagos]);
       ini_setInteger(iniFile, "Dip[0][dRBallas]",Dip[0][dRBallas]);
       //                        
       ini_setInteger(iniFile, "Dip[0][dBGrove]",Dip[0][dBGrove]);
       ini_setInteger(iniFile, "Dip[0][dBAztec]",Dip[0][dBAztec]);
       ini_setInteger(iniFile, "Dip[0][dBVagos]",Dip[0][dBVagos]);
       ini_setInteger(iniFile, "Dip[0][dBRifa]",Dip[0][dBRifa]);
       //                        
       ini_setInteger(iniFile, "Dip[0][dAGrove]",Dip[0][dAGrove]);
       ini_setInteger(iniFile, "Dip[0][dAVagos]",Dip[0][dAVagos]);
       ini_setInteger(iniFile, "Dip[0][dABallas]",Dip[0][dABallas]);
       ini_setInteger(iniFile, "Dip[0][dARifa]",Dip[0][dARifa]);
       //                        
       ini_setInteger(iniFile, "Dip[0][dGRifa]",Dip[0][dGRifa]);
       ini_setInteger(iniFile, "Dip[0][dGAztec]",Dip[0][dGAztec]);
       ini_setInteger(iniFile, "Dip[0][dGVagos]",Dip[0][dGVagos]);
       ini_setInteger(iniFile, "Dip[0][dGBallas]",Dip[0][dGBallas]);
       //                        
       ini_setInteger(iniFile, "Dip[0][dVGrove]",Dip[0][dVGrove]);
       ini_setInteger(iniFile, "Dip[0][dVAztec]",Dip[0][dVAztec]);
       ini_setInteger(iniFile, "Dip[0][dVBallas]",Dip[0][dVBallas]);
       ini_setInteger(iniFile, "Dip[0][dVRifa]",Dip[0][dVRifa]);     
       ini_closeFile(iniFile);   
       return 1;
}


В public OnGameModeInit() добавим
Code
LoadDip();


В public PayDay() добавим
Code
if(GZInfo[i][gFrakVlad] == 18) TotalGzR++;  
           if(GZInfo[i][gFrakVlad] == 17) TotalGzA++;  
           if(GZInfo[i][gFrakVlad] == 15) TotalGzG++;  
           if(GZInfo[i][gFrakVlad] == 13) TotalGzV++;  
           if(GZInfo[i][gFrakVlad] == 12) TotalGzB++;  
           FracBank[0][fGrove] += TotalGzG*300;  
           FracBank[0][fBallas] += TotalGzB*300;  
           FracBank[0][fVagos] += TotalGzV*300;  
           FracBank[0][fAztek] += TotalGzA*300;  
           FracBank[0][fRifa] += TotalGzR*300;  
           ClearTotalGz();  
           SaveBankFrac();


В конец мода
Code
forward ClearTotalGz();
stock ClearTotalGz()
{
     TotalGzR = 0;//rifa
     TotalGzA = 0;//actek
     TotalGzB = 0;//ballas
     TotalGzG = 0;//grove
     TotalGzV = 0;//vagos
     printr("ClearTotalGz");
}


Добавим команду /ginfo
Code
if(strcmp(cmd,"/ginfo", true)== 0)  
     {  
         if(IsPlayerConnected(playerid))  
         {  
             if(IsAGang(playerid))  
             {  
                 ClearTotalGz();  
                 for(new i =0;i<sizeof(GZInfo);i++)  
                 {  
                     if(GZInfo[i][gFrakVlad] == 18) TotalGzR++;  
                     if(GZInfo[i][gFrakVlad] == 17) TotalGzA++;  
                     if(GZInfo[i][gFrakVlad] == 15) TotalGzG++;  
                     if(GZInfo[i][gFrakVlad] == 13) TotalGzV++;  
                     if(GZInfo[i][gFrakVlad] == 12) TotalGzB++;  
                 }  
                 ////////////////////////Vagos/////////////////////////////
                 new BallasDipV[32];//Ballas
               if(Dip[0][dVBallas] == 0) { BallasDipV = "{ffffff}Нейтрал"; }
               else if(Dip[0][dVBallas] == 1) { BallasDipV = "{00BF36}Союз"; }
               else if(Dip[0][dVBallas] == 2) { BallasDipV = "{C43E3E}Война"; }
               new GroveDipV[32];//Grove
               if(Dip[0][dVGrove] == 0) { GroveDipV = "{ffffff}Нейтрал"; }
               else if(Dip[0][dVGrove] == 1) { GroveDipV = "{00BF36}Союз"; }
               else if(Dip[0][dVGrove] == 2) { GroveDipV = "{C43E3E}Война"; }
               new AztecDipV[32];//Aztec
               if(Dip[0][dVAztec] == 0) { AztecDipV = "{ffffff}Нейтрал"; }
               else if(Dip[0][dVAztec] == 1) { AztecDipV = "{00BF36}Союз"; }
               else if(Dip[0][dVAztec] == 2) { AztecDipV = "{C43E3E}Война"; }
               new RifaDipV[32];//Rifa
               if(Dip[0][dVRifa] == 0) { RifaDipV = "{ffffff}Нейтрал"; }
               else if(Dip[0][dVRifa] == 1) { RifaDipV = "{00BF36}Союз"; }
               else if(Dip[0][dVRifa] == 2) { RifaDipV = "{C43E3E}Война"; }
               ////////////////////////Ballas//////////////////////////////
               new VagosDipB[32];//Vagos
               if(Dip[0][dBVagos] == 0) { VagosDipB = "{ffffff}Нейтрал"; }
               else if(Dip[0][dBVagos] == 1) { VagosDipB = "{00BF36}Союз"; }
               else if(Dip[0][dBVagos] == 2) { VagosDipB = "{C43E3E}Война"; }
               new GroveDipB[32];//Grove
               if(Dip[0][dBGrove] == 0) { GroveDipB = "{ffffff}Нейтрал"; }
               else if(Dip[0][dBGrove] == 1) { GroveDipB = "{00BF36}Союз"; }
               else if(Dip[0][dBGrove] == 2) { GroveDipB = "{C43E3E}Война"; }
               new AztecDipB[32];//Aztec
               if(Dip[0][dBAztec] == 0) { AztecDipB = "{ffffff}Нейтрал"; }
               else if(Dip[0][dBAztec] == 1) { AztecDipB = "{00BF36}Союз"; }
               else if(Dip[0][dBAztec] == 2) { AztecDipB = "{C43E3E}Война"; }
               new RifaDipB[32];//Rifa
               if(Dip[0][dBRifa] == 0) { RifaDipB = "{ffffff}Нейтрал"; }
               else if(Dip[0][dBRifa] == 1) { RifaDipB = "{00BF36}Союз"; }
               else if(Dip[0][dBRifa] == 2) { RifaDipB = "{C43E3E}Война"; }
               /////////////////////////Grove////////////////////////////
               new VagosDipG[32];//Vagos
               if(Dip[0][dGVagos] == 0) { VagosDipG = "{ffffff}Нейтрал"; }
               else if(Dip[0][dGVagos] == 1) { VagosDipG = "{00BF36}Союз"; }
               else if(Dip[0][dGVagos] == 2) { VagosDipG = "{C43E3E}Война"; }
               new AztecDipG[32];//Aztec
               if(Dip[0][dGAztec] == 0) { AztecDipG = "{ffffff}Нейтрал"; }
               else if(Dip[0][dGAztec] == 1) { AztecDipG = "{00BF36}Союз"; }
               else if(Dip[0][dGAztec] == 2) { AztecDipG = "{C43E3E}Война"; }
               new BallasDipG[32];//Ballas
               if(Dip[0][dGBallas] == 0) { BallasDipG = "{ffffff}Нейтрал"; }
               else if(Dip[0][dGBallas] == 1) { BallasDipG = "{00BF36}Союз"; }
               else if(Dip[0][dGBallas] == 2) { BallasDipG = "{C43E3E}Война"; }
               new RifaDipG[32];//Rifa
               if(Dip[0][dGRifa] == 0) { RifaDipG = "{ffffff}Нейтрал"; }
               else if(Dip[0][dGRifa] == 1) { RifaDipG = "{00BF36}Союз"; }
               else if(Dip[0][dGRifa] == 2) { RifaDipG = "{C43E3E}Война"; }
               //////////////////////////Aztec//////////////////////////
               new BallasDipA[32];//Ballas
               if(Dip[0][dABallas] == 0) { BallasDipA = "{ffffff}Нейтрал"; }
               else if(Dip[0][dABallas] == 1) { BallasDipA = "{00BF36}Союз"; }
               else if(Dip[0][dABallas] == 2) { BallasDipA = "{C43E3E}Война"; }
               new VagosDipA[32];//Vagos
               if(Dip[0][dAVagos] == 0) { VagosDipA = "{ffffff}Нейтрал"; }
               else if(Dip[0][dAVagos] == 1) { VagosDipA = "{00BF36}Союз"; }
               else if(Dip[0][dAVagos] == 2) { VagosDipA = "{C43E3E}Война"; }
               new GroveDipA[32];//Grove
               if(Dip[0][dAGrove] == 0) { GroveDipA = "{ffffff}Нейтрал"; }
               else if(Dip[0][dAGrove] == 1) { GroveDipA = "{00BF36}Союз"; }
               else if(Dip[0][dAGrove] == 2) { GroveDipA = "{C43E3E}Война"; }
               new RifaDipA[32];//Rifa
               if(Dip[0][dARifa] == 0) { RifaDipA = "{ffffff}Нейтрал"; }
               else if(Dip[0][dARifa] == 1) { RifaDipA = "{00BF36}Союз"; }
               else if(Dip[0][dARifa] == 2) { RifaDipA = "{C43E3E}Война"; }
               /////////////////////////Rifa//////////////////////////////
               new BallasDipR[32];//Ballas
               if(Dip[0][dRBallas] == 0) { BallasDipR = "{ffffff}Нейтрал"; }
               else if(Dip[0][dRBallas] == 1) { BallasDipR = "{00BF36}Союз"; }
               else if(Dip[0][dRBallas] == 2) { BallasDipR = "{C43E3E}Война"; }
               new VagosDipR[32];//Vagos
               if(Dip[0][dRVagos] == 0) { VagosDipR = "{ffffff}Нейтрал"; }
               else if(Dip[0][dRVagos] == 1) { VagosDipR = "{00BF36}Союз"; }
               else if(Dip[0][dRVagos] == 2) { VagosDipR = "{C43E3E}Война"; }
               new GroveDipR[32];//Grove
               if(Dip[0][dRGrove] == 0) { GroveDipR = "{ffffff}Нейтрал"; }
               else if(Dip[0][dRGrove] == 1) { GroveDipR = "{00BF36}Союз"; }
               else if(Dip[0][dRGrove] == 2) { GroveDipR = "{C43E3E}Война"; }
               new AztecDipR[32];//Aztec
               if(Dip[0][dRAztec] == 0) { AztecDipR = "{ffffff}Нейтрал"; }
               else if(Dip[0][dRAztec] == 1) { AztecDipR = "{00BF36}Союз"; }
               else if(Dip[0][dRAztec] == 2) { AztecDipR = "{C43E3E}Война"; }
               ///////////////////////////////////////////////////////
               switch(PlayerInfo[playerid][pMember])  
                 {  
                     case 13:  
                     {  
                         format(string, sizeof(string),"{ffffff}Количество контролируемых кварталов: {DBD604}%d\n{ffffff}Ежедневный доход(в payday): {DBD604}$%d\n{ffffff}Баланс банка банды: {DBD604}%d\n\n{0B9B17}Grove %s\n{3582AE}Rifa %s\n{A600C0}Ballas %s\n{05DADA}Aztec %s",TotalGzV,TotalGzV*300,FracBank[0][fVagos],GroveDipV,RifaDipV,BallasDipV,AztecDipV);  
                         ShowPlayerDialog(playerid,1043,DIALOG_STYLE_MSGBOX,"The Vagos Gang",string, "X", "");  
                     }  
                     case 12:  
                     {  
                         format(string, sizeof(string),"{ffffff}Количество контролируемых кварталов: {B313E7}%d\n{ffffff}Ежедневный доход(в payday): {B313E7}$%d\n{ffffff}Баланс банка банды: {B313E7}%d\n\n{0B9B17}Grove %s\n{3582AE}Rifa %s\n{05DADA}Aztec %s\n{CCEB04}Vagos %s",TotalGzB,TotalGzB*300,FracBank[0][fBallas],GroveDipB,RifaDipB,AztecDipB,VagosDipB);  
                         ShowPlayerDialog(playerid,1042,DIALOG_STYLE_MSGBOX,"The Ballas Gang",string, "X", "");  
                     }  
                     case 15:  
                     {  
                         format(string, sizeof(string),"{ffffff}Количество контролируемых кварталов: {009F00}%d\n{ffffff}Ежедневный доход(в payday): {009F00}$%d\n{ffffff}Баланс банка банды: {009F00}%d\n\n{05DADA}Aztec %s\n{3582AE}Rifa %s\n{A600C0}Ballas %s\n{CCEB04}Vagos %s",TotalGzG,TotalGzG*300,FracBank[0][fGrove],AztecDipG,RifaDipG,BallasDipG,VagosDipG);  
                         ShowPlayerDialog(playerid,1045,DIALOG_STYLE_MSGBOX,"The Grove Street Gang",string, "X", "");  
                     }  
                     case 17:  
                     {
                         format(string, sizeof(string),"{ffffff}Количество контролируемых кварталов: {30d5c8}%d\n{ffffff}Ежедневный доход(в payday): {30d5c8}$%d\n{ffffff}Баланс банка банды: {30d5c8}%d\n\n{0B9B17}Grove %s\n{3582AE}Rifa %s\n{A600C0}Ballas %s\n{CCEB04}Vagos %s",TotalGzA,TotalGzA*300,FracBank[0][fAztek],GroveDipA,RifaDipA,BallasDipA,VagosDipA);  
                         ShowPlayerDialog(playerid,1047,DIALOG_STYLE_MSGBOX,"The Aztecas Gang",string, "X", "");  
                     }
                     case 18:  
                     {  
                         format(string, sizeof(string),"{ffffff}Количество контролируемых кварталов: {2A9170}%d\n{ffffff}Ежедневный доход(в payday): {2A9170}$%d\n{ffffff}Баланс банка банды: {2A9170}%d\n\n{0B9B17}Grove %s\n{05DADA}Aztec %s\n{A600C0}Ballas %s\n{CCEB04}Vagos %s",TotalGzR,TotalGzR*300,FracBank[0][fRifa],GroveDipR,AztecDipR,BallasDipR,VagosDipR);
                         ShowPlayerDialog(playerid,1048,DIALOG_STYLE_MSGBOX,"The Rifa Gang Gang",string, "X", "");  
                     }  
                 }  
                 ClearTotalGz();  
             }  
             return true;  
         }  
     }


И команду /diplomation
Code
else if (strcmp("/diplomation", cmdtext, true) == 0)
  {
  if(PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pLeader] == 18)
  {
  ShowPlayerDialog(playerid, 11100, DIALOG_STYLE_LIST, "Дипломатия","[1]-Война\n[2]-Нейтрал\n[3]-Союз", "Далее", "Выход");
  }
  }
}


Далее скачиваем файл case_Dip.ini Вот от сюда http://roleplay-samp.ucoz.com/case_Dip.ini

И всё что там есть вставляем в
Code
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

Далее в папке scriptfiles\logs создаём документ LoadDip.cfg и вставляем в него
Code
Dip[0][dGrove] = 0
Dip[0][dRifa] = 0
Dip[0][dBallas] = 0
Dip[0][dVagos] = 0
Dip[0][dRGrove] = 0
Dip[0][dRAztec] = 0
Dip[0][dRVagos] = 0
Dip[0][dRBallas] = 0
Dip[0][dBGrove] = 0
Dip[0][dBAztec] = 0
Dip[0][dBVagos] = 0
Dip[0][dBRifa] = 0
Dip[0][dAGrove] = 0
Dip[0][dAVagos] = 0
Dip[0][dABallas] = 0
Dip[0][dARifa] = 0
Dip[0][dGRifa] = 0
Dip[0][dGAztec] = 0
Dip[0][dGVagos] = 0
Dip[0][dGBallas] = 0
Dip[0][dVGrove] = 0
Dip[0][dVAztec] = 0
Dip[0][dVBallas] = 0
Dip[0][dVRifa] = 0


Примечание: Все ссылки в сообщение не реклама.
[CM]Jaxson Дата: Суббота, 29.09.2012, 22:22 | Сообщение # 2
٩(̾●̮̮̃̾•̃̾)۶
Сообщений: 801
Статус: Offline



[ Skype ] [ Профиль ] [ Mods Pack ] [ VK ] [ Геймеры ]
Помогаю новичкам, по всем вопросом комне в Skype/VK. VK ВЗЛОМАН, НЕ РАБОТАЙТЕ СОМНОЙ. МНЕ ВСЁ ВЗЛОМАЛИ СКАЙП И ВК. СКАЙП ВОССТОНОВИЛ.
[CM]ExtazZz Дата: Воскресенье, 30.09.2012, 01:43 | Сообщение # 3
Боец
Сообщений: 158
Статус: Offline
Рад что вам понравилось.
side75 Дата: Понедельник, 08.10.2012, 14:12 | Сообщение # 4
Боец
Сообщений: 7
Статус: Offline
[CM]ExtazZz, coooool не будут задавать тупых вопросов .. типо "какая дипломатия?"
Прикрепления: 9298063.png (5.0 Kb)



Pysi Дата: Понедельник, 08.10.2012, 14:24 | Сообщение # 5
Боец
Сообщений: 59
Статус: Offline
Quote (side75)
coooool не будут задавать тупых вопросов .. типо "какая дипломатия?"


Как же ты надоел оффтопить, прекрати!

P.S: После в PWN выявляются варнинги, но мод работает стандартно


Skype: cheat-master-ebaster
Эльдар Дата: Понедельник, 08.10.2012, 14:31 | Сообщение # 6
Советник
Сообщений: 672
Статус: Offline
прям как на samp-vl

Продам инвайт в DOTA 2 - skype:e.l119

side75 Дата: Понедельник, 08.10.2012, 16:10 | Сообщение # 7
Боец
Сообщений: 7
Статус: Offline
Pysi, оффтоп это сообщение не по теме.Где ты видеш чтобы я написал не по теме..


  • Страница 1 из 1
  • 1
Поиск:
Статистика Форума
Лучшие пользователи
Admin [39113]

GеNius [7210]

[CM]Russel [5557]

kenlo763 [4952]

[CM]AGRESSOR [4639]

Snake_Firm [4452]

Сэс [4416]

Artem_Buero [4223]

[CM]Durman [3204]

[CM]Рафаэль [3080]

iMaddy [2855]

sky_Woker [2854]

getrekt [2745]

Новые пользователи
fennylirst21 [22:04]

shawnfl1 [21:59]

vadekkkk [13:09]

vadekkk [13:06]

rusikzxc [02:42]

concettakc7 [21:51]

Freddie_Torp [16:55]

Drono1 [05:27]

jeriui16 [05:00]

Winke [01:35]

ppppollajb [22:07]

ikuxa1anokhin [19:10]

paulako9 [08:52]