Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. #define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6. #include <streamer>
  7. #include <zcmd>
  8.  
  9. #if defined FILTERSCRIPT
  10.  
  11.  
  12. #define LIGHTBLUE 0x33CCFFAA
  13. #define ORANGE 0xFF9900AA
  14. #define LIMEGREEN 0x32CD32AA
  15. #define YELLOWGREEN 0x9ACD32AA
  16.  
  17. new Hint[50];
  18. new Pickup;
  19. new Checkpoint;
  20. new Timer;
  21. new Time;
  22. new Name[MAX_PLAYER_NAME];
  23. new Float:Pos[3];
  24. new bool:Active = false;
  25.  
  26. enum MoneyBagDrop
  27. {
  28. Float:PosX,
  29. Float:PosY,
  30. Float:PosZ,
  31. Location[50]
  32. }
  33.  
  34. new Float:Info[][MoneyBagDrop] =
  35. {
  36. {0.0, 0.00, 0.0, "Blueberry Acres"}
  37.  
  38. };
  39.  
  40.  
  41. public OnFilterScriptInit()
  42. {
  43. print("\n--------------------------------------");
  44. print(" Ze Money Bag Systemarino");
  45. print("--------------------------------------\n");
  46. SetTimer("StartScript", 60000, 0);
  47. return 1;
  48. }
  49.  
  50. public OnFilterScriptExit()
  51. {
  52. return 1;
  53. }
  54.  
  55. #else
  56.  
  57. main()
  58. {
  59. print("\n----------------------------------");
  60. print(" Blank Gamemode by your name here");
  61. print("----------------------------------\n");
  62. }
  63.  
  64. #endif
  65.  
  66.  
  67.  
  68.  
  69. forward MBCreate();
  70. public MBCreate()
  71. {
  72. if(Active == true)
  73. {
  74. SendClientMessageToAll(YELLOWGREEN, "[Ca Ching!] The old money bag hasn't been found, a new one will be placed soon..");
  75. Active = false, Hint = "", DestroyDynamicPickup(Pickup), DestroyDynamicCP(Checkpoint), Time = 0, KillTimer(Timer);
  76. Timer = SetTimer("MBCreate", 180000, 0);
  77. }
  78. else if(Active == false)
  79. {
  80. new String[256];
  81. new mbrandom = random(sizeof(Info));
  82. Pos[0] = Info[mbrandom][PosX], Pos[1] = Info[mbrandom][PosY], Pos[2] = Info[mbrandom][PosZ];
  83. format(Hint, 50, "%s", Info[mbrandom][Location]);
  84. Time = GetTickCount();
  85. Timer = SetTimer("MBCreate", 600000, 0);
  86. format(String, 256, "[Ca Ching!] The Money Bag can be found in %s! Reward: $50,000 & 5 score!", Hint);
  87. SendClientMessageToAll(YELLOWGREEN, String);
  88. Active = true;
  89. Pickup = CreateDynamicPickup(1550, 2, Pos[0], Pos[1], Pos[2], -1, -1, -1, 100.0);
  90. Checkpoint = CreateDynamicCP(Pos[0], Pos[1], Pos[2], 3, -1, -1, -1, 100.0);
  91. }
  92. return 1;
  93. }
  94.  
  95.  
  96. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  97. {
  98. if(checkpointid == Checkpoint)
  99. {
  100. new String[256], Float:result;
  101. result = GetTickCount() - Time;
  102. format(String, 256, "[Ca Ching!] %s(%i) has found the Money Bag in %.2f.. Reward: $50,000 & 5 score!", GetName(playerid), playerid, result / 1000);
  103. SendClientMessageToAll(YELLOWGREEN, String);
  104. GivePlayerMoney(playerid, 50000), GivePlayerScore(playerid, 5);
  105. Active = false, Hint = "", DestroyDynamicPickup(Pickup), DestroyDynamicCP(Checkpoint), Time = 0, KillTimer(Timer);
  106. }
  107. return 1;
  108. }
  109.  
  110.  
  111. CMD:caching(playerid, params[])
  112. {
  113. new str[128], Float:result;
  114. result = GetTickCount() - Time;
  115. if(Active == false) return SendClientMessage(playerid, LIMEGREEN, "Error: The Ca Ching system isn't active.");
  116. format(str, 128, "[Ca Ching!] No one has found the money bag in %.2f seconds.. Hint: %s.", result, Hint);
  117. SendClientMessageToAll(YELLOWGREEN, str);
  118. return 1;
  119. }
  120.  
  121.  
  122.  
  123.  
  124. stock GetName(playerid)
  125. {
  126. GetPlayerName(playerid, Name, sizeof Name);
  127. return Name;
  128. }
  129.  
  130. stock GivePlayerScore(playerid, score)
  131. {
  132. SetPlayerScore(playerid, GetPlayerScore(playerid) + score);
  133. return 1;
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement