Guest User

Escobar's Bank Robbing System 1.0

a guest
Oct 27th, 2017
733
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.26 KB | None | 0 0
  1. /****Made by Escobar a.k.a Escobabe****/
  2. /*************Version 1.0*************/
  3. /****Advanced Bank Robbing System****/
  4.  
  5. /*CREDITS*/
  6. /*Yless*/
  7. /*Zeex*/
  8.  
  9. #define FILTERSCRIPT
  10.  
  11. #include <a_samp>
  12. #include <sscanf2>
  13. #include <zcmd>
  14.  
  15. #if defined FILTERSCRIPT
  16. #define COLOR_RED 0xFF0000FF
  17. #define COLOR_GREEN 0x33AA33FF
  18. #define BUY 69
  19.  
  20. new HackedSys[MAX_PLAYERS];
  21. new Bribe[MAX_PLAYERS];
  22. new Alarm;
  23. new Bag[MAX_PLAYERS];
  24.  
  25. stock PlayerName(playerid)
  26. {
  27.   new name[MAX_PLAYER_NAME];
  28.   GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  29.   return name;
  30. }
  31.  
  32. forward Hacked(playerid);
  33. public Hacked(playerid)
  34. {
  35.     TogglePlayerControllable(playerid,1);
  36.     GameTextForPlayer(playerid,"Hacking completed.",2000,6);
  37.     return 1;
  38. }
  39.  
  40. forward RobbingTime(playerid);
  41. public RobbingTime(playerid)
  42. {
  43.     if(GetPlayerInterior(playerid) == 0) return 0;
  44.     SendClientMessage(playerid,COLOR_RED,"You weren't so fast, the alarm has been turned on.");
  45.     SetPlayerWantedLevel(playerid,6);
  46.     ApplyActorAnimation(1, "ped", "cower", 3.0, 1, 0, 0, 0, 0);
  47.     ApplyActorAnimation(2, "ped", "cower", 3.0, 1, 0, 0, 0, 0);
  48.     ApplyActorAnimation(3, "ped", "cower", 3.0, 1, 0, 0, 0, 0);
  49.     ApplyActorAnimation(4, "ped", "cower", 3.0, 1, 0, 0, 0, 0);
  50.     return 1;
  51. }
  52.  
  53. forward RobbingSafe(playerid);
  54. public RobbingSafe(playerid)
  55. {
  56.     new rand=400000 +(random(350000)), str[100];
  57.     TogglePlayerControllable(playerid,1);
  58.     GameTextForPlayer(playerid,"Robbing sucessfull",2000,6);
  59.     SendClientMessage(playerid,COLOR_GREEN,"Quickly get outside so the alarm won't get turned on.");
  60.     format(str,sizeof(str),"%s has robbed %d$ from the bank.",PlayerName(playerid),rand);
  61.     SendClientMessageToAll(COLOR_GREEN,str);
  62.     GivePlayerMoney(playerid, rand);
  63.     HackedSys[playerid] = 0;
  64.     Bribe[playerid] = 0;
  65.     Bag[playerid] = 0;
  66.     Alarm = 1;
  67.     SetTimer("Reset",120000,0);
  68.     return 1;
  69. }
  70.  
  71. forward Reset();
  72. public Reset()
  73. {
  74.     ClearActorAnimations(1);
  75.     ClearActorAnimations(2);
  76.     ClearActorAnimations(3);
  77.     ClearActorAnimations(4);
  78.     Alarm = 0;
  79.     return 1;
  80. }
  81.  
  82. public OnFilterScriptInit()
  83. {
  84.     print("\n--------------------------------------");
  85.     print("Advanced Bank Robbing System by Escobar");
  86.     print("--------------------------------------\n");
  87.    
  88.     CreatePickup(1239,1,363.4240,210.2281,1008.3828); // Info point for /hacksystem
  89.     CreatePickup(1239,1,345.3308,162.1849,1025.7964); // Info point for /robsafe
  90.     CreatePickup(1239,1,-426.0232,2240.6008,42.4297); // Info point for /hidemoney
  91.     CreatePickup(1239,1,370.1941,167.2163,1008.3828); // Info point for /bribe
  92.    
  93.     Create3DTextLabel("/hacksytem", 0xF70AF7, 363.4240,210.2281,1008.3828, 40.0, 0, 0); // Hacksystem
  94.     Create3DTextLabel("/robsafe", 0xF70AF7, 345.3308,162.1849,1025.7964, 40.0, 0, 0); // Robsafe
  95.     Create3DTextLabel("/hidemoney", 0xF70AF7, -426.0232,2240.6008,42.4297, 40.0, 0, 0); // Hidemoney
  96.     Create3DTextLabel("/bribe", 0xF70AF7, 370.1941,167.2163,1008.3828, 40.0, 0, 0); // Bribe
  97.    
  98.     CreateActor(76,359.7125,173.5383,1008.3828,269.2284);
  99.     CreateActor(71,370.1941,167.2163,1008.3828,359.5908);
  100.     CreateActor(141,373.4727,182.8896,1008.8679,1.7843);
  101.     CreateActor(147,372.0834,183.9877,1008.8679,276.3627);
  102.     CreateObject(2919,2153.9731,1599.2941,1006.1754,0.0,0.0,0.0,0.0);
  103.     return 1;
  104. }
  105.  
  106. public OnFilterScriptExit()
  107. {
  108.     return 1;
  109. }
  110.  
  111. #else
  112.  
  113. main()
  114. {
  115.     print("\n----------------------------------");
  116.     print(" Blank Gamemode by your name here");
  117.     print("----------------------------------\n");
  118. }
  119.  
  120. #endif
  121.  
  122. public OnPlayerRequestClass(playerid, classid)
  123. {
  124.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  125.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  126.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  127.     return 1;
  128. }
  129.  
  130. public OnPlayerConnect(playerid)
  131. {
  132.     HackedSys[playerid] = 0;
  133.     Bribe[playerid] = 0;
  134.     Bag[playerid] = 0;
  135.     return 1;
  136. }
  137.  
  138. public OnPlayerDisconnect(playerid, reason)
  139. {
  140.     return 1;
  141. }
  142.  
  143. public OnPlayerSpawn(playerid)
  144. {
  145.     return 1;
  146. }
  147.  
  148. public OnPlayerDeath(playerid, killerid, reason)
  149. {
  150.     HackedSys[playerid] = 0;
  151.     Bribe[playerid] = 0;
  152.     Bag[playerid] = 0;
  153.     for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
  154.     {
  155.         if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
  156.     }
  157.     return 1;
  158. }
  159.  
  160. public OnVehicleSpawn(vehicleid)
  161. {
  162.     return 1;
  163. }
  164.  
  165. public OnVehicleDeath(vehicleid, killerid)
  166. {
  167.     return 1;
  168. }
  169.  
  170. public OnPlayerText(playerid, text[])
  171. {
  172.     return 1;
  173. }
  174.  
  175. public OnPlayerCommandText(playerid, cmdtext[])
  176. {
  177.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  178.     {
  179.         // Do something here
  180.         return 1;
  181.     }
  182.     return 0;
  183. }
  184.  
  185. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  186. {
  187.     return 1;
  188. }
  189.  
  190. public OnPlayerExitVehicle(playerid, vehicleid)
  191. {
  192.     return 1;
  193. }
  194.  
  195. public OnPlayerStateChange(playerid, newstate, oldstate)
  196. {
  197.     return 1;
  198. }
  199.  
  200. public OnPlayerEnterCheckpoint(playerid)
  201. {
  202.     return 1;
  203. }
  204.  
  205. public OnPlayerLeaveCheckpoint(playerid)
  206. {
  207.     return 1;
  208. }
  209.  
  210. public OnPlayerEnterRaceCheckpoint(playerid)
  211. {
  212.     return 1;
  213. }
  214.  
  215. public OnPlayerLeaveRaceCheckpoint(playerid)
  216. {
  217.     return 1;
  218. }
  219.  
  220. public OnRconCommand(cmd[])
  221. {
  222.     return 1;
  223. }
  224.  
  225. public OnPlayerRequestSpawn(playerid)
  226. {
  227.     return 1;
  228. }
  229.  
  230. public OnObjectMoved(objectid)
  231. {
  232.     return 1;
  233. }
  234.  
  235. public OnPlayerObjectMoved(playerid, objectid)
  236. {
  237.     return 1;
  238. }
  239.  
  240. public OnPlayerPickUpPickup(playerid, pickupid)
  241. {
  242.     return 1;
  243. }
  244.  
  245. public OnVehicleMod(playerid, vehicleid, componentid)
  246. {
  247.     return 1;
  248. }
  249.  
  250. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  251. {
  252.     return 1;
  253. }
  254.  
  255. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  256. {
  257.     return 1;
  258. }
  259.  
  260. public OnPlayerSelectedMenuRow(playerid, row)
  261. {
  262.     return 1;
  263. }
  264.  
  265. public OnPlayerExitedMenu(playerid)
  266. {
  267.     return 1;
  268. }
  269.  
  270. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  271. {
  272.     return 1;
  273. }
  274.  
  275. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  276. {
  277.     return 1;
  278. }
  279.  
  280. public OnRconLoginAttempt(ip[], password[], success)
  281. {
  282.     return 1;
  283. }
  284.  
  285. public OnPlayerUpdate(playerid)
  286. {
  287.     return 1;
  288. }
  289.  
  290. public OnPlayerStreamIn(playerid, forplayerid)
  291. {
  292.     return 1;
  293. }
  294.  
  295. public OnPlayerStreamOut(playerid, forplayerid)
  296. {
  297.     return 1;
  298. }
  299.  
  300. public OnVehicleStreamIn(vehicleid, forplayerid)
  301. {
  302.     return 1;
  303. }
  304.  
  305. public OnVehicleStreamOut(vehicleid, forplayerid)
  306. {
  307.     return 1;
  308. }
  309.  
  310. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  311. {
  312.     if(dialogid == BUY)
  313.     {
  314.         if(response)
  315.         {
  316.             if(Bag[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"You already have purchased one bag.");
  317.             if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid,COLOR_RED,"You don't have enough money.");
  318.             Bag[playerid] = 1;
  319.             SendClientMessage(playerid,COLOR_GREEN,"You've succesfully purchased the bag.");
  320.             GivePlayerMoney(playerid,-500);
  321.         }
  322.         return 1;
  323.     }
  324.     return 0;
  325. }
  326.  
  327. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  328. {
  329.     return 1;
  330. }
  331.  
  332. //////////////////////////COMMANDS/////////////////////////////////////////////
  333.  
  334. CMD:hacksystem(playerid,params[])
  335. {
  336.     if(!IsPlayerInRangeOfPoint(playerid,3.0,363.4240,210.2281,1008.3828)) return SendClientMessage(playerid,COLOR_RED,"You need to be near the computers to hack the system.");
  337.     if(Bribe[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"You must bribe the Security Guard first.");
  338.     if(Alarm == 1) return SendClientMessage(playerid,COLOR_RED,"The bank has just been robbed, please wait 2 minutes.");
  339.     GameTextForPlayer(playerid,"Hacking the system...",10000,6);
  340.     TogglePlayerControllable(playerid,0);
  341.     HackedSys[playerid] = 1;
  342.     SetTimerEx("Hacked",10000,0,"i",playerid);
  343.     return 1;
  344. }
  345.  
  346. CMD:bribe(playerid,params[])
  347. {
  348.     if(!IsPlayerInRangeOfPoint(playerid,3.0,370.1941,167.2163,1008.3828)) return SendClientMessage(playerid,COLOR_RED,"You need to be near the Security Guard to bribe him.");
  349.     if(Alarm == 1) return SendClientMessage(playerid,COLOR_RED,"The bank has just been robbed, please wait 2 minutes.");
  350.     if(Bribe[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"You've already bribed the Security Guard, go hack the system now.");
  351.     if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid,COLOR_GREEN,"Security Guard says: What? I'll not risk my job for this money.");
  352.     GivePlayerMoney(playerid,-50000);
  353.     SendClientMessage(playerid,COLOR_GREEN,"Security Guard says: Alright, i'll turn my head to the other side, you got 1 minute.");
  354.     SetTimerEx("RobbingTime",60000,0,"i",playerid);
  355.     Bribe[playerid] = 1;
  356.     return 1;
  357. }
  358.  
  359. CMD:buy(playerid,params[])
  360. {
  361.     if(GetPlayerInterior(playerid) != 6) return SendClientMessage(playerid,COLOR_RED,"You need to be inside the store to buy the bag.");
  362.     ShowPlayerDialog(playerid, BUY, DIALOG_STYLE_TABLIST_HEADERS, "Store Products",
  363.     "Peoduct\tUnit\tPrice\n\
  364.     Bag\t1\t500",
  365.     "Select", "Close");
  366.     return 1;
  367. }
  368.  
  369. CMD:robsafe(playerid,params[])
  370. {
  371.     new Float:x, Float:y, Float:z;
  372.     if(Alarm == 1) return SendClientMessage(playerid,COLOR_RED,"The bank has just been robbed, please wait 2 minutes.");
  373.     if(!IsPlayerInRangeOfPoint(playerid,3.0,345.3308,162.1849,1025.7964)) return SendClientMessage(playerid,COLOR_RED,"You're not at the banks safe.");
  374.     if(Bag[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"You don't have a bag.");
  375.     if(HackedSys[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"You didn't hack the system as of first.");
  376.     if(Bribe[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"You didn't bribe the Security Guard.");
  377.     SetTimerEx("RobbingSafe",10000,0,"i",playerid);
  378.     TogglePlayerControllable(playerid,0);
  379.     GetPlayerPos(playerid,x,y,z);
  380.     GameTextForPlayer(playerid,"Robbing the safe...",10000,6);
  381.     SetPlayerAttachedObject(playerid, 3, 1550, 6, 0.101, -0.0, 0.0, 5.50, 8.60, 3.7, 1, 1, 1, 0xFF00FF00);
  382.     return 1;
  383. }
  384.  
  385. CMD:hidemoney(playerid,params[])
  386. {
  387.     if(!IsPlayerInRangeOfPoint(playerid,3.0,-426.0232,2240.6008,42.4297)) return SendClientMessage(playerid,COLOR_RED,"You're not at the hideout.");
  388.     SetPlayerWantedLevel(playerid,0);
  389.     SendClientMessage(playerid,COLOR_GREEN,"You've succesfully evaded the cops, money is now safe.");
  390.     for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
  391.     {
  392.         if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
  393.     }
  394.     return 1;
  395. }
  396.  
  397. /************NEW UPDATE COMING SOON**********************/
Add Comment
Please, Sign In to add comment