Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- #define FILTERSCRIPT
- #include <a_samp>
- #include <streamer>
- #include <zcmd>
- #if defined FILTERSCRIPT
- #define LIGHTBLUE 0x33CCFFAA
- #define ORANGE 0xFF9900AA
- #define LIMEGREEN 0x32CD32AA
- #define YELLOWGREEN 0x9ACD32AA
- new Hint[50];
- new Pickup;
- new Checkpoint;
- new Timer;
- new Time;
- new Name[MAX_PLAYER_NAME];
- new Float:Pos[3];
- new bool:Active = false;
- enum MoneyBagDrop
- {
- Float:PosX,
- Float:PosY,
- Float:PosZ,
- Location[50]
- }
- new Float:Info[][MoneyBagDrop] =
- {
- {0.0, 0.00, 0.0, "Blueberry Acres"}
- };
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Ze Money Bag Systemarino");
- print("--------------------------------------\n");
- SetTimer("StartScript", 60000, 0);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- #endif
- forward MBCreate();
- public MBCreate()
- {
- if(Active == true)
- {
- SendClientMessageToAll(YELLOWGREEN, "[Ca Ching!] The old money bag hasn't been found, a new one will be placed soon..");
- Active = false, Hint = "", DestroyDynamicPickup(Pickup), DestroyDynamicCP(Checkpoint), Time = 0, KillTimer(Timer);
- Timer = SetTimer("MBCreate", 180000, 0);
- }
- else if(Active == false)
- {
- new String[256];
- new mbrandom = random(sizeof(Info));
- Pos[0] = Info[mbrandom][PosX], Pos[1] = Info[mbrandom][PosY], Pos[2] = Info[mbrandom][PosZ];
- format(Hint, 50, "%s", Info[mbrandom][Location]);
- Time = GetTickCount();
- Timer = SetTimer("MBCreate", 600000, 0);
- format(String, 256, "[Ca Ching!] The Money Bag can be found in %s! Reward: $50,000 & 5 score!", Hint);
- SendClientMessageToAll(YELLOWGREEN, String);
- Active = true;
- Pickup = CreateDynamicPickup(1550, 2, Pos[0], Pos[1], Pos[2], -1, -1, -1, 100.0);
- Checkpoint = CreateDynamicCP(Pos[0], Pos[1], Pos[2], 3, -1, -1, -1, 100.0);
- }
- return 1;
- }
- public OnPlayerEnterDynamicCP(playerid, checkpointid)
- {
- if(checkpointid == Checkpoint)
- {
- new String[256], Float:result;
- result = GetTickCount() - Time;
- format(String, 256, "[Ca Ching!] %s(%i) has found the Money Bag in %.2f.. Reward: $50,000 & 5 score!", GetName(playerid), playerid, result / 1000);
- SendClientMessageToAll(YELLOWGREEN, String);
- GivePlayerMoney(playerid, 50000), GivePlayerScore(playerid, 5);
- Active = false, Hint = "", DestroyDynamicPickup(Pickup), DestroyDynamicCP(Checkpoint), Time = 0, KillTimer(Timer);
- }
- return 1;
- }
- CMD:caching(playerid, params[])
- {
- new str[128], Float:result;
- result = GetTickCount() - Time;
- if(Active == false) return SendClientMessage(playerid, LIMEGREEN, "Error: The Ca Ching system isn't active.");
- format(str, 128, "[Ca Ching!] No one has found the money bag in %.2f seconds.. Hint: %s.", result, Hint);
- SendClientMessageToAll(YELLOWGREEN, str);
- return 1;
- }
- stock GetName(playerid)
- {
- GetPlayerName(playerid, Name, sizeof Name);
- return Name;
- }
- stock GivePlayerScore(playerid, score)
- {
- SetPlayerScore(playerid, GetPlayerScore(playerid) + score);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement