Fun4ik
Ученик
Доброго времени суток, ув. Пользователи pawno-info.ru!
Сегодня, я думал, чего бы такого сделать для любимого форума, но оригинальных идей не было
Тогда, я решил, что сделаю систему банка, но не тупо пополнить счет и т.д., а полноценную систему.
В моём фс присутствует:
1) Пополнение, снятие со счета средств.
2) Ограбление банка
3) Ограбление инкасаторской машины
4) Работа инкасатора.
Итак, начнем с пополнения счета. Вы можете пополнить и снять деньги в любом из банкоматов или в самом банке. Проценты при снятии и пополнение не снимает, все деньги которые вы положили поступают к вам на счет. У каждого игрока свой уникальный Пин-код, для управления счетом.
Ограбление банка довольно таки банальное, мы покупаем бомбы, инструменты и идем грабить банк
Есть 2 способа ограбить, это:
1) Отключить сигнализацию и после того как мы ограбили банк, выйти через тот же вход, что и вошли.
2) Пойти на прямую, взорвать к х*ям дверь, после чего начнётся тревога и вам останется только сидеть и ждать, либо найти другой выход.
Ограбление инкасаторской машины, принцип очень похожe, на то, что и ограбление хранилища, только без тревожной кнопки.
Работа инкасатора, заключается в том, чтобы ездить по банкоматам и собирать из них все деньги, которые есть ( в скрипте это рандом ).
!!! Все купленные вами бомбы, а так же инструменты суммируются !!!
!!! Через вентиляцию на 2ом этаже можно вылезти ( там где открыто ) !!!
!!! Все действия произведены на кнопку медленной ходьбы !!!
!!! TextDraw'ы и нубо-маппинг сделаны мной !!!
!!! Автор: я !!!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
PHP:
#include <a_samp>
#include <mxINI>
#define bankdialog 1000
#define buyinst 1010
#define jobinkas 1020
#define Money(%0,%1) GivePlayerMoney(%0,(%1))
#define GetMoney(%0) GetPlayerMoney(%0)
#define MAX_BANK 3
forward DoorOpening(playerid);
forward NewBalance(playerid);
forward Loading(playerid);
forward IncasGrab(playerid,vehicleid);
enum bank
{
PinKode,
Balance
}
new
CarBank[2],Door[2],Bank[MAX_PLAYERS][bank],player[50],bool:DoorBom[2] = false,bool:BankClose,bool:BankSignal = true,bomb,balance[50],TimeLoad[MAX_PLAYERS],
Pickup[5],VehIn[5][MAX_VEHICLES],Float:VehPos[3][MAX_VEHICLES],Text:ServerTxt[10],PlayerText:PlayerTxt[10][MAX_PLAYERS],BankPick[MAX_PLAYERS]
;
new Float:bankPick[MAX_BANK][] = {
{1511.8885,-1060.5405,25.0625},
{1538.4548,-1073.8409,25.0625},
{1510.4561,-1026.8143,23.7903}
};
public OnFilterScriptInit()
{
CarBank[0] = AddStaticVehicleEx(428,1542.6000000,-1023.6000000,24.2000000,344.0000000,-1,-1,60000);
AddStaticVehicleEx(428,1547.1000000,-1024.8000000,24.2000000,343.9980000,-1,-1,60000);
AddStaticVehicleEx(428,1551.4000000,-1026.2000000,24.2000000,343.9980000,-1,-1,60000);
AddStaticVehicleEx(428,1555.7000000,-1027.6000000,24.2000000,343.9980000,-1,-1,60000);
AddStaticVehicleEx(428,1560.0000000,-1028.8000000,24.2000000,343.9980000,-1,-1,60000);
AddStaticVehicleEx(428,1564.2000000,-1030.1000000,24.2000000,343.9980000,-1,-1,60000);
AddStaticVehicleEx(428,1570.6000000,-1033.8000000,24.2000000,323.9980000,-1,-1,60000);
AddStaticVehicleEx(428,1574.2000000,-1036.4000000,24.2000000,323.9980000,-1,-1,60000);
CarBank[1] = AddStaticVehicleEx(428,1577.7000000,-1039.2000000,24.2000000,323.9980000,-1,-1,60000);
CreateObject(14576,1407.7002000,-973.9003900,-11.5000000,0.0000000,0.0000000,0.0000000); //object(vault_door) (2)
CreateObject(13007,1414.1801000,-978.7000100,-5.3000000,0.0000000,0.0000000,270.0000000); //object(sw_bankbits) (1)
CreateObject(3093,1410.5996000,-988.5996100,-5.7000000,0.0000000,0.0000000,90.0000000); //object(cuntgirldoor) (1)
CreateObject(3093,1413.4000000,-988.5999800,-5.7000000,0.0000000,0.0000000,90.0000000); //object(cuntgirldoor) (2)
CreateObject(3093,1412.0000000,-988.5996100,-3.6000000,0.0000000,0.0000000,90.0000000); //object(cuntgirldoor) (3)
CreateObject(2946,1421.6000000,-973.2000100,-7.1000000,0.0000000,0.0000000,0.0000000); //object(cr_door_03) (1)
CreateObject(2946,1421.6000000,-970.0200200,-7.1000000,0.0000000,0.0000000,180.0000000); //object(cr_door_03) (2)
CreateObject(3093,1413.4000000,-991.2000100,-9.9000000,0.0000000,0.0000000,358.0000000); //object(cuntgirldoor) (3)
CreateObject(3093,1413.4000000,-991.0000000,-9.9000000,0.0000000,0.0000000,358.0000000); //object(cuntgirldoor) (3)
CreateObject(16203,1464.6000000,-820.5000000,34.7000000,0.0000000,0.0000000,314.0000000); //object(cen_bit_11) (1)
CreateObject(3093,1423.1000000,-898.2999900,31.2000000,0.0000000,0.0000000,128.0000000); //object(cuntgirldoor) (3)
Door[0] = CreateObject(2930,1412.2000000,-988.5000000,-4.5000000,0.0000000,0.0000000,270.0000000);
Door[1] = CreateObject(2634,1407.7000000,-966.2000100,-18.0000000,0.0000000,0.0000000,180.0000000);
CreatePickup(19132, 1, 1457.0179,-1010.2144,26.8438, 0);
CreatePickup(19132, 1, 1421.1708,-971.5960,-6.0817,0);
CreatePickup(1239, 1, 1417.6937,-979.2332,-6.0891,0);
Create3DTextLabel("« Управление счетом »",0xFFFFFFFF,1417.6937,-979.2332,-6.089,20.0,0);
CreatePickup(1239, 1, 1489.1312,-1719.8320,8.2395,0);
Create3DTextLabel("« Устройство на работу »",0xFFFFFFFF,1418.0072,-985.3810,-6.0891,20.0,0);
CreatePickup(1239, 1, 1418.0072,-985.3810,-6.0891,0);
for(new i; i != MAX_BANK; i++)
{
Create3DTextLabel("« Банкомат »",0xFFFFFFFF,bankPick[i][0], bankPick[i][1], bankPick[i][2],20.0,0);
CreatePickup(1239, 1, bankPick[i][0], bankPick[i][1], bankPick[i][2],0);
}
ServerTxt[0] = TextDrawCreate(320.000000, 150.000000, "_");TextDrawAlignment(ServerTxt[0], 2);TextDrawBackgroundColor(ServerTxt[0], 255);TextDrawFont(ServerTxt[0], 1);TextDrawLetterSize(ServerTxt[0], 0.500000, 16.000003);TextDrawColor(ServerTxt[0], -1);TextDrawSetOutline(ServerTxt[0], 0);TextDrawSetProportional(ServerTxt[0], 1);TextDrawSetShadow(ServerTxt[0], 1);
TextDrawUseBox(ServerTxt[0], 1);TextDrawBoxColor(ServerTxt[0], 128);TextDrawTextSize(ServerTxt[0], 0.000000, -240.000000); TextDrawSetSelectable(ServerTxt[0], 0);
ServerTxt[1] = TextDrawCreate(320.000000, 153.000000, "_");TextDrawAlignment(ServerTxt[1], 2);TextDrawBackgroundColor(ServerTxt[1], 255);TextDrawFont(ServerTxt[1], 1);TextDrawLetterSize(ServerTxt[1], 0.500000, 1.800003);TextDrawColor(ServerTxt[1], -1);TextDrawSetOutline(ServerTxt[1], 0);TextDrawSetProportional(ServerTxt[1], 1);TextDrawSetShadow(ServerTxt[1], 1);
TextDrawUseBox(ServerTxt[1], 1);TextDrawBoxColor(ServerTxt[1], -1426063488);TextDrawTextSize(ServerTxt[1], -1.000000, -236.000000);TextDrawSetSelectable(ServerTxt[1], 0);
ServerTxt[2] = TextDrawCreate(320.000000, 191.000000, "_");TextDrawAlignment(ServerTxt[2], 2);TextDrawBackgroundColor(ServerTxt[2], 255);TextDrawFont(ServerTxt[2], 1);TextDrawLetterSize(ServerTxt[2], 0.500000, 3.900002);TextDrawColor(ServerTxt[2], -1);TextDrawSetOutline(ServerTxt[2], 0);TextDrawSetProportional(ServerTxt[2], 1);TextDrawSetShadow(ServerTxt[2], 1);
TextDrawUseBox(ServerTxt[2], 1);TextDrawBoxColor(ServerTxt[2], -1426063488);TextDrawTextSize(ServerTxt[2], -1.000000, -136.000000);TextDrawSetSelectable(ServerTxt[2], 0);
ServerTxt[3] = TextDrawCreate(320.000000, 241.000000, "_");TextDrawAlignment(ServerTxt[3], 2);TextDrawBackgroundColor(ServerTxt[3], 255);TextDrawFont(ServerTxt[3], 1);TextDrawLetterSize(ServerTxt[3], 0.500000, 3.900002);TextDrawColor(ServerTxt[3], -1);TextDrawSetOutline(ServerTxt[3], 0);TextDrawSetProportional(ServerTxt[3], 1);TextDrawSetShadow(ServerTxt[3], 1);
TextDrawUseBox(ServerTxt[3], 1);TextDrawBoxColor(ServerTxt[3], -1426063488);TextDrawTextSize(ServerTxt[3], -1.000000, -136.000000);TextDrawSetSelectable(ServerTxt[3], 0);
ServerTxt[4] = TextDrawCreate(261.000000, 189.000000, "ЈOЊO‡м…Џ’");TextDrawBackgroundColor(ServerTxt[4], 255);TextDrawFont(ServerTxt[4], 2);TextDrawLetterSize(ServerTxt[4], 0.499999, 3.699999);TextDrawColor(ServerTxt[4], -1);TextDrawSetOutline(ServerTxt[4], 0);TextDrawSetProportional(ServerTxt[4], 1);TextDrawSetShadow(ServerTxt[4], 0);TextDrawSetSelectable(ServerTxt[4], 1);
ServerTxt[5] = TextDrawCreate(290.000000, 239.000000, "Cм•Џ’");TextDrawBackgroundColor(ServerTxt[5], 255);TextDrawFont(ServerTxt[5], 2);TextDrawLetterSize(ServerTxt[5], 0.499999, 3.699999);TextDrawColor(ServerTxt[5], -1);TextDrawSetOutline(ServerTxt[5], 0);TextDrawSetProportional(ServerTxt[5], 1);TextDrawSetShadow(ServerTxt[5], 0);TextDrawSetSelectable(ServerTxt[5], 1);
return 1;
}
public OnPlayerConnect(playerid)
{
format(player,sizeof(player),"bank/%s.ini",Name(playerid));
if(!fexist(player))
{
new iniFile = ini_createFile(player);
if(iniFile < 0) ini_openFile(player);
{
ini_setInteger(iniFile, "PinKode", 0);
ini_setInteger(iniFile, "Balance", 0);
ini_closeFile(iniFile);
}
}
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
SetPVarInt(playerid,"Bomb",10);
SetPVarInt(playerid,"Inst",10);
SetPVarInt(playerid,"InkasJob",0);
PlayerTxt[0][playerid] = CreatePlayerTextDraw(playerid,206.000000, 150.000000, "$000000000");PlayerTextDrawBackgroundColor(playerid,PlayerTxt[0][playerid], 255);PlayerTextDrawFont(playerid,PlayerTxt[0][playerid], 2);PlayerTextDrawLetterSize(playerid,PlayerTxt[0][playerid], 0.389999, 2.200000);PlayerTextDrawColor(playerid,PlayerTxt[0][playerid], -1);
PlayerTextDrawSetOutline(playerid,PlayerTxt[0][playerid], 0);PlayerTextDrawSetProportional(playerid,PlayerTxt[0][playerid], 1);PlayerTextDrawSetShadow(playerid,PlayerTxt[0][playerid], 0);PlayerTextDrawSetSelectable(playerid,PlayerTxt[0][playerid], 0);
PlayerTxt[1][playerid] = CreatePlayerTextDraw(playerid,318.000000, 340.000000, "_");PlayerTextDrawAlignment(playerid,PlayerTxt[1][playerid], 2);PlayerTextDrawBackgroundColor(playerid,PlayerTxt[1][playerid], 255);PlayerTextDrawFont(playerid,PlayerTxt[1][playerid], 1);PlayerTextDrawLetterSize(playerid,PlayerTxt[1][playerid], 0.500000, 1.800000);PlayerTextDrawColor(playerid,PlayerTxt[1][playerid], -1);
PlayerTextDrawSetOutline(playerid,PlayerTxt[1][playerid], 0);PlayerTextDrawSetProportional(playerid,PlayerTxt[1][playerid], 1);
PlayerTextDrawSetShadow(playerid,PlayerTxt[1][playerid], 1);PlayerTextDrawUseBox(playerid,PlayerTxt[1][playerid], 1);PlayerTextDrawBoxColor(playerid,PlayerTxt[1][playerid], 128);PlayerTextDrawTextSize(playerid,PlayerTxt[1][playerid], 0.000000, -197.000000);PlayerTextDrawSetSelectable(playerid,PlayerTxt[1][playerid], 0);
PlayerTxt[2][playerid] = CreatePlayerTextDraw(playerid,226.000000, 342.000000, "__");PlayerTextDrawBackgroundColor(playerid,PlayerTxt[2][playerid], 255);PlayerTextDrawFont(playerid,PlayerTxt[2][playerid], 1);PlayerTextDrawLetterSize(playerid,PlayerTxt[2][playerid], 0.500000, 1.300000);PlayerTextDrawColor(playerid,PlayerTxt[2][playerid], -1);PlayerTextDrawSetOutline(playerid,PlayerTxt[2][playerid], 0);
PlayerTextDrawSetProportional(playerid,PlayerTxt[2][playerid], 1);PlayerTextDrawSetShadow(playerid,PlayerTxt[2][playerid], 1);PlayerTextDrawUseBox(playerid,PlayerTxt[2][playerid], 1);PlayerTextDrawBoxColor(playerid,PlayerTxt[2][playerid], -1431306368);PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 410.000000, 9.000000);PlayerTextDrawSetSelectable(playerid,PlayerTxt[2][playerid], 0);
return 1;
}
public OnPlayerDisconnect(playerid)
{
format(player,sizeof(player), "bank/%s.ini", Name(playerid));
new iniFile = ini_openFile(player);
ini_setInteger(iniFile, "PinKode", Bank[playerid][PinKode]);
ini_setInteger(iniFile, "Balance", Bank[playerid][Balance]);
ini_closeFile(iniFile);
return 1;
}
public OnPlayerSpawn(playerid)
{
format(player,sizeof(player), "bank/%s.ini", Name(playerid));
new iniFile = ini_openFile(player);
ini_getInteger(iniFile, "PinKode", Bank[playerid][PinKode]);
ini_getInteger(iniFile, "Balance", Bank[playerid][Balance]);
ini_closeFile(iniFile);
Money(playerid,10000);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new Float:obpos[3];
if(newkeys == KEY_WALK)
{
if(IsPlayerInRangeOfPoint(playerid,3.0,1457.0179,-1010.2144,26.8438)) if(BankClose == true) SendClientMessage(playerid,-1,"Простите, но банк закрыт!"); else SetPlayerPos(playerid,1421.1708,-971.5960,-6.0817);
else if(IsPlayerInRangeOfPoint(playerid,3.0,1421.1708,-971.5960,-6.0817)) if(BankClose == true) SendClientMessage(playerid,-1,"Простите, но банк закрыт!"); else SetPlayerPos(playerid,1457.0179,-1010.2144,26.8438);
for(new i; i != MAX_BANK; i++)
{
if(IsPlayerInRangeOfPoint(playerid,3.0,1417.6937,-979.2332,-6.0891) && IsPlayerInRangeOfPoint(playerid,3.0,bankPick[i][0], bankPick[i][1], bankPick[i][2]))
{
if(Bank[playerid][PinKode] != 0) ShowPlayerDialog(playerid,bankdialog,1," ","Введите пин-код от своего счета снизу:","Дальше","Закрыть");
else
{
new
r = random(9999),str[50]
;
Bank[playerid][PinKode] = r;
format(str,50,"Ваш пин-код: %d",r);
SendClientMessage(playerid,-1,str);
}
}
}
if(IsPlayerInRangeOfPoint(playerid,3.0,1411.2866,-988.0768,-6.0891))
{
GetObjectPos(Door[0], obpos[0], obpos[1], obpos[2]);
if(DoorBom[0] == false && obpos[0] != 1412.4000000 && obpos[1] != -991.4000200 && obpos[2] != -7.1000000 && GetPVarInt(playerid,"Inst") != 0)
{
DoorBom[0] = true;
SetPVarInt(playerid,"Inst",GetPVarInt(playerid,"Inst") - 1);
SetTimerEx("DoorOpening",10000,false,"d",playerid);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0);
SetPVarInt(playerid,"BankDoor",1);
PlayerLoad(playerid);
}
}
if(IsPlayerInRangeOfPoint(playerid,1.0,1420.2341,-984.6201,-6.0891))
{
if(BankSignal == false) return 1;
switch(random(4))
{
case 0,2: SendClientMessage(playerid,-1,"Вы не смогли отключить сигнализацию, ваши инструменты сломались!"),SetPVarInt(playerid,"Inst",GetPVarInt(playerid,"Inst") - 1);
case 1,3: SendClientMessage(playerid,-1,"Вы отключили сигнализацию"),BankSignal = false;
}
}
if(IsPlayerInRangeOfPoint(playerid,3.0,1407.6735,-967.0729,-18.5696))
{
GetObjectPos(Door[1], obpos[0], obpos[1], obpos[2]);
if(DoorBom[1] == false && obpos[0] != 1408.1000000 && obpos[1] != -962.7999900 && obpos[2] != -19.7000000 && GetPVarInt(playerid,"Bomb") != 0)
{
DoorBom[1] = true;
SetPVarInt(playerid,"Bomb",GetPVarInt(playerid,"Bomb") - 1);
SetTimerEx("DoorOpening",10000,false,"d",playerid);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
SetPVarInt(playerid,"BankDoor",2);
bomb = CreateObject(1252,1407.7000000,-966.4000200,-18.0000000,0.0000000,0.0000000,0.0000000);
PlayerLoad(playerid);
}
}
if(IsPlayerInRangeOfPoint(playerid,3.0,1489.1312,-1719.8320,8.2395)) ShowPlayerDialog(playerid,buyinst,2," ","Купить бомбу | $3487\nКупить инструменты | $879","Дальше","Закрыть");
if(IsPlayerInRangeOfPoint(playerid,3.0,1406.5698,-972.9518,-11.2891)) if(BankClose == true) SetPlayerPos(playerid,1423,-899.20001,30.5);
if(IsPlayerInRangeOfPoint(playerid,3.0,1438.8534,-910.1721,34.7145)) SetPlayerPos(playerid,1438.5314,-909.8707,37.7902);
if(IsPlayerInRangeOfPoint(playerid,1.0,1418.0072,-985.3810,-6.0891))
{
if(GetPVarInt(playerid,"InkasJob") == 0) ShowPlayerDialog(playerid,jobinkas,2," ","Вы хотите устроиться на работу инкасатора?","Дальше","Закрыть");
else if(GetPVarInt(playerid,"InkasJob") == 1) ShowPlayerDialog(playerid,jobinkas,2," ","Вы хотите уволиться с работы инкасатора?","Дальше","Закрыть");
}
if(GetVehiclePickup(playerid))
{
if(GetVehicleModel(GetVehiclePickup(playerid)) != 428) return 1;
if(GetPVarInt(playerid,"Bomb") == 0) return SendClientMessage(playerid,-1,"У вас закончились бомбы!");
if(VehIn[2][GetVehiclePickup(playerid)] == 0) return SendClientMessage(playerid,-1,"В этой машине нет денег!");
if(VehIn[1][GetVehiclePickup(playerid)] == 1) return SendClientMessage(playerid,-1,"На этой машине уже стоит бомба!");
SetPVarInt(playerid,"Bomb",GetPVarInt(playerid,"Bomb") - 1);
GetVehiclePos(GetVehiclePickup(playerid),VehPos[0][GetVehiclePickup(playerid)],VehPos[1][GetVehiclePickup(playerid)],VehPos[2][GetVehiclePickup(playerid)]);
VehIn[0][GetVehiclePickup(playerid)] = CreateObject( 1252,0,0,0,0,0,0,80 );
AttachObjectToVehicle(VehIn[0][GetVehiclePickup(playerid)], GetVehiclePickup(playerid), 0.000000, -2.999999, 0.400000, 0.000000, 0.000000, 0.000000 );
SetTimerEx("IncasGrab", 10000, false, "dd", playerid,GetVehiclePickup(playerid));
VehIn[1][GetVehiclePickup(playerid)] = 1;
PlayerLoad(playerid);
}
}
return 1;
}
public DoorOpening(playerid)
{
if(DoorBom[0] == false || DoorBom[1] == false)
{
switch(random(4))
{
case 0,2:
{
if(GetPVarInt(playerid,"BankDoor") == 1) ClearAnimations(playerid),DoorBom[0] = false;
else if(GetPVarInt(playerid,"BankDoor") == 2) ClearAnimations(playerid),DoorBom[1] = false,DestroyObject(bomb);
}
case 1,3:
{
if(GetPVarInt(playerid,"BankDoor") == 1)
{
SetObjectPos(Door[0],1412.4000000,-991.4000200,-7.1000000),SetObjectRot(Door[0],0.0000000,90.0000000,290.0000000);
if(BankSignal == true) SendClientMessageToAll(-1,"[BANK OF LOS SANTOS] Внимание, кто-то напал на банк из-за этого вход в него закрыт!"),BankClose = true;
ClearAnimations(playerid);
}
else if(GetPVarInt(playerid,"BankDoor") == 2)
{
SetObjectPos(Door[1],1408.1000000,-962.7999900,-19.7000000),SetObjectRot(Door[1],90.0000000,90.0000000,239.9950000);
DestroyObject(bomb);
CreateExplosion(1407.7000000,-966.4000200,-18.0000000, 6, 10.0);
Pickup[0] = CreatePickup(1550, 1, 1410.0342,-956.1920,-18.6817, 0);
Pickup[1] = CreatePickup(1550, 1, 1410.1837,-952.1242,-18.6817, 0);
Pickup[2] = CreatePickup(1550, 1, 1405.0104,-952.2489,-18.6817, 0);
Pickup[3] = CreatePickup(1550, 1, 1405.1627,-956.0936,-18.6817, 0);
Pickup[4] = CreatePickup(1550, 1, 1405.4885,-960.0708,-18.6817, 0);
}
}
}
}
else if(DoorBom[0] == true && DoorBom[1] == true)
{
Money(playerid,random(10000));
ClearAnimations(playerid);
}
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Pickup[0] && IsPlayerInRangeOfPoint(playerid,1.0,1410.0342,-956.1920,-18.6817)) SetPVarInt(playerid,"Pickup",Pickup[0]),PlayerLoad(playerid),SetTimerEx("DoorOpening",10000,false,"d",playerid),ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0),DestroyPickup(Pickup[0]);
else if(pickupid == Pickup[1] && IsPlayerInRangeOfPoint(playerid,1.0,1410.1837,-952.1242,-18.6817)) SetPVarInt(playerid,"Pickup",Pickup[1]),PlayerLoad(playerid),SetTimerEx("DoorOpening",10000,false,"d",playerid),ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0),DestroyPickup(Pickup[1]);
else if(pickupid == Pickup[2] && IsPlayerInRangeOfPoint(playerid,1.0,1405.0104,-952.2489,-18.6817)) SetPVarInt(playerid,"Pickup",Pickup[2]),PlayerLoad(playerid),SetTimerEx("DoorOpening",10000,false,"d",playerid),ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0),DestroyPickup(Pickup[2]);
else if(pickupid == Pickup[3] && IsPlayerInRangeOfPoint(playerid,1.0,1405.1627,-956.0936,-18.6817)) SetPVarInt(playerid,"Pickup",Pickup[3]),PlayerLoad(playerid),SetTimerEx("DoorOpening",10000,false,"d",playerid),ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0),DestroyPickup(Pickup[3]);
else if(pickupid == Pickup[4] && IsPlayerInRangeOfPoint(playerid,1.0,1405.4885,-960.0708,-18.6817)) SetPVarInt(playerid,"Pickup",Pickup[4]),PlayerLoad(playerid),SetTimerEx("DoorOpening",10000,false,"d",playerid),ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0),DestroyPickup(Pickup[4]);
else if(pickupid == VehIn[3][GetVehiclePickup(playerid)] && IsPlayerInRangeOfPoint(playerid,1.0,VehPos[0][GetVehiclePickup(playerid)] + 1,VehPos[1][GetVehiclePickup(playerid)] + 3,VehPos[2][GetVehiclePickup(playerid)]))
{
DestroyPickup(VehIn[3][GetVehiclePickup(playerid)]);
DestroyObject(VehIn[0][GetVehiclePickup(playerid)]);
Money(playerid,VehIn[2][GetVehiclePickup(playerid)]),VehIn[2][GetVehiclePickup(playerid)] = 0;
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new car = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(car >= CarBank[0] && car <= CarBank[1])
{
if(GetPVarInt(playerid,"InkasJob") == 0) { SendClientMessage(playerid,-1,"Вы не работаете инкасатором!"); return RemovePlayerFromVehicle(playerid); }
VehIn[2][car] += GetPVarInt(playerid,"MoneyBank");
SetPVarInt(playerid,"MoneyBank",0);
}
}
if(newstate == PLAYER_STATE_ONFOOT)
{
if(car >= CarBank[0] && car <= CarBank[1])
{
VehIn[2][car] += GetPVarInt(playerid,"MoneyBank");
SetPVarInt(playerid,"MoneyBank",0);
}
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, bankPick[BankPick[playerid]][0], bankPick[BankPick[playerid]][1], bankPick[BankPick[playerid]][2]))
{
if(BankPick[playerid] != MAX_BANK - 1)
{
BankPick[playerid] ++;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, bankPick[BankPick[playerid]][0], bankPick[BankPick[playerid]][1], bankPick[BankPick[playerid]][2], 3.0);
if(!IsPlayerInAnyVehicle(playerid)) SetPVarInt(playerid,"MoneyBank",random(10000));
else VehIn[2][GetPlayerVehicleID(playerid)] += random(10000);
}
else if(BankPick[playerid] == MAX_BANK - 1)
{
BankPick[playerid] = BankPick[playerid] - 1;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1464.4305,-1025.5770,23.8281, 5.0);
}
}
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1464.4305,-1025.5770,23.8281))
{
BankPick[playerid] = 0;
VehIn[2][GetPlayerVehicleID(playerid)] = 0;
SendClientMessage(playerid,-1,"Вы отвезли деньги в банк! Чтобы начать работу заного, вылезте и залезте в авто!");
DisablePlayerCheckpoint(playerid);
}
return 1;
}
public IncasGrab(playerid,vehicleid)
{
DestroyObject(VehIn[0][vehicleid]);
CreateExplosion(VehPos[0][vehicleid],VehPos[1][vehicleid],VehPos[2][vehicleid], 12, 10.0);
VehIn[3][vehicleid] = CreatePickup(1550,23,VehPos[0][vehicleid] + 1,VehPos[1][vehicleid] + 3,VehPos[2][vehicleid]);
VehIn[1][vehicleid] = 0;
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case bankdialog:
{
if(!response) return 1;
if(!strval(inputtext)) return ShowPlayerDialog(playerid,bankdialog,1," ","Введите пин-код от своего счета снизу:","Дальше","Закрыть");
if(Bank[playerid][PinKode] == strval(inputtext))
{
for(new i; i != 6; i++) TextDrawShowForPlayer(playerid,ServerTxt[i]);
PlayerTextDrawShow(playerid,PlayerTxt[0][playerid]);
format(balance,50,"$%09d",Bank[playerid][Balance]);
PlayerTextDrawSetString(playerid,PlayerTxt[0][playerid],balance);
SelectTextDraw(playerid,0xFFFFFFFF);
SetPVarInt(playerid,"BankWindow",true);
}
}
case bankdialog + 1:
{
if(!response) return 1;
if(!strval(inputtext)) return ShowPlayerDialog(playerid,bankdialog + 1,1," ","Введите сумму на которую хотите пополнить свой счет:","Дальше","Закрыть");
if(GetMoney(playerid) < strval(inputtext)) return ShowPlayerDialog(playerid,bankdialog + 1,1," ","Введите сумму на которую хотите пополнить свой счет:","Дальше","Закрыть");
Money(playerid,-strval(inputtext));
format(balance,50,"$%09d ~g~+ $%d",Bank[playerid][Balance],strval(inputtext));
PlayerTextDrawSetString(playerid,PlayerTxt[0][playerid],balance);
Bank[playerid][Balance] += strval(inputtext);
SetTimerEx("NewBalance",2000,false,"d",playerid);
}
case bankdialog + 2:
{
if(!response) return 1;
if(!strval(inputtext)) return ShowPlayerDialog(playerid,bankdialog + 1,1," ","Введите сумму на которую хотите пополнить свой счет:","Дальше","Закрыть");
if(Bank[playerid][Balance] < strval(inputtext)) return ShowPlayerDialog(playerid,bankdialog + 1,1," ","Введите сумму на которую хотите пополнить свой счет:","Дальше","Закрыть");
Money(playerid,strval(inputtext));
format(balance,50,"$%09d ~r~- $%d",Bank[playerid][Balance],strval(inputtext));
PlayerTextDrawSetString(playerid,PlayerTxt[0][playerid],balance);
Bank[playerid][Balance] -= strval(inputtext);
SetTimerEx("NewBalance",2000,false,"d",playerid);
}
case buyinst:
{
if(!response) return 1;
switch(listitem)
{
case 0:
{
if(GetMoney(playerid) < 3487) return SendClientMessage(playerid,-1,"У вас недостаточно денег, для покупки бомбы!");
SetPVarInt(playerid,"Bomb",GetPVarInt(playerid,"Bomb") + 1);
Money(playerid,-3487);
SendClientMessage(playerid,-1,"Вы купили бомбу | + 1");
}
case 1:
{
if(GetMoney(playerid) < 879) return SendClientMessage(playerid,-1,"У вас недостаточно денег, для покупки инструментов!");
SetPVarInt(playerid,"Inst",GetPVarInt(playerid,"Inst") + 1);
Money(playerid,-879);
SendClientMessage(playerid,-1,"Вы купили инструменты | + 1");
}
}
}
case jobinkas:
{
if(!response) return 1;
if(GetPVarInt(playerid,"InkasJob") == 0)
{
SendClientMessage(playerid,-1,"Вы устроились на работу инкасатором, пройдите на стоянку и возьмите авто!");
SetPVarInt(playerid,"InkasJob",1);
SetPVarInt(playerid,"Skin",GetPlayerSkin(playerid));
SetPlayerSkin(playerid,71);
}
else if(GetPVarInt(playerid,"InkasJob") == 1)
{
SendClientMessage(playerid,-1,"Вы уволились с работы инкасатора!");
SetPVarInt(playerid,"InkasJob",0);
SetPlayerSkin(playerid,SetPVarInt(playerid,"Skin",1));
}
}
}
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(GetPVarInt(playerid,"BankWindow") == 1)
{
if(_:clickedid == INVALID_TEXT_DRAW)
{
CancelSelectTextDraw(playerid);
for(new i; i != 6; i++) TextDrawHideForPlayer(playerid,ServerTxt[i]);
PlayerTextDrawHide(playerid,PlayerTxt[0][playerid]);
}
}
if(clickedid == ServerTxt[4]) ShowPlayerDialog(playerid,bankdialog + 1,1," ","Введите сумму на которую хотите пополнить свой счет:","Дальше","Закрыть");
if(clickedid == ServerTxt[5]) ShowPlayerDialog(playerid,bankdialog + 2,1," ","Введите сумму которую хотите снять со счета:","Дальше","Закрыть");
return 1;
}
public NewBalance(playerid) format(balance,50,"$%09d",Bank[playerid][Balance]),PlayerTextDrawSetString(playerid,PlayerTxt[0][playerid],balance);
stock PlayerLoad(playerid) TimeLoad[playerid] = SetTimerEx("Loading",1000,true,"d",playerid),SetPVarInt(playerid,"Load",1),PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 226.000000, 9.000000),PlayerTextDrawShow(playerid,PlayerTxt[1][playerid]);
public Loading(playerid)
{
switch(GetPVarInt(playerid,"Load"))
{
case 1: PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 244.400000, 9.000000),PlayerTextDrawShow(playerid,PlayerTxt[2][playerid]),SetPVarInt(playerid,"Load",GetPVarInt(playerid,"Load") + 1);
case 2: PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 262.600000, 9.000000),PlayerTextDrawShow(playerid,PlayerTxt[2][playerid]),SetPVarInt(playerid,"Load",GetPVarInt(playerid,"Load") + 1);
case 3: PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 281.200000, 9.000000),PlayerTextDrawShow(playerid,PlayerTxt[2][playerid]),SetPVarInt(playerid,"Load",GetPVarInt(playerid,"Load") + 1);
case 4: PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 299.600000, 9.000000),PlayerTextDrawShow(playerid,PlayerTxt[2][playerid]),SetPVarInt(playerid,"Load",GetPVarInt(playerid,"Load") + 1);
case 5: PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 318.000000, 9.000000),PlayerTextDrawShow(playerid,PlayerTxt[2][playerid]),SetPVarInt(playerid,"Load",GetPVarInt(playerid,"Load") + 1);
case 6: PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 336.400000, 9.000000),PlayerTextDrawShow(playerid,PlayerTxt[2][playerid]),SetPVarInt(playerid,"Load",GetPVarInt(playerid,"Load") + 1);
case 7: PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 354.800000, 9.000000),PlayerTextDrawShow(playerid,PlayerTxt[2][playerid]),SetPVarInt(playerid,"Load",GetPVarInt(playerid,"Load") + 1);
case 8: PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 373.200000, 9.000000),PlayerTextDrawShow(playerid,PlayerTxt[2][playerid]),SetPVarInt(playerid,"Load",GetPVarInt(playerid,"Load") + 1);
case 9: PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 391.600000, 9.000000),PlayerTextDrawShow(playerid,PlayerTxt[2][playerid]),SetPVarInt(playerid,"Load",GetPVarInt(playerid,"Load") + 1);
case 10: PlayerTextDrawTextSize(playerid,PlayerTxt[2][playerid], 410.000000, 9.000000),PlayerTextDrawShow(playerid,PlayerTxt[2][playerid]),SetPVarInt(playerid,"Load",GetPVarInt(playerid,"Load") + 1);
case 11: PlayerTextDrawHide(playerid,PlayerTxt[1][playerid]),PlayerTextDrawHide(playerid,PlayerTxt[2][playerid]),DeletePVar(playerid,"Load"),KillTimer(TimeLoad[playerid]);
}
}
stock Name(playerid)
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
return PlayerName;
}
stock GetVehiclePickup(playerid)
{
for(new i=0; i<MAX_VEHICLES; i++)
{
if(GetVehicleModel(i))
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(i,X,Y,Z);
if(IsPlayerInRangeOfPoint(playerid,4.0, X, Y, Z))return i;
}
}
return -1;
}
