Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- forward InitMoneyBag();
- #define COLOR_BLUEAQUA 0x7E60FFFF
- enum BriefcaseInfo
- {
- Float:locX,
- Float:locY,
- Float:locZ,
- loc[20]
- }
- new Float:BriefcasePoints[2][BriefcaseInfo] =
- {
- {-1130.1259,-1095.8928,129.2188, "The Farm"},//The Farm MB3
- {-1731.3486,1372.5109,7.0469, "Esplanade North"}//Esplanade North MB5
- };
- new mypickup;
- main()
- {
- }
- public OnGameModeInit()
- {
- SetTimer("InitMoneyBag", 30000, false);
- return 1;
- }
- public InitMoneyBag()
- {
- new rand = random(sizeof(BriefcasePoints));
- mypickup = CreatePickup(1550, 23, BriefcasePoints[rand][locX], BriefcasePoints[rand][locY], BriefcasePoints[rand][locZ]);
- new msg[128];
- format(msg, sizeof(msg), "A new money bag has spawned near %s!", Float:locX);
- SendClientMessageToAll(0x7E60FFFF, msg);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerPos(playerid, -1731.3486,1372.5109,7.0469);
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == mypickup)
- {
- DestroyPickup(mypickup);
- new rand = random(sizeof(BriefcasePoints));
- mypickup = CreatePickup(1550, 2, BriefcasePoints[rand][locX], BriefcasePoints[rand][locY], BriefcasePoints[rand][locZ]);
- GivePlayerMoney(playerid, 50000);
- new name[MAX_PLAYER_NAME], string[44];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s (%d) has found the money bag!",name, playerid);
- SendClientMessageToAll(0x7E60FFFF, string);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement