Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < a_samp >
- #include < zcmd >
- new hBankRobbery[MAX_PLAYERS];
- new robbingbank[MAX_PLAYERS];
- new Text:RobbingTD0[MAX_PLAYERS]; // textdraws for robbing
- new Text:RobbingTD1[MAX_PLAYERS]; // textdraws for robbing
- new Text:RobbingTD2[MAX_PLAYERS]; // textdraws for robbing
- forward BankRobbing(p, v);
- forward RobbingTextdraw(playerid, create);
- enum tdInfo
- {
- tdRobbingTD0,
- tdRobbingTD1,
- tdRobbingTD2,
- };
- public OnPlayerConnect(playerid)
- {
- hBankRobbery[playerid] = -1;
- return 1;
- }
- public RobbingTD(playerid, create)
- {
- if(create == 1)
- {
- if(TDInfo[playerid][tdRobbingTD0] == 0)
- {
- RobbingTD0[playerid] = TextDrawCreate(259.000000, 199.000000, "~w~");
- TextDrawBackgroundColor(RobbingTD0[playerid], 255);
- TextDrawFont(RobbingTD0[playerid], 1);
- TextDrawLetterSize(RobbingTD0[playerid], 1.300000, 4.000000);
- TextDrawColor(RobbingTD0[playerid], -1);
- TextDrawSetOutline(RobbingTD0[playerid], 0);
- TextDrawSetProportional(RobbingTD0[playerid], 0);
- TextDrawSetShadow(RobbingTD0[playerid], 1);
- TDInfo[playerid][tdRobbingTD0] = 1;
- }
- if(TDInfo[playerid][tdRobbingTD1] == 0)
- {
- RobbingTD1[playerid] = TextDrawCreate(420.000000, 242.000000, "_");
- TextDrawBackgroundColor(RobbingTD1[playerid], 255);
- TextDrawFont(RobbingTD1[playerid], 1);
- TextDrawLetterSize(RobbingTD1[playerid], 0.500000, -7.000000);
- TextDrawColor(RobbingTD1[playerid], -1);
- TextDrawSetOutline(RobbingTD1[playerid], 0);
- TextDrawSetProportional(RobbingTD1[playerid], 1);
- TextDrawSetShadow(RobbingTD1[playerid], 1);
- TextDrawUseBox(RobbingTD1[playerid], 1);
- TextDrawBoxColor(RobbingTD1[playerid], 150);
- TextDrawTextSize(RobbingTD1[playerid], 219.000000, 90.000000);
- TDInfo[playerid][tdRobbingTD1] = 1;
- }
- if(TDInfo[playerid][tdRobbingTD2] == 0)
- {
- RobbingTD2[playerid] = TextDrawCreate(318.000000, 188.000000, "~y~Robbing...");
- TextDrawAlignment(RobbingTD2[playerid], 2);
- TextDrawBackgroundColor(RobbingTD2[playerid], 255);
- TextDrawFont(RobbingTD2[playerid], 1);
- TextDrawLetterSize(RobbingTD2[playerid], 0.349999, 1.000000);
- TextDrawColor(RobbingTD2[playerid], 16711935);
- TextDrawSetOutline(RobbingTD2[playerid], 0);
- TextDrawSetProportional(RobbingTD2[playerid], 1);
- TextDrawSetShadow(RobbingTD2[playerid], 1);
- TDInfo[playerid][tdRobbingTD2] = 1;
- }
- }
- else
- {
- if(TDInfo[playerid][tdRobbingTD0] == 1)
- {
- TextDrawHideForPlayer(playerid, RobbingTD0[playerid]);
- TextDrawDestroy(RobbingTD0[playerid]);
- TDInfo[playerid][tdRobbingTD0] = 0;
- }
- if(TDInfo[playerid][tdRobbingTD1] == 1)
- {
- TextDrawHideForPlayer(playerid, RobbingTD1[playerid]);
- TextDrawDestroy(RobbingTD1[playerid]);
- TDInfo[playerid][tdRobbingTD1] = 0;
- }
- if(TDInfo[playerid][tdRobbingTD2] == 1)
- {
- TextDrawHideForPlayer(playerid, RobbingTD2[playerid]);
- TextDrawDestroy(RobbingTD2[playerid]);
- TDInfo[playerid][tdRobbingTD2] = 0;
- }
- }
- return 1;
- }
- public BankRobbing(p, v)
- {
- if(!IsPlayerConnected(p)) return KillTimer(robbingbank[p]);
- if(hBankRobbery[p] == -1) return KillTimer(robbingbank[p]);
- hBankRobbery[p]++;
- if(hBankRobbery[p] == 1) TextDrawSetString(RobbingTD0[p], "~w~I");
- else if(hBankRobbery[p] == 2) TextDrawSetString(RobbingTD0[p], "~w~II");
- else if(hBankRobbery[p] == 3) TextDrawSetString(RobbingTD1[p], "~w~III");
- else if(hBankRobbery[p] == 4) TextDrawSetString(RobbingTD2[p], "~w~IIII");
- else if(hBankRobbery[p] == 5) TextDrawSetString(RobbingTD3[p], "~w~IIIII");
- else if(hBankRobbery[p] == 6)
- {
- new x = random(5);
- switch(x)
- {
- case 0..1:
- {
- TextDrawSetString(ObijanjeTD0[p], "~r~IIIII");
- TextDrawSetString(ObijanjeTD2[p], "~r~Bank is not robbed!");
- TogglePlayerControllable(p, 1);
- StopLoopingAnim(p);
- SencClientMessage(p, -1, "Bank is not robbed!");
- }
- case 2..4:
- {
- TextDrawSetString(RobbingTD0[p], "~r~IIIII");
- TextDrawSetString(RobbingTD2[p], "~g~Bank is succesfuly robbed!");
- TogglePlayerControllable(p, 1);
- StopLoopingAnim(p);
- SendClientMessage(p, -1, "Bank is robbed!");
- new cash = 30000;
- new bribe = random(5000);
- SendClientMessage(p, -1, "You stoled $%d from the bank!", cash+bribe);
- GivePlayerMoney(p, cash+bribe);
- }
- }
- }
- else if(hBankRobbery[p] == 7)
- {
- KillTimer(robbingbank[p]);
- hBankRobbery[p] = -1;
- }
- return 1;
- }
- CMD:robbank(playerid, params[])
- {
- if(gettime() < hBankRobbery[playerid]) return SendClientMessage(playerid, -1, "You already robbed bank!");
- if(!IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z)) return SCM(playerid, -1, "You are not in the bank!"); // Put x,y,z where is your bank
- LoopingAnim(playerid,"BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
- hBankRobbery[playerid] = 0;
- robbingbank[playerid] = SetTimerEx("robbingbank", 20000, true, "ii", playerid);
- ObijanjeTD(playerid, 1);
- SendClientMessageToAll(-1,"[NEWS] Bank is being robbed, do not come near the bank!");
- TextDrawShowForPlayer(playerid, ObijanjeTD0[playerid]);
- TextDrawShowForPlayer(playerid, ObijanjeTD1[playerid]);
- TextDrawShowForPlayer(playerid, ObijanjeTD2[playerid]);
- hBankRobbery[playerid] = gettime() + 15000;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement