Код:
ко всем new добавим Код: new bool:bank = false, banks[5][MAX_PLAYERS], picbank, bomba[3], dver[2]; в public OnGameModeInit() добавим: Код: dver[0] = CreateObject(2634, 2144.174316,1626.977172,994.257751, 0.000000,0.000000,179.399810); picbank = CreatePickup(1550,23,X,Y,Z);// за место X.Y.Z ставим свои кординаты для ограбления ко всем объектам добавим: Код: CreateObject(1533, 2129.691894,1625.005371,992.568298, 0.000000,0.000000,93.900024); в public OnPlayerPickUpPickup(playerid, pickupid) добавим Код: if(pickupid == picbank) { if(bank == true) return SendClientMessage(playerid, COLOR_GREY, "[Ошибка] Банк уже ограбили!Повторно можно ограбить токо через 1час!"); { bank = true; SendClientMessage(playerid, 0xFFFF00FF, "Отключите питание!"); DisablePlayerCheckpoint(playerid); banks[0][playerid] = 1; SetPlayerCheckpoint(playerid,2142.9873,1619.9999,1000.9688, 5.0); SetPlayerPos(playerid,2148.2375,1597.6710,1003.9677); SetPlayerInterior(playerid,1); } } в OnPlayerEnterCheckpoint(playerid) добавим: Код: if(banks[0][playerid] == 1) { DisablePlayerCheckpoint(playerid); banks[0][playerid] = 0; banks[1][playerid] = 1; SendClientMessage(playerid,0xFFFF00FF, "Вы успешно отключили питание!"); SendClientMessage(playerid,0xFFFF00FF, "Идите установите бомбу!"); SetPlayerCheckpoint(playerid,2144.1279,1625.8286,993.6882, 1.5); return 1; } if(banks[1][playerid] == 1) { DisablePlayerCheckpoint(playerid); banks[1][playerid] = 0; banks[2][playerid] = 1; bomba[0] = CreateObject(1654, 2145.255859,1626.748168,995.377868, 0.000000,0.000000,0.000000); bomba[1] = CreateObject(1654, 2145.247558,1626.801025,994.208007, 0.000000,0.000000,0.000000); bomba[2] = CreateObject(1654, 2145.257812,1626.761962,993.158142, 0.000000,0.000000,0.00000); SelectObject(bomba[0]); SelectObject(bomba[1]); SelectObject(bomba[2]); SendClientMessage(playerid,0xFFFF00FF, "Вы установили бомбы на петли от бегите на безопасное растояние!"); SetPlayerCheckpoint(playerid,2144.1572,1597.6097,995.5676, 1.5); return 1; } if(banks[2][playerid] == 1) { DisablePlayerCheckpoint(playerid); banks[2][playerid] = 0; banks[3][playerid] = 1; DestroyObject(bomba[0]); DestroyObject(bomba[1]); DestroyObject(bomba[2]); DestroyObject(dver[0]); CreateExplosion(2144.1279,1625.8286,993.6882,2,5.0); dver[1] = CreateObject(2634, 2144.139892,1628.926513,992.669738, 90.899986,0.000000,178.599990); SelectObject(dver[1]); SendClientMessage(playerid,0xFFFF00FF, "Вы взорвали бомбы! Быстрей бегите забирать деньги!"); SetPlayerCheckpoint(playerid,2146.3982,1637.4023,993.5761, 1.5); return 1; } if(banks[3][playerid] == 1) { DisablePlayerCheckpoint(playerid); banks[3][playerid] = 0; banks[4][playerid] = 1; GivePlayerMoney(playerid, random(100000 - 500000)); SendClientMessage(playerid,0xFFFF00FF, "Вы успешно ограбили банк!"); SendClientMessage(playerid,0xFFFF00FF, "Вам пора сваливать!"); SetPlayerCheckpoint(playerid,2131.2402,1625.6312,993.6882, 1.5); return 1; } if(banks[4][playerid] == 1) { DisablePlayerCheckpoint(playerid); banks[4][playerid] = 0; SendClientMessage(playerid,0xFFFF00FF, "Вы успешно убежали с банка!"); SetPlayerInterior(playerid,0); SetPlayerPos(playerid,X,Y,Z);// за место X,Y,Z ставим свои кординаты где хотим спавнить его после ограбление return 1; } в PayDay добавьте Код: bank = false;
Автор:Витек