В enum pInfo
Code: Select all
pDonateMoney1,
В public OnPlayerConnect(playerid)
Code: Select all
PlayerInfo[playerid][pDonateMoney1] = 0;
public OnPlayerRegister(playerid, password[])
Code: Select all
ini_setInteger(File,"DonateMoney1",PlayerInfo[playerid][pDonateMoney1]);
stock OnPlayerUpdateRL(playerid) или же public OnPlayerUpdateRL(playerid)
Code: Select all
ini_setInteger(File,"DonateMoney1",PlayerInfo[playerid][pDonateMoney1]);
В public OnPlayerLogin(playerid,password[])
Code: Select all
ini_getInteger(File,"DonateMoney1",PlayerInfo[playerid][pDonateMoney1);
В public OnDialogResponse к case 9623:
Вставляем вместо стандартного доната это:
Code: Select all
OnPlayerCommandText(playerid,"/donate");
В public OnDialogResponse - если у вас есть стандартный донат,вместо него ставляем это:
Code: Select all
case 10055:
{
if(response)
{
switch(listitem)
{
case 0:ShowPlayerDialog(playerid, 10057, DIALOG_STYLE_LIST, "Вирты", "{ffffff}500.000 {03c03c}[50 DM]\n{ffffff}1.000.000 {03c03c}[100 DM]\n{ffffff}5.000.000 {03c03c}[500 DM]\n{ffffff}10.000.000 {03c03c}[1000 DM]\n{ffffff}20.000.000 {03c03c}[2000 DM]", "Купить", "Назад");
case 1:ShowPlayerDialog(playerid, 10061, DIALOG_STYLE_LIST, "Лицензии", "{ffffff}Вод.Права {03c03c}[50]\n{ffffff}Лицензия на полеты {03c03c}[100]\n{ffffff}Лицензия на рыболовство {03c03c}[100]\n{ffffff}Лицензия на водный транспорт{03c03c}[100]\n{ffffff}Лицензия на оружие{03c03c}[100]\n{ffffff}Лицензия на бизнес{03c03c}[100]\n{ff3300}Все лицензии{03c03c}[500]", "Купить", "Назад");
case 2:ShowPlayerDialog(playerid, 5559, DIALOG_STYLE_LIST, "VIP", "{ffffff}BRONZE VIP {03c03c}[150]\n{ffffff}SILVER VIP {03c03c}[250]\n{ffffff}GOLD VIP {03c03c}[400]", "Купить", "Назад");
case 3:ShowPlayerDialog(playerid, 10059, DIALOG_STYLE_LIST, "Остальное", "{ffffff}Скилы на оружие {03c03c}[100]\n{ffffff}Стили боя {03c03c}[100]\n{ffffff}5000 материалов {03c03c}[500]\n{ffffff}Снятие варна(ов) {03c03c}[500]\n{ffffff}100 законопослушности {03c03c}[300]\n{ffffff}500 наркотиков {03c03c}[200]", "Выбрать", "Назад");
case 4:ShowPlayerDialog(playerid, 10060, DIALOG_STYLE_LIST, "Личный транспорт", "{ffffff}Лимузин {03c03c}[300]\n{ffffff}Байк {03c03c}[100]\n{ffffff}Квадроцикл {03c03c}[300]\n{ffffff}Грузовик {03c03c}[400]\n{ffffff}Монстер {03c03c}[400]\n{ffffff}Бандито {03c03c}[300]\n{ffffff}Картинг {03c03c}[250]", "Купить", "Выйти");
case 5:
{
new string3[512];
format(string3,sizeof(string3),"\n{ffffff}Введите ID скина на который вы хотите сменить свой скин и нажмите {34c924}'Ок'\n\n\n{ffffff}Стоимость любого скина составляет {34c924}500 {ffffff}DonateMoney");
ShowPlayerDialog(playerid,5563,DIALOG_STYLE_INPUT,"{ffffff}Введите ID скина",string3,"Сменить","Выйти");
}
}
}
else
{
return 1;
}
}
case 10057:
{
if(response)
{
switch(listitem)
{
case 0:
{
if(PlayerInfo[playerid][pDonateMoney1] < 50) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCash] += 500000;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели 500 тысяч!");
PlayerInfo[playerid][pDonateMoney1] -= 50;
}
case 1:
{
if(PlayerInfo[playerid][pDonateMoney1] < 100) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCash] += 1000000;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели 1 миллион!");
PlayerInfo[playerid][pDonateMoney1] -= 100;
}
case 2:
{
if(PlayerInfo[playerid][pDonateMoney1] < 500) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCash] += 5000000;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели 5 миллионов!");
PlayerInfo[playerid][pDonateMoney1] -= 500;
}
case 3:
{
if(PlayerInfo[playerid][pDonateMoney1] < 1000) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCash] += 10000000;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели 10 миллионов!");
PlayerInfo[playerid][pDonateMoney1] -= 500;
}
case 4:
{
if(PlayerInfo[playerid][pDonateMoney1] < 2000) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCash] += 20000000;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели 20 миллионов!");
PlayerInfo[playerid][pDonateMoney1] -= 2000;
}
}
}
}
case 5559:
{
if(response)
{
switch(listitem)
{
case 0:
{
if(PlayerInfo[playerid][pDonateMoney1] < 150) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pDonateRank] = 1;
SendClientMessage(playerid, 0x6495EDFF, "Теперь вы имеете статус: {FFBF00}Bronze VIP");
PlayerInfo[playerid][pDonateMoney1] -= 150;
}
case 1:
{
if(PlayerInfo[playerid][pDonateMoney1] < 250) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pDonateRank] = 2;
SendClientMessage(playerid, 0x6495EDFF, "Теперь вы имеете статус: {40FFFF}Silver VIP");
PlayerInfo[playerid][pDonateMoney1] -= 250;
}
case 2:
{
if(PlayerInfo[playerid][pDonateMoney1] < 400) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pDonateRank] = 3;
SendClientMessage(playerid, 0x6495EDFF, "Теперь вы имеете статус: {40FF40}Gold VIP");
PlayerInfo[playerid][pDonateMoney1] -= 400;
}
}
}
else
{
return 1;
}
}
case 10061:
{
if(response)
{
switch(listitem)
{
case 0:
{
if(PlayerInfo[playerid][pDonateMoney1] < 50) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pVodPrava] = 1;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Вод.Права!");
PlayerInfo[playerid][pDonateMoney1] -= 50;
}
case 1:
{
if(PlayerInfo[playerid][pDonateMoney1] < 100) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pFishLic] = 1;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Лицензию на рыболовство");
PlayerInfo[playerid][pDonateMoney1] -= 100;
}
case 2:
{
if(PlayerInfo[playerid][pDonateMoney1] < 100) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pBoatLic] = 1;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Лицензию на водный транспорт");
PlayerInfo[playerid][pDonateMoney1] -= 100;
}
case 3:
{
if(PlayerInfo[playerid][pDonateMoney1] < 100) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pFlyLic] = 1;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Лицензию на полеты");
PlayerInfo[playerid][pDonateMoney1] -= 100;
}
case 4:
{
if(PlayerInfo[playerid][pDonateMoney1] < 100) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pGunLic] = 1;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Лицензию на оружие");
PlayerInfo[playerid][pDonateMoney1] -= 100;
}
case 5:
{
if(PlayerInfo[playerid][pDonateMoney1] < 100) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pBizLic] = 1;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Лицензию на бизнес");
PlayerInfo[playerid][pDonateMoney1] -= 100;
}
case 6:
{
if(PlayerInfo[playerid][pDonateMoney1] < 500) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pVodPrava] = 1;
PlayerInfo[playerid][pFishLic] = 1;
PlayerInfo[playerid][pBoatLic] = 1;
PlayerInfo[playerid][pFlyLic] = 1;
PlayerInfo[playerid][pBizLic] = 1;
PlayerInfo[playerid][pGunLic] = 1;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели все лицензии");
PlayerInfo[playerid][pDonateMoney1] -= 500;
}
}
}
else
{
return 1;
}
}
case 10059:
{
if(response)
{
switch(listitem)
{
case 0:
{
if(PlayerInfo[playerid][pDonateMoney1] < 100) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pDesertEagle] = 100;
PlayerInfo[playerid][pSDPistol] = 100;
PlayerInfo[playerid][pMP5] = 100;
PlayerInfo[playerid][pAK47] = 100;
PlayerInfo[playerid][pM4] = 100;
PlayerInfo[playerid][pShotGun] = 100;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: скилы на оружие!");
PlayerInfo[playerid][pDonateMoney1] -= 100;
}
case 1:
{
if(PlayerInfo[playerid][pDonateMoney1] < 100) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pBoxSkill] = 999999;
PlayerInfo[playerid][pKongfuSkill] = 999999;
PlayerInfo[playerid][pKickboxSkill] = 9999999;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: все стили боя!");
PlayerInfo[playerid][pDonateMoney1] -= 100;
}
case 2:
{
if(PlayerInfo[playerid][pDonateMoney1] < 500) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pMats] += 5000;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: 5.000 материалов!");
PlayerInfo[playerid][pDonateMoney1] -= 500;
}
case 3:
{
if(PlayerInfo[playerid][pDonateMoney1] < 500) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pWarns] = 0;
SendClientMessage(playerid, 0x6495EDFF, "Вы сняли с себя все варны!");
PlayerInfo[playerid][pDonateMoney1] -= 500;
}
case 4:
{
if(PlayerInfo[playerid][pDonateMoney1] < 300) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pZakonp] = 100;
PlayerInfo[playerid][pWantedDeaths] = 0;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: 100 законопослушности!");
PlayerInfo[playerid][pDonateMoney1] -= 300;
}
}
}
else
{
return true;
}
}
case 10060:
{
if(response)
{
switch(listitem)
{
case 0:
{
if(PlayerInfo[playerid][pPhousekey] == 255) return SendClientMessage(playerid,COLOR_RED,"У вас нет дома");
if(PlayerInfo[playerid][pDonateMoney1] < 300) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCar] = 409;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Лимузин!");
PlayerInfo[playerid][pDonateMoney1] -= 300;
}
case 1:
{
if(PlayerInfo[playerid][pPhousekey] == 255) return SendClientMessage(playerid,COLOR_RED,"У вас нет дома");
if(PlayerInfo[playerid][pDonateMoney1] < 100) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCar] = 463;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Байк!");
PlayerInfo[playerid][pDonateMoney1] -= 100;
}
case 2:
{
if(PlayerInfo[playerid][pPhousekey] == 255) return SendClientMessage(playerid,COLOR_RED,"У вас нет дома");
if(PlayerInfo[playerid][pDonateMoney1] < 300) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCar] = 471;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Квадроцикл!");
PlayerInfo[playerid][pDonateMoney1] -= 300;
}
case 3:
{
if(PlayerInfo[playerid][pPhousekey] == 255) return SendClientMessage(playerid,COLOR_RED,"У вас нет дома");
if(PlayerInfo[playerid][pDonateMoney1] < 400) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCar] = 406;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Грузовик!");
PlayerInfo[playerid][pDonateMoney1] -= 400;
}
case 4:
{
if(PlayerInfo[playerid][pPhousekey] == 255) return SendClientMessage(playerid,COLOR_RED,"У вас нет дома");
if(PlayerInfo[playerid][pDonateMoney1] < 400) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCar] = 444;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Монстер!");
PlayerInfo[playerid][pDonateMoney1] -= 400;
}
case 5:
{
if(PlayerInfo[playerid][pPhousekey] == 255) return SendClientMessage(playerid,COLOR_RED,"У вас нет дома");
if(PlayerInfo[playerid][pDonateMoney1] < 300) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCar] = 568;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Бандито!");
PlayerInfo[playerid][pDonateMoney1] -= 300;
}
case 6:
{
if(PlayerInfo[playerid][pPhousekey] == 255) return SendClientMessage(playerid,COLOR_RED,"У вас нет дома");
if(PlayerInfo[playerid][pDonateMoney1] < 250) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно DonateMoney!");
PlayerInfo[playerid][pCar] = 571;
SendClientMessage(playerid, 0x6495EDFF, "Вы приобрели: Картинг!");
PlayerInfo[playerid][pDonateMoney1] -= 250;
}
}
}
else
{
return 1;
}
}
И теперь на последок в public OnPlayerCommandText добавляем это:
Code: Select all
else if(strcmp(cmd, "/donate", true) == 0)
{
new lvlexp[80];
new listitems[] = "{FFFFFF}[1] {BF80FF}Покупка вирт\n{FFFFFF}[2] {BF80FF}Покупка лицензий\n{FFFFFF}[3] {BF80FF}Приобретения VIP\n{FFFFFF}[4] {BF80FF}Остальное\n{FFFFFF}[5] {BF80FF}Личный транспорт\n{FFFFFF}[6] {BF80FF}Скин";
format(lvlexp,70,"{00bfff}На вашем счету: {ff3311}%d DonateMoney",PlayerInfo[playerid][pDonateMoney1]);
ShowPlayerDialog(playerid, 10055, DIALOG_STYLE_LIST, lvlexp, listitems, "Выбрать", "Выйти");
}
else if(strcmp(cmd, "/givedonate", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] == 6)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "{F74848}» Введите{FFFFFF}: /givedonate [ID] [DonateMoney]");
new playa;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
DonateMoney1 = strval(tmp);
if(PlayerInfo[playerid][pAdmin] == 6)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%d переведено на счет игроку", DonateMoney1);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerInfo[playa][pDonateMoney1] += DonateMoney1;
SendClientMessage(playa, COLOR_NEWS, "Пополнение доната аккаунта");
format(string, sizeof(string), "Пополнение на: {d53e07}$%d, DonateMoney1);
SendClientMessage(playa, COLOR_WHITE, string);
format(string, sizeof(string), "Донат счет: {d53e07}$%d", PlayerInfo[playa][pDonateMoney1]);
SendClientMessage(playa, COLOR_WHITE, string);
}
}
}
}
return true;
}
Автор донат системы: Denis_Brown [Den4Ik]