Guest User

Untitled

a guest
Apr 25th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.85 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #pragma tabsize 0
  4.  
  5.  
  6. #define WHITE_COLOR 0xFFFFFFAA // white
  7. #define BLUE_COLOR 0x0000BBAA // blue
  8. #define COLOR_RED 0xAA3333AA //red
  9.  
  10.  
  11. forward GameModeExitFunc();
  12. forward Restart();
  13.  
  14. forward SetPlayerToTeamColor(playerid);
  15. forward Finsh();
  16.  
  17.  
  18. #define TEAM_1 0
  19. #define TEAM_2 1
  20.  
  21.  
  22. static gTeam[MAX_PLAYERS]; // Tracks the team assignment for each player
  23. new Team[MAX_PLAYERS];
  24. new gObjectiveGreenPlayer=(-1);
  25. new gObjectiveTerriost=(-1);
  26. new gObjectiveReached=0;
  27. #define OBJECTIVE_PONY 1
  28. #define OBJECTIVE_COLOR 0xAA0000FF
  29. new Text:Textdraw0;
  30. new Text:Textdraw1;
  31. new Text:Textdraw2;
  32.  
  33.  
  34. #if defined FILTERSCRIPT
  35.  
  36. public OnFilterScriptInit()
  37. {
  38. print("\n--------------------------------------");
  39. print(" Blank Filterscript by your name here");
  40. print("--------------------------------------\n");
  41. return 1;
  42. }
  43.  
  44. public OnFilterScriptExit()
  45. {
  46. return 1;
  47. }
  48.  
  49. #else
  50.  
  51. main()
  52. {
  53. print("\n----------------------------------");
  54. print("Terriost Business");
  55. print("----------------------------------\n");
  56. }
  57.  
  58. #endif
  59.  
  60. public OnGameModeInit()
  61. {
  62. // Don't use these lines if it's a filterscript
  63. SetGameModeText("Terriost Business");
  64.  
  65.  
  66.  
  67. //-------5 minutes-----------
  68. SetTimer("OVER", 600000, 0);
  69.  
  70.  
  71.  
  72. AddPlayerClass(153,-596.0947,-1068.8480,23.4771,211.7135,27,100,32,200,30,300); // FACTORY CAR STEALING MISSIon SABRE SKINS
  73. AddPlayerClass(284,-580.9339,-499.1627,25.5234,283.1998,27,100,32,300,31,300); // PONY PROTECTOR SKIN MISSION FACTORY and wtf is illgeal ROFL
  74.  
  75.  
  76. AddStaticVehicle(475,-565.6738,-1042.0286,23.8060,235.5874,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 1
  77. AddStaticVehicle(475,-567.9216,-1044.5132,23.7499,233.9885,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 2
  78. AddStaticVehicle(475,-569.6974,-1048.1484,23.6728,234.6776,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 3
  79. AddStaticVehicle(475,-571.7986,-1051.1344,23.5991,234.6763,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 4
  80. AddStaticVehicle(475,-574.1917,-1054.5111,23.5153,234.6763,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 5
  81. AddStaticVehicle(475,-575.9990,-1057.0607,23.4520,234.6763,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 7
  82. AddStaticVehicle(475,-577.9879,-1059.8668,23.3823,234.6763,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 8
  83. AddStaticVehicle(475,-580.2786,-1063.0983,23.3021,234.6763,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 9
  84. AddStaticVehicle(475,-582.1887,-1065.7932,23.2352,234.6763,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 10
  85. AddStaticVehicle(475,-584.3939,-1068.9043,23.1580,234.6763,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 11
  86. AddStaticVehicle(475,-586.7207,-1072.1868,23.0765,234.6763,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 12
  87. AddStaticVehicle(475,-588.1549,-1075.1921,23.1024,234.6763,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 13
  88. AddStaticVehicle(475,-590.1531,-1078.0150,23.4009,234.6763,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 14
  89. AddStaticVehicle(475,-592.2417,-1080.9617,23.3278,234.6763,1,1); // SABRE FACTORY TRUCK STEAL MISSION SABRE 15
  90.  
  91. AddStaticVehicle(413,-569.3774,-502.4915,25.5321,359.0833,0,0); // OBJECTIVE_PONY
  92.  
  93.  
  94. Textdraw0 = TextDrawCreate(248.000000,431.000000,"UtD Server");
  95. TextDrawAlignment(Textdraw0,0);
  96. TextDrawBackgroundColor(Textdraw0,0x000000ff);
  97. TextDrawFont(Textdraw0,0);
  98. TextDrawLetterSize(Textdraw0,1.000000,1.500000);
  99. TextDrawColor(Textdraw0,0xffffffff);
  100. TextDrawSetProportional(Textdraw0,1);
  101. TextDrawSetShadow(Textdraw0,2);
  102.  
  103. Textdraw2 = TextDrawCreate(1.000000,1.000000,"..");
  104. TextDrawUseBox(Textdraw2,1);
  105. TextDrawBoxColor(Textdraw2,0x000000ff);
  106. TextDrawTextSize(Textdraw2,690.000000,435.000000);
  107. TextDrawAlignment(Textdraw2,0);
  108. TextDrawBackgroundColor(Textdraw2,0x000000ff);
  109. TextDrawFont(Textdraw2,3);
  110. TextDrawLetterSize(Textdraw2,1.000000,12.600009);
  111. TextDrawColor(Textdraw2,0x000000ff);
  112. TextDrawSetOutline(Textdraw2,1);
  113. TextDrawSetProportional(Textdraw2,1);
  114. TextDrawSetShadow(Textdraw2,1);
  115.  
  116.  
  117. Textdraw1 = TextDrawCreate(1.000000,426.000000,"..");
  118. TextDrawUseBox(Textdraw1,1);
  119. TextDrawBoxColor(Textdraw1,0x000000ff);
  120. TextDrawTextSize(Textdraw1,674.000000,0.000000);
  121. TextDrawAlignment(Textdraw1,0);
  122. TextDrawBackgroundColor(Textdraw1,0x000000ff);
  123. TextDrawFont(Textdraw1,3);
  124. TextDrawLetterSize(Textdraw1,1.000000,2.200000);
  125. TextDrawColor(Textdraw1,0x000000ff);
  126. TextDrawSetOutline(Textdraw1,1);
  127. TextDrawSetProportional(Textdraw1,1);
  128. TextDrawSetShadow(Textdraw1,1);
  129.  
  130.  
  131. return 1;
  132. }
  133.  
  134. public OnGameModeExit()
  135. {
  136. return 1;
  137. }
  138.  
  139. public OnPlayerRequestClass(playerid, classid)
  140. {
  141. SetPlayerPos(playerid, 1644.4078,-1133.8214,58.2172);
  142. SetPlayerCameraPos(playerid, 1647.6301,-1134.5725,58.2489);
  143. SetPlayerCameraLookAt(playerid, 1644.4078,-1133.8214,58.2172);
  144. SetPlayerFacingAngle(playerid,258.5584);
  145.  
  146. if(classid == 0)
  147. {
  148. GameTextForPlayer(playerid, "~r~ Terriosts", 9000, 3);
  149. Team[playerid] = TEAM_1;
  150. }
  151. else if(classid == 1)
  152. {
  153. GameTextForPlayer(playerid, "~b~FBI", 9000, 3);
  154. Team[playerid] = TEAM_2;
  155. }
  156.  
  157. return 1;
  158. }
  159.  
  160.  
  161.  
  162. public OnPlayerConnect(playerid)
  163. {
  164.  
  165. SendClientMessage(playerid,BLUE_COLOR, "Welcome to the server");
  166. SendClientMessage(playerid,WHITE_COLOR, "Mission: Terriost Business");
  167.  
  168.  
  169. GameTextForPlayer(playerid, " ~r~ 10 Min Left", 2500 , 0);
  170.  
  171. TextDrawShowForPlayer(playerid, Textdraw0);
  172. TextDrawShowForPlayer(playerid, Textdraw1);
  173. TextDrawShowForPlayer(playerid, Textdraw2);
  174. return 1;
  175. }
  176.  
  177.  
  178. public OnPlayerDisconnect(playerid, reason)
  179. {
  180. return 1;
  181. }
  182. public SetPlayerToTeamColor(playerid)
  183. {
  184. if(gTeam[playerid] == TEAM_1) {
  185. SetPlayerColor(playerid,WHITE_COLOR); // green
  186. } else if(gTeam[playerid] == TEAM_2) {
  187. SetPlayerColor(playerid,BLUE_COLOR); // blue
  188. }
  189. }
  190. public OnPlayerSpawn(playerid)
  191. {
  192. if(Team[playerid] == TEAM_1)
  193. {
  194.  
  195. SendClientMessage(playerid,WHITE_COLOR,"You Are a Terriost attack the factory and steal the van");
  196. }
  197. else if(Team[playerid] == TEAM_2)
  198. {
  199.  
  200. SendClientMessage(playerid,WHITE_COLOR,"You Are a FBI Member Protect the van from the terriosts");
  201. }
  202.  
  203.  
  204.  
  205. TextDrawHideForPlayer(playerid, Textdraw1);
  206. TextDrawHideForPlayer(playerid, Textdraw2);
  207.  
  208. if(gTeam[playerid] == TEAM_1) {
  209. SetVehicleParamsForPlayer(OBJECTIVE_PONY,playerid,1,0); // objective; unlocked
  210. SetVehicleParamsForPlayer(OBJECTIVE_PONY,playerid,1,1); // objective; locked
  211. SetPlayerCheckpoint(playerid,1513.3240,-1660.7247,13.6131,7.0);
  212. SetPlayerWorldBounds(playerid,2535.4392,1434.0455,-1581.9657,-1715.8713);
  213. GameTextForPlayer(playerid,
  214. "Capture the Van at the factory",
  215. 6000,5);
  216. }
  217.  
  218.  
  219.  
  220. SetPlayerCheckpoint(playerid,-561.4668,-1054.3661,23.8782 , 16.0);
  221.  
  222. return 1;
  223. }
  224.  
  225.  
  226. public OnPlayerDeath(playerid, killerid, reason)
  227. {
  228. SendDeathMessage(killerid, playerid, reason);
  229. SetPlayerScore(killerid,(GetPlayerScore(killerid))+1);
  230. return 1;
  231. }
  232. public OnPlayerStateChange(playerid, newstate, oldstate)
  233. {
  234. new vehicleid;
  235.  
  236. if(newstate == PLAYER_STATE_DRIVER)
  237. {
  238. vehicleid = GetPlayerVehicleID(playerid);
  239.  
  240. if(gTeam[playerid] == TEAM_1 && vehicleid == OBJECTIVE_PONY)
  241. { // It's the objective vehicle
  242. SetPlayerColor(playerid,OBJECTIVE_COLOR);
  243. GameTextForPlayer(playerid,"~w~Take the ~r~van ~w~back to the spawn!",3000,5);
  244. gObjectiveGreenPlayer = playerid;
  245. }
  246.  
  247. }else if(newstate == PLAYER_STATE_ONFOOT)
  248. {
  249.  
  250. if(playerid == gObjectiveTerriost) {
  251. gObjectiveTerriost = (-1);
  252. SetPlayerToTeamColor(playerid);
  253. }
  254. }
  255. return 1;
  256. }
  257. public OnPlayerEnterCheckpoint(playerid)
  258. {
  259. new playervehicleid = GetPlayerVehicleID(playerid);
  260.  
  261. if(gObjectiveReached) return 1;
  262.  
  263. if(playervehicleid == OBJECTIVE_PONY && gTeam[playerid] == TEAM_1)
  264. { // Blue OBJECTIVE REACHED.
  265. GameTextForAll("~b~Terriost Wins",3000,5);
  266. gObjectiveReached = 1;
  267. SetPlayerScore(playerid,GetPlayerScore(playerid)+5);
  268. SetTimer("Finsh", 4000, 0); // Set up a timer to exit this mode.
  269. }
  270. return 1;
  271. }
Add Comment
Please, Sign In to add comment