Barni
Компетентный
В начало мода ко всем new:
Это мы добавили переменные. Теперь нам надо сделать паблики загрузки и сохранения матов.Нам понадобится инклюд mxini
Теперь приступаем к командам..
Обратите внимание, что /getgun and /carm в диалогомом окне.Идём в public OnDialogResponse
Всё, с диалогами разобрались)
Теперь добавим в команду /get
Если у вас получилось всё правыельно то будет примерно так:
Далее идём d public OnPlayerStateChange находим там if(newstate == PLAYER_STATE_DRIVER)
И встовляем:
Теперь идём в public OnPlayerEnterCheckpoint
Теперь делаем пикапы для банд на зоне 51 и на авоинасце:
ко всем new
в public OnPlayerPickup
Теперь в public OnGameModeInit
Добовляем паблики в конец мода
Координтаы можете заменить на свои...
Автор мануала: Fresh_Light || Barni
При копировании материала указывать источник и автора!
Инклюд Mxini ссылка:
PHP:
//############################[Система повозки матов by Fresh_Light]#################################
new matsarmycar[4], vertmats[2],furaaztekaz,furagroov,furavagos,furarifa,furaballas
new MatsArmyCar[MAX_PLAYERS];
new VertMats[MAX_PLAYERS];
//===============[Система сохранения матов в файл]==============================
forward SaveMaterials();//Сохраняем маты
forward LoadMaterials();//Загружаем маты
forward IsAMatsArmyCar(carid);// паблик привязки машин
forward IsAVertMats(carid);// паблик привязки машин(вертолётов)
//============================[Склады для законников]===========================
new lvarmmatbi = 100000;// Склад армии ЛВ
new sfarmmatbi = 50000; // Склад армии Сф
new lspdmatbi = 50000;// Склад ЛСПД
new fbimatbi = 50000;// Склад ФБР
new sfpdmatbi = 50000;// Склад СФПД
new lvpdmatbi = 50000;// СКлад ЛВПД
//=========================[Склады банд]========================================
new groovematbi = 50000;// Склад Грув
new aztekazmatbi = 50000;// Склад ацтеков
new ballasmatbi = 50000;// Склад Баллас
new rifamatbi = 50000;// Склад Рифа
new vagosmatbi = 50000;// Склад вагос
//=========================[Склады мафий]=======================================
new yakuzamatbi = 50000;//Склад якудза
new lcnmatbi = 50000;//Склад ЛКН
new rmmatbi = 50000;//Склад РМ
//==================[Кол-во матов в машинах для перевозки матов]================
new gruzmatbi[MAX_VEHICLES];// Маты в грузовике
new vertmatbi[MAX_VEHICLES];// Маты в вертолёте
new afuramatbi = 0;// Маты в фургоне ацтек
new bfuramatbi = 0;// Маты в фургное баллас
new vfuramatbi = 0;// Маты в фургоне вагос
new gfuramatbi = 0;// Маты в фургоне грув
new rfuramatbi = 0;// Маты в фургоне рифа
//##############################################################################
PHP:
//==========================[Сохраняем банки мафий и банд]======================
public SaveMaterials()
{
new File = iniOpen("logs/materials.ini");
iniSetInt(File,"sfarmmatbi",sfarmmatbi);
iniSetInt(File,"lspdmatbi",lspdmatbi);
iniSetInt(File,"lvarmmatbi",lvarmmatbi);
iniSetInt(File,"lvpdmatbi",lvpdmatbi);
iniSetInt(File,"sfpdmatbi",sfpdmatbi);
iniSetInt(File,"fbimatbi",fbimatbi);
iniSetInt(File,"groovematbi",groovematbi);
iniSetInt(File,"aztekazmatbi",aztekazmatbi);
iniSetInt(File,"ballasmatbi",ballasmatbi);
iniSetInt(File,"rifamatbi",rifamatbi);
iniSetInt(File,"vagosmatbi",vagosmatbi);
iniSetInt(File,"yakuzamatbi",yakuzamatbi);
iniSetInt(File,"lcnmatbi",lcnmatbi);
iniSetInt(File,"rmmatbi",rmmatbi);
iniClose(File);
return 1;
}
public LoadMaterials()
{
new File = iniOpen("logs/materials.ini");
iniGetInt(File,"sfarmmatbi",sfarmmatbi);
iniGetInt(File,"lspdmatbi",lspdmatbi);
iniGetInt(File,"lvarmmatbi",lvarmmatbi);
iniGetInt(File,"lvpdmatbi",lvpdmatbi);
iniGetInt(File,"sfpdmatbi",sfpdmatbi);
iniGetInt(File,"fbimatbi",fbimatbi);
iniGetInt(File,"groovematbi",groovematbi);
iniGetInt(File,"aztekazmatbi",aztekazmatbi);
iniGetInt(File,"ballasmatbi",ballasmatbi);
iniGetInt(File,"rifamatbi",rifamatbi);
iniGetInt(File,"vagosmatbi",vagosmatbi);
iniGetInt(File,"yakuzamatbi",yakuzamatbi);
iniGetInt(File,"lcnmatbi",lcnmatbi);
iniGetInt(File,"rmmatbi",rmmatbi);
iniClose(File);
return 1;
}
PHP:
if(strcmp(cmd, "/unloading",true)==0)
{
new carid = GetPlayerVehicleID(playerid);
if(IsAFuraMats(carid))
{
//=====================================[Разгрузка для грув]====================
if(PlayerToPoint(15,playerid,2497.7117,-1672.8500,13.3413))
{
if(groovematbi <= 50000)
{
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
new ammount = gfuramatbi;
SendClientMessage(playerid,COLOR_GREEN,"Материалы успешно разгружены");
groovematbi += ammount;
gfuramatbi -= ammount;
return 1;
}
if(carid == matsarmycar[0] || matsarmycar[1] || matsarmycar[2] || matsarmycar[3])// возить на грузовиках)
{
new mats = gruzmatbi[carid];
SendClientMessage(playerid,COLOR_GREEN,"Материалы успешно разгружены");
groovematbi += mats;
gruzmatbi[carid] -= mats;
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Склад полон");
}
}
//=====================================[Разгрузка для ацтеков]====================
if(PlayerToPoint(15,playerid,1674.9695,-2112.8738,13.5469))
{
if(aztekazmatbi <= 50000)
{
if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
{
new ammount = afuramatbi;
SendClientMessage(playerid,COLOR_GREEN,"Материалы успешно разгружены");
aztekazmatbi += ammount;
afuramatbi -= ammount;
return 1;
}
if(carid == matsarmycar[0] || matsarmycar[1] || matsarmycar[2] || matsarmycar[3])// возить на грузовиках)
{
new mats = gruzmatbi[carid];
SendClientMessage(playerid,COLOR_GREEN,"Материалы успешно разгружены");
aztekazmatbi += mats;
gruzmatbi[carid] -= mats;
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Склад полон");
}
}
//=====================================[Разгрузка для баллас]====================
if(PlayerToPoint(15,playerid,2646.6689,-2008.5800,13.3828))
{
if(ballasmatbi <= 50000)
{
if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
{
new ammount = bfuramatbi;
SendClientMessage(playerid,COLOR_GREEN,"Материалы успешно разгружены");
ballasmatbi +=ammount;
bfuramatbi -= ammount;
return 1;
}
if(carid == matsarmycar[0] || matsarmycar[1] || matsarmycar[2] || matsarmycar[3])// возить на грузовиках)
{
new mats = gruzmatbi[carid];
SendClientMessage(playerid,COLOR_GREEN,"Материалы успешно разгружены");
ballasmatbi += mats;
gruzmatbi[carid] -= mats;
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Склад полон");
}
}
//=====================================[Разгрузка для рифа]====================
if(PlayerToPoint(15,playerid,2180.9675,-1801.3975,13.3671))
{
if(rifamatbi <= 50000)
{
if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
{
new ammount = rfuramatbi;
SendClientMessage(playerid,COLOR_GREEN,"Материалы успешно разгружены");
rifamatbi +=ammount;
rfuramatbi -= ammount;
}
if(carid == matsarmycar[0] || matsarmycar[1] || matsarmycar[2] || matsarmycar[3])// возить на грузовиках)
{
new mats = gruzmatbi[carid];
SendClientMessage(playerid,COLOR_GREEN,"Материалы успешно разгружены");
rifamatbi += mats;
gruzmatbi[carid] -= mats;
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Склад полон");
}
}
//=====================================[Разгрузка для вагос]====================
if(PlayerToPoint(15,playerid,2786.9048,-1607.5347,10.9219))
{
if(vagosmatbi <= 50000)
{
if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
{
new ammount = vfuramatbi;
SendClientMessage(playerid,COLOR_GREEN,"Материалы успешно разгружены");
vagosmatbi +=ammount;
vfuramatbi -= ammount;
}
if(carid == matsarmycar[0] || matsarmycar[1] || matsarmycar[2] || matsarmycar[3])// возить на грузовиках)
{
new mats = gruzmatbi[carid];
SendClientMessage(playerid,COLOR_GREEN,"Материалы успешно разгружены");
vagosmatbi += mats;
gruzmatbi[carid] -= mats;
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Склад полон");
}
}
SaveMaterials();
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не в фургоне/грузовике");
}
}
//============================[New mats system by Fresh_Light]==================
if(strcmp(cmd, "/carm", true) == 0)
{
if(gPlayerLogged[playerid] != 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 433)
{
SendClientMessage(playerid,COLOR_GREY,"Вы не в матовозе!");
return 1;
}
if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
{
ShowPlayerDialog(playerid,20005,DIALOG_STYLE_LIST,"Повозка матов","Загрузиться\nРазгрузится на склад армии СФ\nРазгрузится на склад ЛСПД\nРазгрузится на склад ФБР\nРазгрузиться на склад СФПД\nРАзгрузиться на склад ЛВПД","Выбрать","Отмена");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вам не доступна эта функция");
}
}
return 1;
}
if(strcmp(cmd, "/warehouse", true) == 0)
{
if(gPlayerLogged[playerid] != 0)
{
if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)//New Cops Spawn
{
format(string, sizeof(string), "На складе LSPD %d матов", lspdmatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)//New FBI Spawn
{
format(string, sizeof(string), "На складе FBI %d матов", fbimatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)//New FBI Spawn
{
format(string, sizeof(string), "На складе Army SF %d матов", sfarmmatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)//New FBI Spawn
{
format(string, sizeof(string), "На складе LCN %d матов", lcnmatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)//New Cops Spawn
{
format(string, sizeof(string), "На складе Yakuza %d матов", yakuzamatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)//New FBI Spawn
{
format(string, sizeof(string), "На складе LVPD %d матов", lvpdmatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)//New FBI Spawn
{
format(string, sizeof(string), "На складе Rassian Mafia %d матов", rmmatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if (PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)//New Cops Spawn
{
format(string, sizeof(string), "На складе SFPD %d матов", sfpdmatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if (PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)//New Cops Spawn
{
format(string, sizeof(string), "На складе GROOVE %d матов", groovematbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if (PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)//New FBI Spawn
{
format(string, sizeof(string), "На складе AZTEKAZ %d матов", aztekazmatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if (PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)//New Cops Spawn
{
format(string, sizeof(string), "На складе BALLAS %d матов", ballasmatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if (PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)//New FBI Spawn
{
format(string, sizeof(string), "На складе RIFA %d матов", rifamatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if (PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)//New FBI Spawn
{
format(string, sizeof(string), "На складе VAGOS %d матов", vagosmatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)//New FBI Spawn
{
format(string, sizeof(string), "На складе Army LV %d матов", lvarmmatbi);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/getgun", true) == 0)
{
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pRank] >= 3)
{
if(PlayerToPoint(3.0, playerid,1258.8202,-791.0245,1084.0078))
{
ShowPlayerDialog(playerid,20004,DIALOG_STYLE_LIST,"/getgun","Дигл 14паатронов\nSHotgun 10патронов\nм4 90патронов\nАк47 90патронов","Выбрать","Отмена");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не на складе");
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вам не доступна эта функция");
}
}
if(strcmp(cmd,"/materials",true)==0)
{
if(gPlayerLogged[playerid] != 0)
{
if(!IsAGangZ(playerid))
{
SendClientMessage(playerid,COLOR_GREY,"Вы не бандит");
return 1;
}
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "--------=====Помощ=====--------");
SendClientMessage(playerid, COLOR_WHITE, "Используйте: /materials [name]");
SendClientMessage(playerid, COLOR_WHITE, "Доступные названия: Get,Put");
SendClientMessage(playerid, COLOR_WHITE, "===============================");
return 1;
}
if(strcmp(x_nr,"get",true) == 0)
{
if(PlayerToPoint(7.0,playerid,313.0547,-165.0834,999.6010) && GetPlayerVirtualWorld(playerid) == 24)
{
format(string, sizeof(string), "Вы взяли не сколько комплектов");
SendClientMessage(playerid, COLOR_GREEN, string);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1);
SetPlayerAttachedObject(playerid, 1 , 2060, 1,0.11,0.36,0.0,0.0,90.0);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1);
MatsHolding[playerid] = 250;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Вы не на военном складе");
return 1;
}
}
else if(strcmp(x_nr,"put",true) == 0)
{
new carid = GetPlayerVehicleID(playerid);
if(IsAFuraMats(carid))
{
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
if(gfuramatbi < 3000)
{
if(MatsHolding[playerid] == 250)
{
format(string, sizeof(string), "Вы положили маты в фургон");
SendClientMessage(playerid, COLOR_GREEN, string);
MatsHolding[playerid] -= 250;
gfuramatbi +=250;
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Фургон полон");
}
}
if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
{
if(afuramatbi < 3000)
{
if(MatsHolding[playerid] == 250)
{
format(string, sizeof(string), "Вы положили маты в фургон");
SendClientMessage(playerid, COLOR_GREEN, string);
MatsHolding[playerid] -= 250;
afuramatbi +=250;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Фургон полон");
}
}
if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
{
if(bfuramatbi < 3000)
{
if(MatsHolding[playerid] == 250)
{
format(string, sizeof(string), "Вы положили маты в фургон");
SendClientMessage(playerid, COLOR_GREEN, string);
MatsHolding[playerid] -= 250;
bfuramatbi +=250;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Фургон полон");
}
}
if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
{
if(rfuramatbi < 3000)
{
if(MatsHolding[playerid] == 250)
{
format(string, sizeof(string), "Вы положили маты в фургон");
SendClientMessage(playerid, COLOR_GREEN, string);
MatsHolding[playerid] -= 250;
rfuramatbi +=250;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Фургон полон");
}
}
if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
{
if(vfuramatbi < 3000)
{
if(MatsHolding[playerid] == 250)
{
format(string, sizeof(string), "Вы положили маты в фургон");
SendClientMessage(playerid, COLOR_GREEN, string);
MatsHolding[playerid] -= 250;
vfuramatbi +=250;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Фургон полон");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Вы не в фургоне");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Недействительное Название Материалов!");
return 1;
}
}
return 1;
}
if(strcmp(cmd,"/sellmats",true)==0)
{
if(gPlayerLogged[playerid] != 0)
{
if(!IsAGangZ(playerid))
{
SendClientMessage(playerid,COLOR_GREY,"Вы не бандит");
return 1;
}
new m_nr[256];
m_nr = strtok(cmdtext, idx);
if(!strlen(m_nr))
{
SendClientMessage(playerid, COLOR_WHITE, "------------====Помощь===-------------");
SendClientMessage(playerid, COLOR_WHITE, "Используйте: /sellmats [name] [кол-во]");
SendClientMessage(playerid, COLOR_WHITE, "Доступные названия: Rm,lcn,yakuza");
SendClientMessage(playerid, COLOR_WHITE, "======================================");
return 1;
}
if(strcmp(m_nr,"rm",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /sellmats rm [кол-во]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 50000)
{
SendClientMessage(playerid, COLOR_GREY, "Вы не можете доставить на склад мафии меньше 1 и больше 50000 матов");
return 1;
}
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
if(groovematbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
groovematbi -= moneys;
rmmatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
{
if(aztekazmatbi >= moneys)
{
aztekazmatbi -= moneys;
rmmatbi += moneys;
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
{
if(ballasmatbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
ballasmatbi -= moneys;
rmmatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
{
if(rifamatbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
rifamatbi -= moneys;
rmmatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
{
if(vagosmatbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
vagosmatbi -= moneys;
rmmatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
}
if(strcmp(m_nr,"lcn",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /sellmats rm [кол-во]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 50000)
{
SendClientMessage(playerid, COLOR_GREY, "Вы не можете доставить на склад мафии меньше 1 и больше 50000 матов");
return 1;
}
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
if(groovematbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
groovematbi -= moneys;
lcnmatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
{
if(aztekazmatbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
aztekazmatbi -= moneys;
lcnmatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
{
if(ballasmatbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
ballasmatbi -= moneys;
lcnmatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
{
if(rifamatbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
rifamatbi -= moneys;
lcnmatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
{
if(vagosmatbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
vagosmatbi -= moneys;
lcnmatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
}
if(strcmp(m_nr,"yakuza",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /sellmats rm [кол-во]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 50000)
{
SendClientMessage(playerid, COLOR_GREY, "Вы не можете доставить на склад мафии меньше 1 и больше 50000 матов");
return 1;
}
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
if(groovematbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
groovematbi -= moneys;
yakuzamatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
{
if(aztekazmatbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
aztekazmatbi -= moneys;
yakuzamatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
{
if(ballasmatbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
ballasmatbi -= moneys;
yakuzamatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
{
if(rifamatbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
rifamatbi -= moneys;
yakuzamatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
{
if(vagosmatbi >= moneys)
{
format(string, sizeof(string), "Материалы успешно доставелны");
SendClientMessage(playerid, COLOR_GREEN, string);
vagosmatbi -= moneys;
yakuzamatbi += moneys;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"На складе вашей банды не достатачно материалов");
}
}
}
}
}
PHP:
else if(dialogid == 20004)
{
if(response)
{
if(PlayerToPoint(3.0,playerid,1257.1423,-791.0322,1084.0078))//YAKUZA
{
if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
{
switch(listitem)
{
case 0 :GivePlayerWeapon(playerid,24,14), yakuzamatbi -= 200;
case 1: GivePlayerWeapon(playerid,25,10), yakuzamatbi -= 150;
case 2: GivePlayerWeapon(playerid,31,90), yakuzamatbi -= 350;
case 3: GivePlayerWeapon(playerid,30,90), yakuzamatbi -= 300;
}
ShowPlayerDialog(playerid,10016,DIALOG_STYLE_LIST,"Склад","Дигл 14паатронов\nSHotgun 10патронов\nм4 90патронов\nАк47 90патронов","Выбрать","Отмена");
}
}
if(PlayerToPoint(3.0,playerid,1258.8202,-791.0245,1084.0078))//LCN
{
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
{
switch(listitem)
{
case 0 :GivePlayerWeapon(playerid,24,14), yakuzamatbi -= 200;
case 1: GivePlayerWeapon(playerid,25,10), yakuzamatbi -= 150;
case 2: GivePlayerWeapon(playerid,31,90), yakuzamatbi -= 350;
case 3: GivePlayerWeapon(playerid,30,90), yakuzamatbi -= 300;
}
ShowPlayerDialog(playerid,10016,DIALOG_STYLE_LIST,"Склад","Дигл 14паатронов\nSHotgun 10патронов\nм4 90патронов\nАк47 90патронов","Выбрать","Отмена");
}
}
if(PlayerToPoint(3.0,playerid,1257.4580,-790.9468,1084.0078) )//RM
{
if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
switch(listitem)
{
case 0 :GivePlayerWeapon(playerid,24,14), yakuzamatbi -= 200;
case 1: GivePlayerWeapon(playerid,25,10), yakuzamatbi -= 150;
case 2: GivePlayerWeapon(playerid,31,90), yakuzamatbi -= 350;
case 3: GivePlayerWeapon(playerid,30,90), yakuzamatbi -= 300;
}
ShowPlayerDialog(playerid,10016,DIALOG_STYLE_LIST,"Склад","Дигл 14паатронов\nSHotgun 10патронов\nм4 90патронов\nАк47 90патронов","Выбрать","Отмена");
}
}
}
}
else if(dialogid == 20005)
{
if(response)
{
switch(listitem)
{
case 0: SetPlayerCheckpoint(playerid,328.5804,1958.8092,18.0773,10),SendClientMessage(playerid, COLOR_GRAD1, "Место загрузки помечено на карте"),MatsArmyCar[playerid]=1;
case 1: SetPlayerCheckpoint(playerid,-1301.4447,467.1158,7.1875,10),SendClientMessage(playerid, COLOR_GRAD1, "Место разагрузки помечено на карте"),MatsArmyCar[playerid]=2;
case 2: SetPlayerCheckpoint(playerid,1529.6000,-1691.2000,13.3828,10),SendClientMessage(playerid, COLOR_GRAD1, "Место разагрузки помечено на карте"),MatsArmyCar[playerid]=3;
case 3: SetPlayerCheckpoint(playerid,-2441.0393,488.9982,30.0906,10),SendClientMessage(playerid, COLOR_GRAD1, "Место разагрузки помечено на карте"),MatsArmyCar[playerid]=4;
case 4: SetPlayerCheckpoint(playerid,-1595.6249,683.6390,-5.5151,10),SendClientMessage(playerid, COLOR_GRAD1, "Место разагрузки помечено на карте"),MatsArmyCar[playerid]=5;
case 5: SetPlayerCheckpoint(playerid,2234.1023,2465.3447,10.8203,10),SendClientMessage(playerid, COLOR_GRAD1, "Место разагрузки помечено на карте"),MatsArmyCar[playerid]=6;
}
}
}
Теперь добавим в команду /get
PHP:
else if(strcmp(x_job,"guns",true) == 0)
{
if(IsAGangZ(playerid))
{
new numberof;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /get guns [кол-во]");
if(PlayerInfo[playerid][pRank] < 4) return SendClientMessage(playerid,COLOR_GREY,"Функция доступна с 4ранга");
numberof = strval(tmp);
if(numberof < 1 || numberof > 500) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете взять меньше 1 и больше 500 материалов");
if(PlayerInfo[playerid][pMember]== 14 || PlayerInfo[playerid][pLeader]== 14)
{
if(numberof > groovematbi) return SendClientMessage(playerid, COLOR_GREY, "На складе вашей банды не достатачно материалов");
groovematbi -= numberof;
PlayerInfo[playerid][pMats]+=numberof;
format(string, sizeof(string),"Вы взяли %d материалов",numberof);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SaveMaterials();
return 1;
}
if(PlayerInfo[playerid][pMember]== 15 || PlayerInfo[playerid][pLeader]== 15)
{
if(numberof > aztekazmatbi) return SendClientMessage(playerid, COLOR_GREY, "На складе вашей банды не достатачно материалов");
aztekazmatbi -= numberof;
PlayerInfo[playerid][pMats]+=numberof;
format(string, sizeof(string),"Вы взяли %d материалов",numberof);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SaveMaterials();
return 1;
}
if(PlayerInfo[playerid][pMember]== 16 || PlayerInfo[playerid][pLeader]== 16)
{
if(numberof > ballasmatbi) return SendClientMessage(playerid, COLOR_GREY, "На складе вашей банды не достатачно материалов");
ballasmatbi -= numberof;
PlayerInfo[playerid][pMats]+=numberof;
format(string, sizeof(string),"Вы взяли %d материалов",numberof);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SaveMaterials();
return 1;
}
if(PlayerInfo[playerid][pMember]== 17 || PlayerInfo[playerid][pLeader]== 17)
{
if(numberof > rifamatbi) return SendClientMessage(playerid, COLOR_GREY, "На складе вашей банды не достатачно материалов");
rifamatbi -= numberof;
PlayerInfo[playerid][pMats]+=numberof;
format(string, sizeof(string),"Вы взяли %d материалов",numberof);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SaveMaterials();
return 1;
}
if(PlayerInfo[playerid][pMember]== 18 || PlayerInfo[playerid][pLeader]== 18)
{
if(PlayerInfo[playerid][pRank] < 4) return SendClientMessage(playerid,COLOR_GREY,"Функция доступна с 4ранга");
if(numberof > vagosmatbi) return SendClientMessage(playerid, COLOR_GREY, "На складе вашей банды не достатачно материалов");
vagosmatbi -= numberof;
PlayerInfo[playerid][pMats]+=numberof;
format(string, sizeof(string),"Вы взяли %d материалов",numberof);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SaveMaterials();
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не бандит");
return 1;
}
}
PHP:
if(strcmp(cmd,"/get",true)==0)
{
if(gPlayerLogged[playerid] != 0)
{
new x_job[256];
x_job = strtok(cmdtext, idx);
if(!strlen(x_job)) {
SendClientMessage(playerid, COLOR_WHITE, "----------====Помощь====----------");
SendClientMessage(playerid, COLOR_WHITE, "Используйте: /get [название]");
SendClientMessage(playerid, COLOR_GREY, "Доступные названия: Drugs, Fuel, Guns");
SendClientMessage(playerid, COLOR_GREEN, "==================================");
return 1;
}
if(strcmp(x_job,"drugs",true) == 0)
{
new price;
new ammount;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /get drugs [кол-во]");
return 1;
}
ammount = strval(tmp);
if(ammount < 1 || ammount > 150)
{
SendClientMessage(playerid, COLOR_GREY, "Вы не можете купить больше 1000 грам и меньше 1 грамма");
return 1;
}
if (PlayerInfo[playerid][pMember] == 13||PlayerInfo[playerid][pLeader] == 13||PlayerInfo[playerid][pMember] == 14||PlayerInfo[playerid][pLeader] == 14||
PlayerInfo[playerid][pMember] == 15||PlayerInfo[playerid][pLeader] == 15||PlayerInfo[playerid][pMember] == 16||PlayerInfo[playerid][pLeader] == 16||
PlayerInfo[playerid][pMember] == 17||PlayerInfo[playerid][pLeader] == 17||
PlayerInfo[playerid][pMember] == 18||PlayerInfo[playerid][pLeader] == 18 && PlayerToPoint(2.0, playerid, 323.0342,1118.5804,1083.8828))
{
price = ammount*5;
if(GetPlayerMoney(playerid) > price)
{
format(string, sizeof(string), "* Вы купили %d грамм за %d вирт", ammount, price);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GiveMoney(playerid, -price);
PlayerInfo[playerid][pDrugs] = PlayerInfo[playerid][pDrugs] + ammount;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " У вас нехватает денег");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Вы не в банде!");
return 1;
}
}
else if(strcmp(x_job,"fuel",true) == 0)
{
if(IsAtGasStation(playerid))
{
new price = 20 * SBizzInfo[1][sbEntranceCost];
format(string, sizeof(string), "* Вы заполнились, Ваш Газ Может с 20% Топливом для $%d",price);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerInfo[playerid][pFuel] = 20;
GiveMoney(playerid, - price);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GREY," Вы не около Бензоколонки!");
return 1;
}
}
else if(strcmp(x_job,"guns",true) == 0)
{
if(IsAGangZ(playerid))
{
new numberof;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /get guns [кол-во]");
return 1;
}
numberof = strval(tmp);
if(numberof < 1 || numberof > 500)
{
SendClientMessage(playerid, COLOR_GREY, "Вы не можете взять меньше 1 и больше 500 материалов");
return 1;
}
if(PlayerInfo[playerid][pMember]== 14 || PlayerInfo[playerid][pLeader]== 14)
{
if(PlayerInfo[playerid][pRank] < 4)
{
return SendClientMessage(playerid,COLOR_GREY,"Функция доступна с 4ранга");
}
if(numberof > groovematbi)
{
SendClientMessage(playerid, COLOR_GREY, "На складе вашей банды не достатачно материалов");
return 1;
}
groovematbi -= numberof;
PlayerInfo[playerid][pMats]+=numberof;
format(string, sizeof(string),"Вы взяли %d материалов",numberof);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SaveMaterials();
return 1;
}
if(PlayerInfo[playerid][pMember]== 15 || PlayerInfo[playerid][pLeader]== 15)
{
if(PlayerInfo[playerid][pRank] < 4)
{
return SendClientMessage(playerid,COLOR_GREY,"Функция доступна с 4ранга");
}
if(numberof > aztekazmatbi)
{
SendClientMessage(playerid, COLOR_GREY, "На складе вашей банды не достатачно материалов");
return 1;
}
aztekazmatbi -= numberof;
PlayerInfo[playerid][pMats]+=numberof;
format(string, sizeof(string),"Вы взяли %d материалов",numberof);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SaveMaterials();
return 1;
}
if(PlayerInfo[playerid][pMember]== 16 || PlayerInfo[playerid][pLeader]== 16)
{
if(PlayerInfo[playerid][pRank] < 4)
{
return SendClientMessage(playerid,COLOR_GREY,"Функция доступна с 4ранга");
}
if(numberof > ballasmatbi)
{
SendClientMessage(playerid, COLOR_GREY, "На складе вашей банды не достатачно материалов");
return 1;
}
ballasmatbi -= numberof;
PlayerInfo[playerid][pMats]+=numberof;
format(string, sizeof(string),"Вы взяли %d материалов",numberof);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SaveMaterials();
return 1;
}
if(PlayerInfo[playerid][pMember]== 17 || PlayerInfo[playerid][pLeader]== 17)
{
if(PlayerInfo[playerid][pRank] < 4)
{
return SendClientMessage(playerid,COLOR_GREY,"Функция доступна с 4ранга");
}
if(numberof > rifamatbi)
{
SendClientMessage(playerid, COLOR_GREY, "На складе вашей банды не достатачно материалов");
return 1;
}
rifamatbi -= numberof;
PlayerInfo[playerid][pMats]+=numberof;
format(string, sizeof(string),"Вы взяли %d материалов",numberof);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SaveMaterials();
return 1;
}
if(PlayerInfo[playerid][pMember]== 18 || PlayerInfo[playerid][pLeader]== 18)
{
if(PlayerInfo[playerid][pRank] < 4)
{
return SendClientMessage(playerid,COLOR_GREY,"Функция доступна с 4ранга");
}
if(numberof > vagosmatbi)
{
SendClientMessage(playerid, COLOR_GREY, "На складе вашей банды не достатачно материалов");
return 1;
}
vagosmatbi -= numberof;
PlayerInfo[playerid][pMats]+=numberof;
format(string, sizeof(string),"Вы взяли %d материалов",numberof);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SaveMaterials();
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не бандит");
return 1;
}
}
else { return 1; }
}//not connected
return 1;
}
И встовляем:
PHP:
new string[128];
new newcar = GetPlayerVehicleID(playerid);
if(newcar >= matsarmycar[0] && newcar <= matsarmycar[3])// возить на грузовиках
{
if(PlayerInfo[playerid][pMember]==19 || PlayerInfo[playerid][pLeader]==19)
{
format(string, sizeof(string), "Материалы:{FFFFFF} %d/5000", gruzmatbi[newcar]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SendClientMessage(playerid, TEAM_GROVE_COLOR, "{0049FF}Что бы загрузиться материалами введите{FFFFFF} (( /carm ))");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не состоите в Армии ЛВ");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(IsAFuraMats(newcar))
{
if(newcar == furagroov)
{
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
format(string, sizeof(string), "Материалы: %d/3000",gfuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не член The Groove street");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(newcar == furaaztekaz)
{
if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
{
format(string, sizeof(string), "Материалы: %d/3000",afuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не член Los Varios Aztekaz gang");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(newcar == furaballas)
{
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
format(string, sizeof(string), "Материалы: %d/3000",bfuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не член East Side Ballas gang");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(newcar == furarifa)
{
if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
{
format(string, sizeof(string), "Материалы: %d/3000",rfuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не член The rifa gang");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(newcar == furavagos)
{
if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
{
format(string, sizeof(string), "Материалы: %d/3000",vfuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не член Los Santos Vagos gang");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
//====================================[Система пвозки матов]====================
if(newcar == vertmats[0] || newcar == vertmats[1])//возить на вертолётах
{
if(PlayerInfo[playerid][pMember]==3 || PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "Материалы:{FFFFFF} %d/10000", vertmatbi[newcar]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Миссия по доставке матов началась!");
SendClientMessage(playerid, COLOR_WHITE, string);
VertMats[playerid]=1;
SetPlayerCheckpoint(playerid,-1468.2732,1490.6912,8.2578,10.0);
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не состоите в Армии СФ");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
PHP:
//============================[Система материалов]==============================
new carid = GetPlayerVehicleID(playerid);
if(VertMats[playerid]==1)
{
vertmatbi[carid] += 10000;
format(string, sizeof(string), "Маты успешно загружены! Компоненты материалов: %d/10000", vertmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
VertMats[playerid]=2;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,332.3795,1993.9960,17.6406,10);
return 1;
}
else if(VertMats[playerid]==2)
{
if(lvarmmatbi >= 100000)
{
SendClientMessage(playerid, COLOR_GREY, "Склад полон");
return 1;
}
new maxmatslvarm = 100000;
new needmats = maxmatslvarm -= lvarmmatbi;
if(lvarmmatbi >= 90000)
{
vertmatbi[carid] -= needmats;
lvarmmatbi += needmats;
format(string, sizeof(string), "Маты успешно Доставлены!! Компоненты материалов:{FFFFFF} %d/10000", vertmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Склад ARMY LV:{FFFFFF} %d/100000", lvarmmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
VertMats[playerid]=1;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,-1468.2732,1490.6912,8.2578,10.0);
SaveMaterials();
return 1;
}
vertmatbi[carid] -= 10000;
lvarmmatbi += 10000;
format(string, sizeof(string), "Маты успешно Доставлены! Компоненты материалов:{FFFFFF} %d/10000", vertmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Склад ARMY LV:{FFFFFF} %d/100000", lvarmmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
VertMats[playerid]=1;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,-1468.2732,1490.6912,8.2578,10.0);
SaveMaterials();
return 1;
}
new lolmats = gruzmatbi[carid];
if(MatsArmyCar[playerid]==1)
{
if(carid >= matsarmycar[0] && carid <= matsarmycar[3])
{
if(gruzmatbi[carid] >= 5000 || lvarmmatbi <= 5000)
{
SendClientMessage(playerid, COLOR_GREY, "Грузовик полон/Склад пуст");
return 1;
}
gruzmatbi[carid] += 5000;
format(string, sizeof(string), "Маты успешно загружены! Компоненты материалов:{FFFFFF} %d/5000", gruzmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
lvarmmatbi -= 5000;
MatsArmyCar[playerid]=0;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "На глваном складе:{FFFFFF} %d/100000", lvarmmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveMaterials();
return 1;
}
}
else if(MatsArmyCar[playerid]==2)
{
if(carid >= matsarmycar[0] && carid <= matsarmycar[3])
{
if(sfarmmatbi >= 50000)
{
SendClientMessage(playerid, COLOR_GREY, "Склад полон");
return 1;
}
new maxmatssfarm = 50000;
new needmats = maxmatssfarm -= sfarmmatbi;
if(sfarmmatbi >= 45000)
{
gruzmatbi[carid] -= needmats;
format(string, sizeof(string), "Маты успешно доставлены! Компоненты материалов: %d/5000", gruzmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
sfarmmatbi += needmats;
MatsArmyCar[playerid]=0;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "На складе ARMY SF:{FFFFFF} %d/50000", sfarmmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveMaterials();
return 1;
}
gruzmatbi[carid] -= lolmats;
format(string, sizeof(string), "Маты успешно доставлены! Компоненты материалов: %d/5000", gruzmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
sfarmmatbi += lolmats;
MatsArmyCar[playerid]=0;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "На складе ARMY SF:{FFFFFF} %d/50000", sfarmmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveMaterials();
return 1;
}
}
else if(MatsArmyCar[playerid]==3)
{
if(carid >= matsarmycar[0] && carid <= matsarmycar[3])
{
if(lspdmatbi >= 50000)
{
SendClientMessage(playerid, COLOR_GREY, "Склад полон");
return 1;
}
new maxmatslspd = 50000;
new needmats = maxmatslspd -= lspdmatbi;
if(lspdmatbi >= 45000)
{
gruzmatbi[carid] -= needmats;
lspdmatbi += needmats;
MatsArmyCar[playerid]=0;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "Маты успешно доставлееы! Компоненты материалов: %d/5000", gruzmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "На складе LSPD:{FFFFFF} %d/50000", lspdmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveMaterials();
return 1;
}
gruzmatbi[carid] -= lolmats;
lspdmatbi += lolmats;
MatsArmyCar[playerid]=0;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "Маты успешно доставлееы! Компоненты материалов: %d/5000", gruzmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "На складе LSPD:{FFFFFF} %d/50000", lspdmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveMaterials();
return 1;
}
}
else if(MatsArmyCar[playerid]==4)
{
if(carid >= matsarmycar[0] && carid <= matsarmycar[3])
{
if(fbimatbi >= 50000)
{
SendClientMessage(playerid, COLOR_GREY, "Склад полон");
return 1;
}
new maxmatsfbi = 50000;
new needmats = maxmatsfbi -= fbimatbi;
if(fbimatbi >= 45000)
{
gruzmatbi[carid] -= needmats;
format(string, sizeof(string), "Маты успешно доставлены! Компоненты материалов: %d/5000", gruzmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
fbimatbi += needmats;
MatsArmyCar[playerid]=0;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "На складе FBI:{FFFFFF} %d/50000", fbimatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveMaterials();
return 1;
}
gruzmatbi[carid] -= lolmats;
format(string, sizeof(string), "Маты успешно доставлены! Компоненты материалов: %d/5000", gruzmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
fbimatbi += lolmats;
MatsArmyCar[playerid]=0;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "На складе FBI:{FFFFFF} %d/50000", fbimatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveMaterials();
return 1;
}
}
else if(MatsArmyCar[playerid]==5)
{
if(carid >= matsarmycar[0] && carid <= matsarmycar[3])
{
if(sfpdmatbi >= 50000)
{
SendClientMessage(playerid, COLOR_GREY, "Склад полон");
return 1;
}
new maxmatssfpd = 50000;
new needmats = maxmatssfpd -= sfpdmatbi;
if(sfpdmatbi >= 45000)
{
gruzmatbi[carid] -= needmats;
sfpdmatbi += needmats;
MatsArmyCar[playerid]=0;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "Маты успешно доставлееы! Компоненты материалов: %d/5000", gruzmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "На складе SFPD:{FFFFFF} %d/50000", sfpdmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveMaterials();
return 1;
}
gruzmatbi[carid] -= lolmats;
sfpdmatbi += lolmats;
MatsArmyCar[playerid]=0;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "Маты успешно доставлееы! Компоненты материалов: %d/5000", gruzmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "На складе SFPD:{FFFFFF} %d/50000", sfpdmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveMaterials();
return 1;
}
}
else if(MatsArmyCar[playerid]==6)
{
if(carid >= matsarmycar[0] && carid <= matsarmycar[3])
{
if(lvpdmatbi >= 50000)
{
SendClientMessage(playerid, COLOR_GREY, "Склад полон");
return 1;
}
new maxmatslvpd = 50000;
new needmats = maxmatslvpd -= lvpdmatbi;
if(lvpdmatbi >= 45000)
{
gruzmatbi[carid] -= needmats;
lvpdmatbi = needmats;
MatsArmyCar[playerid]=0;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "Маты успешно доставлееы! Компоненты материалов: %d/5000", gruzmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "На складе LVPD:{FFFFFF} %d/50000", lspdmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveMaterials();
return 1;
}
gruzmatbi[carid] -= lolmats;
lvpdmatbi += lolmats;
MatsArmyCar[playerid]=0;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "Маты успешно доставлееы! Компоненты материалов: %d/5000", gruzmatbi[carid]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "На складе LVPD:{FFFFFF} %d/50000", lspdmatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveMaterials();
return 1;
}
}
ко всем new
PHP:
new mats0,mats23, mats1,mats2,mats3,mats4,armygun,armysfgun,sfpdgun,lvpdgun,lspdgun,fbigun;
PHP:
else if(pickupid == mats0)
{
if(lvarmmatbi >= 500)
{
PlayerInfo[playerid][pMats] = 500;
lvarmmatbi -= 500;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы взяли не сколько комплектов");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Склад военных пуст");
}
}
else if(pickupid == mats1)
{
if(lvarmmatbi >= 500)
{
PlayerInfo[playerid][pMats] = 500;
lvarmmatbi -= 500;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы взяли не сколько комплектов");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Склад военных пуст");
}
}
else if(pickupid == mats2)
{
if(lvarmmatbi >= 500)
{
PlayerInfo[playerid][pMats] = 500;
lvarmmatbi -= 500;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы взяли не сколько комплектов");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Склад военных пуст");
}
}
else if(pickupid == mats3)
{
if(lvarmmatbi >= 500)
{
PlayerInfo[playerid][pMats] = 500;
lvarmmatbi -= 500;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы взяли не сколько комплектов");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Склад военных пуст");
}
}
else if(pickupid == mats4)
{
if(lvarmmatbi >= 500)
{
PlayerInfo[playerid][pMats] = 500;
lvarmmatbi -= 500;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы взяли не сколько комплектов");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Склад военных пуст");
}
}
else if(pickupid == mats23)
{
if(sfarmmatbi >= 500)
{
PlayerInfo[playerid][pMats] = 500;
sfarmmatbi -= 500;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы взяли не сколько комплектов");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Склад военных пуст");
}
}
else if(pickupid == armygun)
{
if(PlayerInfo[playerid][pLeader] == 19 || PlayerInfo[playerid][pMember] == 19)
{
if(lvarmmatbi < 300)
{
SendClientMessage(playerid,COLOR_RED,"Не достаточно боеприпасов");
return 1;
}
GivePlayerWeapon(playerid,24,21);
GivePlayerWeapon(playerid,31,150);
SetPlayerArmour(playerid,100.0);
SetPlayerHealthAC(playerid,100.0);
SendClientMessage(playerid, COLOR_GREEN, "Выдано: M4(3 обоймы) Deagle(3 обоймы) броня.");
lvarmmatbi -= 300;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Вы не состоите в Армии ЛВ");
}
}
else if(pickupid == armysfgun)
{
if(PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 3)
{
if(sfarmmatbi < 300)
{
SendClientMessage(playerid,COLOR_RED,"Не достаточно боеприпасов");
return 1;
}
GivePlayerWeapon(playerid,24, 21);
GivePlayerWeapon(playerid,31, 150);
SetPlayerArmour(playerid,100.0);
SetPlayerHealthAC(playerid,100.0);
SendClientMessage(playerid, COLOR_GREEN, "Выдано: m4(3обоймы) deagle(3обоймы) броня.");
sfarmmatbi -= 300;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Вы не состоите в Армии СФ");
}
}
else if(pickupid == sfpdgun)
{
if(PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 8)
{
if(sfpdmatbi < 200)
{
SendClientMessage(playerid,COLOR_RED,"Не достаточно боеприпасов");
return 1;
}
GivePlayerWeapon(playerid,24, 21);
SetPlayerArmour(playerid,100.0);
SetPlayerHealthAC(playerid,100.0);
SendClientMessage(playerid, COLOR_GREEN, "Выдано: Deagle(3 обоймы) броня.");
sfpdmatbi -= 200;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Вы не состоите в SFPD");
}
}
else if(pickupid == lvpdgun)
{
if(PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 12)
{
if(lvpdmatbi < 200)
{
SendClientMessage(playerid,COLOR_RED,"Не достаточно боеприпасов");
return 1;
}
GivePlayerWeapon(playerid,24,21);
SetPlayerArmour(playerid,100.0);
SetPlayerHealthAC(playerid,100.0);
SendClientMessage(playerid, COLOR_GREEN, "Выдано: Deagle(3 обоймы) броня.");
lvpdmatbi -= 200;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Вы не состоите в LVPD");
}
}
else if(pickupid == lspdgun)
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
{
if(lspdmatbi < 200)
{
SendClientMessage(playerid,COLOR_RED,"Не достаточно боеприпасов");
return 1;
}
GivePlayerWeapon(playerid,24,21);
SetPlayerArmour(playerid,100.0);
SetPlayerHealthAC(playerid,100.0);
SendClientMessage(playerid, COLOR_GREEN, "Выдано: Deagle(3 обоймы) броня.");
lspdmatbi -= 200;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Вы не состоите в LSPD");
}
}
else if(pickupid == fbigun)
{
if(PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2)
{
if(sfpdmatbi < 250)
{
SendClientMessage(playerid,COLOR_RED,"Не достаточно боеприпасов");
return 1;
}
GivePlayerWeapon(playerid,24,21);
SetPlayerArmour(playerid,100.0);
SetPlayerHealthAC(playerid,100.0);
SendClientMessage(playerid, COLOR_GREEN, "Выдано: Deagle(3 обоймы) броня.");
fbimatbi -= 250;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Вы не состоите в FBI");
}
}
PHP:
armygun = CreatePickup(1239,2,247.1970,1859.2422,14.0840);
sfpdgun = CreatePickup(1239,2,312.6209,-165.8534,999.6010,10);
lvpdgun = CreatePickup(1239,2,312.6209,-165.8534,999.6010,11);
lspdgun = CreatePickup(1239,2,312.6209,-165.8534,999.6010,12);
fbigun = CreatePickup(1239,2,325.9459,306.9414,999.1484);
armysfgun = CreatePickup(1239,2,312.1891,-165.5921,999.6010);
PHP:
//=======================[Вертолёты на каторых возят маты]======================
forward IsAVertMats(carid);
public IsAVertMats(carid){if(carid == vertmats[0]|| carid == vertmats[1]){return 1;}return 0;}
//------------------------------------------------------------------------------------------------------
forward IsAFuraMats(carid);
public IsAFuraMats(carid)
{
if(carid ==furaaztekaz || carid == furagroov
||carid ==furavagos || carid == furarifa || carid == furaballas || matsarmycar[0] || matsarmycar[1]
|| matsarmycar[2] || matsarmycar[3])
{
return 1;
}
return 0;
}
forward IsAGangZ(playerid);
public IsAGangZ(playerid)
{
if(IsPlayerConnected(playerid))
{
new leader = PlayerInfo[playerid][pLeader];
new member = PlayerInfo[playerid][pMember];
if(member==14 || member==15 || member==16 || member==17 || member==18)
{
return 1;
}
if(leader==14 || leader==15 || leader==16 || leader==17 || leader==18)
{
return 1;
}
}
return 0;
}
Автор мануала: Fresh_Light || Barni
При копировании материала указывать источник и автора!
Инклюд Mxini ссылка:
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Последнее редактирование:
