Guest User

Untitled

a guest
Jan 7th, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.47 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. // includes
  6. #include <a_samp>
  7. #include <streamer>
  8. #include <sscanf2>
  9. #include <zcmd>
  10. #include <foreach>
  11. // normale defines zoals kleuren etc, dingen voor IEDEREEN
  12. // red, blue, green FF0000 0000FF 00FF00 ( gewoon om iets te onthouden xD)
  13. #define COLOR_RED 0xFF0000FF
  14. #define COLOR_GREEN 0x00FF00FF
  15. #define COLOR_YELLOW 0xFFFF00AA
  16. #define COLOR_PURPLE 0xFF00FFAA
  17. #define ORANGE 0xFF8000AA
  18. #define COLOR_BLUE 0x0000FFFF
  19. #define COLOR_ORANGE 0xFF9000FF
  20. #define COLOR_GREY 0xAFAFAFAA
  21. #define COLOR_WHITE 0xFFFFFFAA
  22. #define COLOR_DARKBLUE 0x00007AFF
  23. #define COLOR_PINK 0xFF007AFF
  24. #define COLOR_BLACK 0x000000FF
  25. #define COLOR_LIGHTGREEN 0x82FF82FF
  26. #define lightblue 0x33CCFFAA
  27. #define red 0xFF0000AA
  28. #define DIALOG_CMDS 30538
  29.  
  30. // de defines voor de teams, zoals je kunt zien zijn dat terrorists en army, komen later nog stunt etc bij
  31. #define C1 0
  32. #define T1 1
  33. // de team kleuren die ze krijgen bij spawn, army is blauw en terrorists is rood
  34.  
  35. // de callback die we gaan gebruiken om de teams te onderscheiden
  36. new AllTeams[MAX_PLAYERS];
  37. new BombExplodeTimer;
  38. new TeamTerrorists;
  39. new Bomb, PlantbombCP;
  40. new BombPlanted = 0;
  41. new DefuseTimer, Defusing;
  42. // sets the timer that says how many seconds till bomb explodes
  43. new ExplodeBomb[MAX_PLAYERS];
  44. // random spawns voor elke class
  45. // army base randomspawns
  46.  
  47.  
  48.  
  49. public OnFilterScriptInit()
  50. {
  51. print("\n--------------------------------------");
  52. print(" Blank Filterscript by your name here");
  53. print("--------------------------------------\n");
  54. return 1;
  55. }
  56.  
  57. public OnFilterScriptExit()
  58. {
  59.  
  60. PlantbombCP = CreateDynamicCP(259.2780,1855.8953,8.7578, 6.0, -1, -1, -1, 100.0);
  61.  
  62. return 1;
  63. }
  64.  
  65.  
  66. main()
  67. {
  68. print("\n----------------------------------");
  69. print(" Blank Gamemode by your name here");
  70. print("----------------------------------\n");
  71. }
  72.  
  73.  
  74. public OnGameModeInit()
  75. {
  76. // Don't use these lines if it's a filterscript
  77. SetGameModeText("Blank Script");
  78. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  79. return 1;
  80. }
  81.  
  82. public OnGameModeExit()
  83. {
  84. return 1;
  85. }
  86.  
  87. public OnPlayerRequestClass(playerid, classid)
  88. {
  89. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  90. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  91. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  92. return 1;
  93. }
  94.  
  95. public OnPlayerConnect(playerid)
  96. {
  97. return 1;
  98. }
  99.  
  100. public OnPlayerDisconnect(playerid, reason)
  101. {
  102. return 1;
  103. }
  104.  
  105. public OnPlayerSpawn(playerid)
  106. {
  107. return 1;
  108. }
  109.  
  110. public OnPlayerDeath(playerid, killerid, reason)
  111. {
  112. return 1;
  113. }
  114.  
  115. public OnVehicleSpawn(vehicleid)
  116. {
  117. return 1;
  118. }
  119.  
  120. public OnVehicleDeath(vehicleid, killerid)
  121. {
  122. return 1;
  123. }
  124.  
  125. public OnPlayerText(playerid, text[])
  126. {
  127. return 1;
  128. }
  129.  
  130. public OnPlayerCommandText(playerid, cmdtext[])
  131. {
  132. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  133. {
  134. // Do something here
  135. return 1;
  136. }
  137. return 0;
  138. }
  139.  
  140. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  141. {
  142. return 1;
  143. }
  144.  
  145. public OnPlayerExitVehicle(playerid, vehicleid)
  146. {
  147. return 1;
  148. }
  149.  
  150. public OnPlayerStateChange(playerid, newstate, oldstate)
  151. {
  152. return 1;
  153. }
  154.  
  155. public OnPlayerEnterCheckpoint(playerid)
  156. {
  157. return 1;
  158. }
  159.  
  160. public OnPlayerLeaveCheckpoint(playerid)
  161. {
  162. return 1;
  163. }
  164.  
  165. public OnPlayerEnterRaceCheckpoint(playerid)
  166. {
  167. return 1;
  168. }
  169.  
  170. public OnPlayerLeaveRaceCheckpoint(playerid)
  171. {
  172. return 1;
  173. }
  174.  
  175. public OnRconCommand(cmd[])
  176. {
  177. return 1;
  178. }
  179.  
  180. public OnPlayerRequestSpawn(playerid)
  181. {
  182. return 1;
  183. }
  184.  
  185. public OnObjectMoved(objectid)
  186. {
  187. return 1;
  188. }
  189.  
  190. public OnPlayerObjectMoved(playerid, objectid)
  191. {
  192. return 1;
  193. }
  194.  
  195. public OnPlayerPickUpPickup(playerid, pickupid)
  196. {
  197. return 1;
  198. }
  199.  
  200. public OnVehicleMod(playerid, vehicleid, componentid)
  201. {
  202. return 1;
  203. }
  204.  
  205. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  206. {
  207. return 1;
  208. }
  209.  
  210. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  211. {
  212. return 1;
  213. }
  214.  
  215. public OnPlayerSelectedMenuRow(playerid, row)
  216. {
  217. return 1;
  218. }
  219.  
  220. public OnPlayerExitedMenu(playerid)
  221. {
  222. return 1;
  223. }
  224.  
  225. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  226. {
  227. return 1;
  228. }
  229.  
  230. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  231. {
  232. return 1;
  233. }
  234.  
  235. public OnRconLoginAttempt(ip[], password[], success)
  236. {
  237. return 1;
  238. }
  239.  
  240. public OnPlayerUpdate(playerid)
  241. {
  242. return 1;
  243. }
  244.  
  245. public OnPlayerStreamIn(playerid, forplayerid)
  246. {
  247. return 1;
  248. }
  249.  
  250. public OnPlayerStreamOut(playerid, forplayerid)
  251. {
  252. return 1;
  253. }
  254.  
  255. public OnVehicleStreamIn(vehicleid, forplayerid)
  256. {
  257. return 1;
  258. }
  259.  
  260. public OnVehicleStreamOut(vehicleid, forplayerid)
  261. {
  262. return 1;
  263. }
  264.  
  265. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  266. {
  267. return 1;
  268. }
  269.  
  270. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  271. {
  272. return 1;
  273. }
  274.  
  275. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  276. {
  277. if(checkpointid == PlantbombCP)
  278. {
  279. if(AllTeams[playerid] == C1 && (BombPlanted == 1))
  280. {
  281. DefuseTimer = SetTimerEx("DefuseBomb", 10000, false, "is", playerid);
  282. Defusing = 1;
  283. GameTextForAll("~b~Army is trying to defuse the bomb!!~n~~r~Terrorists, Try to stop them!", 3000, 3);
  284. return 1;
  285. }
  286. else return 0;
  287. }
  288. return 1;
  289. }
  290. public OnPlayerLeaveDynamicCP(playerid, checkpointid)
  291. {
  292. if(checkpointid == PlantbombCP && (Defusing == 1 && (AllTeams[playerid] == C1)))
  293. {
  294. KillTimer(DefuseTimer);
  295. Defusing = 0;
  296. GameTextForAll("Army Failed to defuse the bomb", 2000, 3);
  297. }
  298. return 1;
  299. }
  300. forward DefuseBomb(playerid);
  301. public DefuseBomb(playerid)
  302. {
  303. if(Defusing == 1)
  304. {
  305. KillTimer(DefuseTimer);
  306. KillTimer(BombExplodeTimer);
  307. KillTimer(ExplodeBomb[playerid]);
  308. GameTextForAll("Army successfully defused the bomb!", 3000, 3);
  309. GivePlayerMoney(playerid, 10000);
  310. Defusing = 0;
  311. BombPlanted = 0;
  312. DestroyObject(Bomb);
  313. SetPlayerScore(playerid, GetPlayerScore(playerid) +10);
  314. SendClientMessage(playerid, COLOR_GREEN, "you earned {FF0000}$10000 {00FF00}and {FF0000}10 score {00FF00}for defusing the bomb");
  315. return 1;
  316. }
  317. return 1;
  318. }
  319. CMD:plantbomb(playerid, params[])
  320. {
  321. if(IsPlayerInDynamicCP(playerid, PlantbombCP) && (AllTeams[playerid] == TeamTerrorists && (BombPlanted == 0)))
  322. {
  323. Bomb = CreateObject(3786,259.2780,1855.8953,8.7578,196.8689,0,0, 100.0);
  324. BombExplodeTimer = SetTimer("BombExplodes", 110000, 0);
  325. GameTextForAll("~r~Terrorists planted a bomb in ~b~Army base~n~~g~army try to defuse it~n~ ~r~stand in checkpoint for 10 seconds to defuse it!", 4000, 3);
  326. BombPlanted = 1;
  327. }
  328. else if(IsPlayerInDynamicCP(playerid, PlantbombCP) && (AllTeams[playerid] == TeamTerrorists && (BombPlanted != 0))) return SendClientMessage(playerid, COLOR_RED, "The bomb is already planted!");
  329. return 1;
  330. }
  331. forward BombExplodes(playerid);
  332. public BombExplodes(playerid)
  333. {
  334. GameTextForAll("Bomb explodes in 10 seconds!!, get the hell out of there!", 3000, 3);
  335. ExplodeBomb[playerid] = SetTimerEx("ExplodeBombTimer", 10000, false, "d", playerid);
  336. return 1;
  337. }
  338. forward ExplodeBombTimer(playerid);
  339. public ExplodeBombTimer(playerid)
  340. {
  341. CreateExplosion(259.2780,1855.8953,8.7578, 7, 5000.0);
  342. DestroyObject(Bomb);
  343. GameTextForAll("BOOOOOOMMM!!!", 1000, 3);
  344. BombPlanted = 0;
  345. SendClientMessage(playerid, COLOR_GREEN, "you earned {FF0000}$10000 {00FF00} and {FF0000}10 score {00FF00} for planting the bomb in army base");
  346. GivePlayerMoney(playerid, 10000);
  347. SetPlayerScore(playerid, GetPlayerScore(playerid) +10);
  348. return 1;
  349. }
Advertisement
Add Comment
Please, Sign In to add comment