• Страница 1 из 1
  • 1
Новая система Donate
Дмитрий Дата: Среда, 19.12.2012, 10:22 | Сообщение # 1 | Сообщить о нерабочей теме


Аватар для Дмитрий

Добрый День сейчас мы с вами сделаем новую систему донаты

[moder]Добовляем в pInfo[/moder]

Code
pDonatechet,  
     pDon,  


[moder]Потом идём в public OnPlayerLogin[/moder]

Code
iniGetInt(File,"DonateChet",PlayerInfo[playerid][pDonatechet]);  
         iniGetInt(File,"Don",PlayerInfo[playerid][pDon]);  


[moder]потом в OnPlayerRegister[/moder]

Code
iniSetInt(File,"DonateChet",PlayerInfo[playerid][pDonatechet]);  
         iniSetInt(File,"Don",PlayerInfo[playerid][pDon]);


[moder]Потом в OnPlayerUpdate Если есть[/moder]

Code
  iniSetInt(File,"DonateChet",PlayerInfo[playerid][pDonatechet]);  
         iniSetInt(File,"Don",PlayerInfo[playerid][pDon]);  


[moder]Потом идём в public OnPlayerConnect[/moder]
Code
PlayerInfo[playerid][pDonatechet] = 0;  
     PlayerInfo[playerid][pDon] = 0;  


[moder]в OnPlayerLogin
Это ниже где будет написано примерно так Вы вошли на сервер[/moder]
Code
if (PlayerInfo[playerid][pDonatechet] >= 0)
  {
   format(string2, sizeof(string2), "У вас на счёте %d доната денег",PlayerInfo[playerid][pDonatechet]);
   SendClientMessage(playerid, COLOR_WHITE,string2);
  }


[moder]Дальше Создаём команду /donate and /chet
в public OnPlayerCommand[/moder]

Code
if (strcmp("/donate", cmdtext, true) == 0)  
     {  
     ShowPlayerDialog(playerid, 30000, DIALOG_STYLE_INPUT,"Введите Код","Ведите код\nВ окошко","Ок","Cancel");  
     return 1;  
     }  
     if (strcmp("/chet", cmdtext, true) == 0)  
     {  
     format(string,sizeof(string),"{FEBC41}[0]Купить Iphone 5\n{D1DBD0}[1]Снять Розыск\n{FEBC41}[2]Купить ЛВЛ\n{D1DBD0}[3]Выбрать блатной номер\n{FEBC41}[4]Выбрать Лидерку\n{D1DBD0}[5]Получить Админку");  
       ShowPlayerDialog(playerid,30001,DIALOG_STYLE_LIST,"Доната Счёт | Помощь",string,"Ок","Отмена");  
     return 1;  
     }  


[moder]Так дальше
в public OnDialogRespon[/moder]

Code
if(dialogid == 30001)  
     {  
         if(response)  
         {  
                 if(listitem == 0)  
                 {  
                 if(PlayerInfo[playerid][pDonatechet] >= 100000)  
                   {  
                   PlayerInfo[playerid][pDonatechet] -= 100000;  
                   SendClientMessage(playerid, COLOR_WHITE, "Вы купили за 100.000Доната Счёта");  
                   PlayerInfo[playerid][pDon] = 1;  
                   SendClientMessage(playerid, COLOR_WHITE, "Вы получили Телефон Iphone 5g");  
                   format(string, sizeof(string), "- Донат счётчик: %d", PlayerInfo[playerid][pDonatechet]);  
                         SendClientMessage(playerid, 0xFEBC41AA, string);  
                   }  
                   else  
                   {  
                   SendClientMessage(playerid, COLOR_WHITE, "У вас нету столько денег");  
                   }  
                 }  
                  else if(listitem == 1)  
                 {  
                 if(PlayerInfo[playerid][pDonatechet] >= 50000)  
                   {  
                   PlayerInfo[playerid][pDonatechet] -= 50000;  
                   SendClientMessage(playerid, COLOR_WHITE, "Вы купили за 50.000Доната Счёта");  
                   WantedLevel[playerid] = 0;  
                   SendClientMessage(playerid, COLOR_WHITE, "Вы сняли Розыск");  
                   format(string, sizeof(string), "- Донат счётчик: %d", PlayerInfo[playerid][pDonatechet]);  
                         SendClientMessage(playerid, 0xFEBC41AA, string);  
                   }  
                   else  
                   {  
                   SendClientMessage(playerid, COLOR_WHITE, "У вас нету столько денег на Доната Счёте");  
                   }  
                 }  
                   else if(listitem == 2)  
                 {  
                 if(PlayerInfo[playerid][pDonatechet] >= 150000)  
                   {  
                   PlayerInfo[playerid][pDonatechet] -= 150000;  
                   SendClientMessage(playerid, COLOR_WHITE, "Вы купили за 150.000Доната Счёта");  
                   PlayerInfo[playerid][pLevel] += 1;  
                   SendClientMessage(playerid, COLOR_WHITE, "Вы купили +1лвл");  
                   format(string, sizeof(string), "- Донат счётчик: %d", PlayerInfo[playerid][pDonatechet]);  
                         SendClientMessage(playerid, 0xFEBC41AA, string);  
                   }  
                   else  
                   {  
                   SendClientMessage(playerid, COLOR_WHITE, "У вас нету столько денег на Доната Счёте");  
                   }  
                 }  
                    else if(listitem == 3)  
                 {  
                 if(PlayerInfo[playerid][pDonatechet] >= 1000000)  
                   {  
                   PlayerInfo[playerid][pDonatechet] -= 1000000;  
                   SendClientMessage(playerid, COLOR_WHITE, "Вы купили за 1.000.000Доната Счёта");  
                   ShowPlayerDialog(playerid, 30002, DIALOG_STYLE_INPUT,"Введите номер","Ведите номер телефона\n---","Ок");  
                   SendClientMessage(playerid, COLOR_WHITE, "Вы купили блатной номер");  
                   format(string, sizeof(string), "- Донат счётчик: %d", PlayerInfo[playerid][pDonatechet]);  
                         SendClientMessage(playerid, 0xFEBC41AA, string);  
                   }  
                   else  
                   {  
                   SendClientMessage(playerid, COLOR_WHITE, "У вас нету столько денег на Доната Счёте");  
                   }  
                 }  
                    else if(listitem == 4)  
                 {  
                 if(PlayerInfo[playerid][pDonatechet] >= 3000000)  
                   {  
                   SendClientMessage(playerid, COLOR_WHITE, "Что бы дать лидерку наберите /chetleader");  
                   SendClientMessage(playerid, COLOR_WHITE, "Стоимость подача лидерки 3.000.000 Доната Денег");  
                   format(string, sizeof(string), "- Донат счётчик: %d", PlayerInfo[playerid][pDonatechet]);  
                         SendClientMessage(playerid, 0xFEBC41AA, string);  
                   }  
                   else  
                   {  
                   SendClientMessage(playerid, COLOR_WHITE, "У вас нету столько денег на Доната Счёте");  
                   }  
                 }  
                    else if(listitem == 5)  
                 {  
                 if(PlayerInfo[playerid][pDonatechet] >= 50000000)  
                   {  
                   PlayerInfo[playerid][pDonatechet] -= 50000000;  
                   SendClientMessage(playerid, COLOR_WHITE, "Вы купили 1лвл админки за 50.000.000 Доната Счёта");  
                   PlayerInfo[playerid][pAdmin] = 1;  
                   format(string, sizeof(string), "- Донат счётчик: %d", PlayerInfo[playerid][pDonatechet]);  
                         SendClientMessage(playerid, 0xFEBC41AA, string);  
                   }  
                   else  
                   {  
                   SendClientMessage(playerid, COLOR_WHITE, "У вас нету столько денег на Доната Счёте");  
                   }  
                 }  
         }  
     }  
     //Update2  
     else if(dialogid == 30002)//админ доступ  
     {  
         if(response)  
         {  
              new ammo = strval(inputtext);  
             PlayerInfo[playerid][pPnumber] = ammo;  
     }  
     return 1;  
}  
     //Dpnatge  
      else if(dialogid == 30000)//админ доступ  
      {  
      new donate;  
      new file = iniOpen("donate.ini");  
     if(iniGetInt(file, inputtext, donate) == 0)  
     {  
     //GiveMoney(playerid,donate);  
                            //format(string, sizeof(string), "- %d вирт переведены на счёт игроку", donate);  
                            //SendClientMessage(playerid, COLOR_WHITE, string);  
                            PlayerInfo[playerid][pAccount] += donate;  
                            PlayerInfo[playerid][pAccount] += donate;  
                            PlayerInfo[playerid][pDonatechet] += donate;  
                            PlayerInfo[playerid][pDonatechet] += donate;  
                            SendClientMessage(playerid, COLOR_NEWS, "Пополнение игрового аккаунта");  
                            format(string, sizeof(string), "- Донат счётчик: %d/10000000 вирт", PlayerInfo[playerid][pDonatechet]);  
                            SendClientMessage(playerid, 0xFEBC41AA, string);  
                            format(string, sizeof(string), "- Пополнение счёта на сумму: %d вирт", donate);  
                            SendClientMessage(playerid, COLOR_WHITE, string);  
                            format(string, sizeof(string), "- Вы получили в 2 раза больше: %d вирт", donate);  
                            SendClientMessage(playerid, COLOR_WHITE, string);  
                            format(string, sizeof(string), "- Ваши наличные: %d вирт", PlayerInfo[playerid][pAccount]);  
                            SendClientMessage(playerid, COLOR_WHITE, string);  
                         if(PlayerInfo[playerid][pDonatechet] >= 1000000)  
                     {  
                         SendClientMessage(playerid, COLOR_WHITE, "- Вы получили статус: {FFA500}BRONZE VIP");  
                         PlayerInfo[playerid][pDonateRank] = 1;  
                     }  
                     if(PlayerInfo[playerid][pDonatechet] >= 15000000)  
                     {  
                         SendClientMessage(playerid, COLOR_WHITE, "- Вы получили статус: {FFA500}SILVER VIP");  
                         PlayerInfo[playerid][pDonateRank] = 2;  
                     }  
                     if(PlayerInfo[playerid][pDonatechet] >= 50000000)  
                     {  
                         SendClientMessage(playerid, COLOR_WHITE, "- Вы получили статус: {FFA500}GOLD VIP");  
                         PlayerInfo[playerid][pDonateRank] = 3;  
                     }  
     ini_removeKey(file,inputtext);  
     //SendClientMessage(playerid,-1,"Вы Вели код");  
     }  
     else  
     {  
     SendClientMessage(playerid,-1,"Не верный Код");  
     }  
     iniClose();  
      }  
    //DONATE  


From Russia With Love!
Дмитрий Дата: Среда, 19.12.2012, 10:23 | Сообщение # 2 | Сообщить о нерабочей теме


Аватар для Дмитрий

[moder]Дальше делаем команду /chetleader[/moder]

Code
if(strcmp(cmd, "/chetleader", true) == 0)  
     {  
         if(IsPlayerConnected(playerid)) // by Extazy and update by Flashin FIXED  
         {  
             tmp = strtok(cmdtext, idx);  
             if(!strlen(tmp))  
             {  
                 SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /makeleader [playerid/PartOfName] [Number(1-29)]");  
                 return 1;  
             }  
             new para1;  
             new level;  
             para1 = ReturnUser(tmp);  
             tmp = strtok(cmdtext, idx);  
             level = strval(tmp);  
             if(level > 29 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "* Не ниже 0, и не выше 29!"); return 1; }  
             if (PlayerInfo[playerid][pDonatechet] >= 3000000)  
             {  
                 if(IsPlayerConnected(para1))  
                 {  
                     if(para1 != INVALID_PLAYER_ID)  
                     {  
                         if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)  
                         {  
                             SendClientMessage(playerid, COLOR_GREY, "   Этот игрок находится во Фракции / Семья / Мафия !");  
                             return 1;  
                         }  
                         GetPlayerName(para1, giveplayer, sizeof(giveplayer));  
                         GetPlayerName(playerid, sendername, sizeof(sendername));  
                         PlayerInfo[para1][pLeader] = level;  
                         PlayerInfo[playerid][pDonatechet] -= 3000000;  
                         format(string, sizeof(string), "   Вы были  назначены лидером фракции, Донатором %s", sendername);  
                         SendClientMessage(para1, COLOR_LIGHTBLUE, string);  
                         format(string, sizeof(string), "   Вы назначены Донатором %s упровлять Фракцией номер %d.", giveplayer,level);  
                         SendClientMessage(playerid, COLOR_LIGHTBLUE, string);  
                         if(level == 0)  
                         {  
                             PlayerInfo[para1][pChar] = 0;  
                             gTeam[para1] = 3;  
                             PlayerInfo[para1][pTeam] = 3;  
                             PlayerInfo[para1][pMember] = 0;  
                             PlayerInfo[para1][pRank] = 0;  
                             PlayerInfo[para1][pChar] = 0;  
                             MedicBill[para1] = 0;  
                             new rand = random(sizeof(CIV));  
                             SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);  
                             PlayerInfo[para1][pModel] = CIV[rand];  
                             SpawnPlayer(para1);  
                             return 1;  
                         }  
                         else if(level == 1) { PlayerInfo[para1][pChar] = 288; PlayerInfo[para1][pRank] = 14; } //Police Force  
                         else if(level == 2) { PlayerInfo[para1][pChar] = 165; PlayerInfo[para1][pRank] = 10;} //FBI/ATF  
                         else if(level == 3) { PlayerInfo[para1][pChar] = 287; PlayerInfo[para1][pRank] = 15;} //National Guard  
                         else if(level == 4) { PlayerInfo[para1][pChar] = 228; PlayerInfo[para1][pRank] = 10;} //Fire/Ambulance  
                         else if(level == 5) { PlayerInfo[para1][pChar] = 113; PlayerInfo[para1][pRank] = 7;} //La Cosa Nostra  
                         else if(level == 6) { PlayerInfo[para1][pChar] = 120; PlayerInfo[para1][pRank] = 10;} //Yakuza  
                         else if(level == 7) { PlayerInfo[para1][pChar] = 147; PlayerInfo[para1][pRank] = 10;} //Mayor  
                         else if(level == 8) { PlayerInfo[para1][pChar] = 294; PlayerInfo[para1][pRank] = 12;} //Hitmans  
                         else if(level == 9) { PlayerInfo[para1][pChar] = 227; PlayerInfo[para1][pRank] = 6;} //News Reporters  
                         else if(level == 10) { PlayerInfo[para1][pChar] = 61; PlayerInfo[para1][pRank] = 6;} //Taxi Cab Company  
                         else if(level == 11) { PlayerInfo[para1][pChar] = 171; PlayerInfo[para1][pRank] = 6;} //Driving/Flying School  
                         else if(level == 12) { PlayerInfo[para1][pChar] = 100; PlayerInfo[para1][pRank] = 7;}  
                         else if(level == 13) { PlayerInfo[para1][pChar] = 46; PlayerInfo[para1][pRank] = 14;}  
                         else if(level == 14) { PlayerInfo[para1][pChar] = 270; PlayerInfo[para1][pRank] = 10;}  
                         else if(level == 15) { PlayerInfo[para1][pChar] = 115; PlayerInfo[para1][pRank] = 12;}//Coronos  
                         else if(level == 16) { PlayerInfo[para1][pChar] = 104; PlayerInfo[para1][pRank] = 10;}  
                         else if(level == 17) { PlayerInfo[para1][pChar] = 173; PlayerInfo[para1][pRank] = 14;}  
                         else if(level == 18) { PlayerInfo[para1][pChar] = 109; PlayerInfo[para1][pRank] = 12;}  
                         else if(level == 19) { PlayerInfo[para1][pChar] = 187; PlayerInfo[para1][pRank] = 6;}  
                         else if(level == 20) { PlayerInfo[para1][pChar] = 288; PlayerInfo[para1][pRank] = 14;}//SD  
                         else if(level == 21) { PlayerInfo[para1][pChar] = 161; PlayerInfo[para1][pRank] = 10;}  
                         else if(level == 22) { PlayerInfo[para1][pChar] = 287; PlayerInfo[para1][pRank] = 15;}  
                         else if(level == 23) { PlayerInfo[para1][pChar] = 240; PlayerInfo[para1][pRank] = 6;}  
                         else if(level == 24) { PlayerInfo[para1][pChar] = 285; PlayerInfo[para1][pRank] = 10;}  
                         else if(level == 25) { PlayerInfo[para1][pChar] = 17; PlayerInfo[para1][pRank] = 7;}  
                         else if(level == 26) { PlayerInfo[para1][pChar] = 299; PlayerInfo[para1][pRank] = 7; }//SD  
                         else if(level == 27) { PlayerInfo[para1][pChar] = 267; PlayerInfo[para1][pRank] = 7;}  
                         else if(level == 28) { PlayerInfo[para1][pChar] = 288; PlayerInfo[para1][pRank] = 14;}//SD  
                         else if(level == 29) { PlayerInfo[para1][pChar] = 287; PlayerInfo[para1][pRank] = 15;}//SD  

                         gTeam[para1] = 29;  
                         PlayerInfo[para1][pTeam] = 29;  
                         SetPlayerSkin(para1, PlayerInfo[para1][pChar]);  
                     }  
                 }//not connected  
             }  
             else  
             {  
                 SendClientMessage(playerid, COLOR_GRAD1, "   Вы не уполномочены использовать эту команду!");  
             }  
         }  
         return 1;  
     }  


[moder]Добовляем в /call /sms[/moder]

Code
if(PlayerInfo[playerid][pDon] == 1)  
     {  
     format(string, sizeof(string), "* %s звонит по Iphone 5g", sendername);  
     ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,0,0);  
     return 1;  
     }  


перед где написано Звонит по телефону

и дальше создаем в скриптфайлах текстовый документ и называем donate.ini
в этот документ впишите CODE = MONEY
и ниже этих строчек пишите коды = деньги

Автор: Leaders


From Russia With Love!
  • Страница 1 из 1
  • 1
Поиск: