Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <streamer>
- enum mbinfo
- {
- Float:XPOS,
- Float:YPOS,
- Float:ZPOS,
- Position[50]
- };
- new Float:MBSPAWN[][mbinfo] =
- {
- // Positions, (X, Y, Z, Location)
- {713.073852, 912.842224, -19.096578, "The Quarry"},
- {2302.0247, 1283.4984, 67.4688, "LV Pyramid"},
- {2323.6279, 1304.7378, 67.4688, "LV Pyramid"},
- {2345.5537, 1287.0211, 67.4688, "LV Pyramid"},
- {2329.0593, 1261.4042, 67.4688, "LV Pyramid"},
- {2551.7988, 1223.7418, 10.8203, "LV Pyramid"},
- {2644.5469, 1206.3735, 26.9233, "LV Pyramid"},
- {2553.7424, 1102.0887, 16.1149, "LV Pyramid"},
- {2568.9570, 1101.8331, 16.1103, "LV Pyramid"},
- {2908.9858, 986.5837, 10.8984, "Linden Side"},
- {2886.3406, 909.0569, 10.7500, "Rockshore East"},
- {2888.1458, 873.2290, 11.3677, "Rockshore East"},
- {2690.8811, 855.1355, 9.9220, "Rockshore East"},
- {2690.5376, 866.3606, 9.9374, "Rockshore East"},
- {2695.1758, 877.2897, 10.5842, "Rockshore East"},
- {2699.2920, 878.2109, 10.5755, "Rockshore East"},
- {2676.1406, 826.9889, 10.9545, "Rockshore East"},
- {2681.0967, 835.7373, 13.7127, "Rockshore East"},
- {1765.5985, 623.9385, 10.8203, "Randolph Industrial Estate"},
- {1762.1816, 590.4581, 10.8198, "Randolph Industrial Estate"},
- {1750.6249, 559.7758, 4.8828, "The Mako Span"},
- {1092.0543, 1077.4070, 10.8359, "Greenglass College"},
- {1016.0862, 1412.4600, 10.8203, "BlackField"},
- {939.6505, 1727.3956, 8.8516, "Whitewood Estates"},
- {925.5185, 2085.7004, 10.8203, "Whitewood Estates"},
- {884.7825, 2732.9546, 20.3383, "Bone Country"},
- {1051.7709, 2918.0928, 51.6622, "Bone Country"},
- {1764.8000, 2814.1255, 8.3359, "Ireland"},
- {2332.3621, 2785.3711, 12.2710, "Prickle Pine"},
- {2338.0291, 2814.1985, 14.8222, "Prickle Pine"},
- {2438.4714, 2828.1865, 10.8203, "Prickle Pine"},
- {2809.6355, 2934.6953, 37.0000, "Prickle Pine"},
- {2809.8416, 2946.9160, 31.5173, "Prickle Pine"},
- {2810.2515, 2927.0991, 40.3436, "Prickle Pine"},
- {2799.3979, 2574.8459, 10.8203, "Creek"},
- {2879.0901, 1594.2798, 10.8203, "Sobell Rail Yards"},
- {2482.5981, 1526.8191, 11.4006, "Pilgrim"},
- {2000.6729, 1565.8490, 15.3672, "Pirates In Mens Pants"},
- {2059.1453, 2010.1351, 10.8203, "The Visage"},
- {1801.1699, 2074.7278, 23.1674, "Harry Gold Parkway"},
- {1550.4684, 2057.5571, 31.1028, "Redsands West"},
- {1409.7883, 2133.5901, 12.0156, "Redsands West"},
- {1368.3809, 2195.6572, 9.7578, "Redsands West"},
- {354.7249, 1305.8237, 13.3625, "BoneCountry"},
- {22.4837, 1531.0942, 12.7500, "BoneCountry"},
- {14.9445, 1724.7888, 22.6349, "BoneCountry"},
- {163.4471, 1933.6057, 25.4985, "BoneCountry"},
- {414.7330, 2533.2129, 19.1484, "BoneCountry"},
- {-280.5523, 2584.6829, 59.4101, "BoneCountry"},
- {-938.1578, 2644.2849, 42.2968, "Tierra Robada"},
- {-1481.3164, 2629.3315, 58.7813, "Tierra Robada"},
- {-1378.1187, 2109.7971, 42.2000, "Tierra Robada"},
- {-1048.3119, 1551.0740, 33.4376, "Tierra Robada"},
- {-730.8501, 1539.1110, 40.4488, "Tierra Robada"},
- {-480.5752, 1053.5299, 1.9942, "Tierra Robada"}
- };
- new Float:MoneyBagPos[3], MoneyBagFound=1, MoneyBagLocation[50], MoneyBagPickup = 600, Timer[2], GoAgainTimer;
- //Hours, Minutes, Seconds, Milliseconds
- #define MoneyBagDelay(%1,%2,%3,%4) (%1*3600000)+(%2*60000)+(%3*1000)+%4
- //20 = 200,000 minimum 30 = 200,000 -> 500,000
- #define MoneyBagCash ((random(35)+09)*10000)
- //10 mins!
- #define MB_DELAY MoneyBagDelay(0, 10, 0, 0)
- public OnFilterScriptInit()
- {
- Timer[1] = SetTimer("MoneyBag", MB_DELAY, true);
- return 1;
- }
- forward MoneyBag();
- public MoneyBag()
- {
- new string[250];
- if(!MoneyBagFound)
- {
- format(string, sizeof(string), "{FFFF66}**The lost briefcase has not been found, it is still located in {FF0000}%s", MoneyBagLocation);
- SendClientMessageToAll(-1, string);
- }
- else if(MoneyBagFound)
- {
- MoneyBagFound = 0;
- new randombag = random(sizeof(MBSPAWN));
- MoneyBagPos[0] = MBSPAWN[randombag][XPOS];
- MoneyBagPos[1] = MBSPAWN[randombag][YPOS];
- MoneyBagPos[2] = MBSPAWN[randombag][ZPOS];
- format(MoneyBagLocation, sizeof(MoneyBagLocation), "%s", MBSPAWN[randombag][Position]);
- format(string, sizeof(string), "{FFFF66}**A Robber has lost his robbed briefcase in {FF0000}%s!{FFFF66} Type /lbc to join the briefcase hunt.",MoneyBagLocation);
- SendClientMessageToAll(-1, string);
- MoneyBagPickup = CreateDynamicPickup(1210, 19, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2], -1, -1, -1, 1000.0);
- new distancestring[127];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- new Float:distance = GetPlayerDistanceFromPoint(i, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2]);
- format(distancestring, sizeof(string), "{00B2EE}The lost briefcase is %i meters away and located in %s!!", floatround(distance, floatround_ceil),MoneyBagLocation);
- SendClientMessage(i, -1, distancestring);
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return 0;
- }
- CMD:briefcase( playerid, params[ ] )
- {
- if(!MoneyBagFound)
- {
- new string[150];
- format(string, sizeof(string), "{FFFF66}**The briefcase has been Lost in {FF0000}%s!!",MoneyBagLocation);
- return SendClientMessage(playerid, -1, string);
- }
- else if(MoneyBagFound)
- {
- new string[150];
- format(string, sizeof(string), "{FFFF66}**The briefcase event is currently {FF0000}not running!");
- return SendClientMessage(playerid, -1, string);
- }
- return 1;
- }
- CMD:lbc(playerid, params[])
- {
- if(!MoneyBagFound)
- {
- new string[64];
- new Float:distance = GetPlayerDistanceFromPoint(playerid, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2]);
- format(string, sizeof(string), "{00B2EE}**The lost briefcase is %i meters away in %s!!", floatround(distance, floatround_ceil),MoneyBagLocation);
- SendClientMessage(playerid, -1, string);
- return 1;
- }
- else if(MoneyBagFound)
- {
- new string[150];
- format(string, sizeof(string), "{FFFF66}**The briefcase event is currently {FF0000}not running!");
- return SendClientMessage(playerid, -1, string);
- }
- return 1;
- }
- CMD:gotobriefcase( playerid, params[ ] )
- {
- if(IsPlayerAdmin(playerid))
- {
- SetPlayerPos(playerid, MoneyBagPos[0], MoneyBagPos[1] +3, MoneyBagPos[2]);
- return SendClientMessage(playerid, -1, "You have been {FF0000}teleported {FFFFFF}to the {33FF66}briefcase");
- }
- else
- {
- return 0;
- }
- }
- CMD:startbriefcase( playerid, params[ ] )
- {
- if(IsPlayerAdmin(playerid))
- {
- KillTimer(GoAgainTimer);
- return MoneyBag();
- }
- else
- {
- return 0;
- }
- }
- public OnPlayerPickUpDynamicPickup(playerid, pickupid)
- {
- if(pickupid == MoneyBagPickup)
- {
- new string[180], pname[24], money = MoneyBagCash;
- GetPlayerName(playerid, pname, 24);
- format(string, sizeof(string), "**{99FFFF}%s{FFFF66} has found the lost briefcase that had {33FF00}$%d {FFFF66} in %s", pname, money, MoneyBagLocation);
- MoneyBagFound = 1;
- SendClientMessageToAll(-1, string);
- SendClientMessageToAll(-1, "{FFFF66}A new briefcase event will start in 30 minutes!");
- DestroyDynamicPickup(MoneyBagPickup);
- SendClientMessage(playerid, -1, "{33FF66}You have found the lost briefcase!");
- GivePlayerMoney(playerid, money);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- GoAgainTimer = SetTimer("GoAgain", 1800000, false);
- }
- return 1;
- }
- forward GoAgain();
- public GoAgain()
- {
- return MoneyBag();
- }
Add Comment
Please, Sign In to add comment