Advertisement
Mciko123

[PAWN] Football system

Oct 24th, 2016
3,072
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.75 KB | None | 0 0
  1. /*
  2. ~ CREDITS ~
  3.  
  4. Created by: Farkias
  5. Edited: Micko
  6. Bug fix: Micko
  7. Translate: Micko (not the best translate but.. xD )
  8.  
  9. This FS is very nice and i hope it will make your game better :)
  10. I hope that you won't remove this text.
  11. To make this FS playable just put it in filterscripts folder and in server.cfg
  12. in the "filterscripts" line write football.
  13.  
  14. If you want to put this FS directly in your GM also be nice and leave the credits
  15.  
  16. Now go and score some goals :)
  17.  
  18. PS: If you find any bug just PM me on http://forum.sa-mp.com/
  19. My Account: http://forum.sa-mp.com/member.php?u=275247
  20. */
  21.  
  22. #include <a_samp>
  23. #include <streamer>
  24. #include <sscanf2>
  25. #include <foreach>
  26. #include <zcmd>
  27.  
  28. // -- Football --
  29. new ball;
  30. new goals1;
  31. new goals2;
  32. new gol;
  33. new shooter;
  34. new gameTimer;
  35. new footballTeam[MAX_PLAYERS];
  36. new bool:footbalOn;
  37.  
  38. new animation[200];
  39.  
  40. new isAnimating[MAX_PLAYERS];
  41. new gPlayerUsingLoopingAnim[MAX_PLAYERS];
  42.  
  43. #define LIGHT_BLUE "{00A2D7}"
  44. #define COLOR_YELLOW 0xDABB3EAA
  45.  
  46.  
  47. #define ERROR(%0,%1) \
  48. SendClientMessage(%0, 0xF81414FF, "{F81414}(ERROR) | {FFFFFF} "%1)
  49. #define USAGE(%0,%1) \
  50. SendClientMessage(%0, 0xC0C0C0FF, "{C0C0C0}(USAGE) | {FFFFFF} "%1)
  51.  
  52. public OnFilterScriptInit()
  53. {
  54. //========================= [football stadium] =============================
  55. new white[48], grass[10], pillar[8];
  56. white[0] = CreateDynamicObject(9339, 1384.6, 2125.3, 9.33, 0, 0, 0);
  57. white[1] = CreateDynamicObject(9339, 1384.6, 2151.3999, 9.33, 0, 0, 0);
  58. white[2] = CreateDynamicObject(9339, 1384.6, 2174.3999, 9.33, 0, 0, 0);
  59. white[3] = CreateDynamicObject(9339, 1311.4, 2125.3, 9.33, 0, 0, 0);
  60. white[4] = CreateDynamicObject(9339, 1311.4, 2148.3999, 9.33, 0, 0, 0);
  61. white[5] = CreateDynamicObject(9339, 1311.4, 2174.3999, 9.33, 0, 0, 0);
  62. white[6] = CreateDynamicObject(9339, 1371.7002, 2187.2998, 9.3299999, 0, 0, 90);
  63. white[7] = CreateDynamicObject(9339, 1350.4, 2187.3, 9.33, 0, 0, 90);
  64. white[8] = CreateDynamicObject(9339, 1324.3, 2187.3, 9.33, 0, 0, 90);
  65. white[9] = CreateDynamicObject(9339, 1371.7, 2112.3, 9.33, 0, 0, 90);
  66. white[10] = CreateDynamicObject(9339, 1345.7, 2112.3, 9.33, 0, 0, 90);
  67. white[11] = CreateDynamicObject(9339, 1324.4, 2112.3, 9.33, 0, 0, 90);
  68. white[12] = CreateDynamicObject(9339, 1324.5, 2149.6001, 9.33, 0, 0, 90);
  69. white[13] = CreateDynamicObject(9339, 1350.6, 2149.6001, 9.33, 0, 0, 90);
  70. white[14] = CreateDynamicObject(9339, 1371.6, 2149.6001, 9.33, 0, 0, 90);
  71. white[15] = CreateDynamicObject(16501, 1338.2998, 2115.7998, 7.8260002, 0, 0, 0);
  72. white[16] = CreateDynamicObject(16501, 1358, 2115.7998, 7.8249998, 0, 0, 0);
  73. white[17] = CreateDynamicObject(16501, 1341.7998, 2119.25, 7.8260002, 0, 0, 90);
  74. white[18] = CreateDynamicObject(16501, 1348.9004, 2119.25, 7.8260002, 0, 0, 90);
  75. white[19] = CreateDynamicObject(16501, 1354.5, 2119.25, 7.8260002, 0, 0, 90);
  76. white[20] = CreateDynamicObject(16501, 1369.2998, 2115.7998, 7.8249998, 0, 0, 0);
  77. white[21] = CreateDynamicObject(16501, 1369.2998, 2122.75, 7.8249998, 0, 0, 0);
  78. white[22] = CreateDynamicObject(16501, 1365.7002, 2126.2002, 7.8249998, 0, 0, 90);
  79. white[23] = CreateDynamicObject(16501, 1358.5996, 2126.2002, 7.8249998, 0, 0, 90);
  80. white[24] = CreateDynamicObject(16501, 1351.5, 2126.2002, 7.8249998, 0, 0, 90);
  81. white[25] = CreateDynamicObject(16501, 1344.5, 2126.2002, 7.8260002, 0, 0, 90);
  82. white[26] = CreateDynamicObject(16501, 1337.4004, 2126.2002, 7.8260002, 0, 0, 90);
  83. white[27] = CreateDynamicObject(16501, 1330.4004, 2126.2002, 7.8260002, 0, 0, 90);
  84. white[28] = CreateDynamicObject(16501, 1326.9404, 2122.7002, 7.8260002, 0, 0, 0);
  85. white[29] = CreateDynamicObject(16501, 1326.9404, 2115.7998, 7.8260002, 0, 0, 0);
  86. white[30] = CreateDynamicObject(16501, 1338.3, 2183.8, 7.8260002, 0, 0, 0);
  87. white[31] = CreateDynamicObject(16501, 1358, 2183.8, 7.8260002, 0, 0, 0);
  88. white[32] = CreateDynamicObject(16501, 1354.5, 2180.3501, 7.8260002, 0, 0, 90);
  89. white[33] = CreateDynamicObject(16501, 1347.4, 2180.3501, 7.8260002, 0, 0, 90);
  90. white[34] = CreateDynamicObject(16501, 1341.8, 2180.3501, 7.8260002, 0, 0, 90);
  91. white[35] = CreateDynamicObject(16501, 1326.9399, 2183.8999, 7.8260002, 0, 0, 0);
  92. white[36] = CreateDynamicObject(16501, 1326.9399, 2176.8999, 7.8260002, 0, 0, 0);
  93. white[37] = CreateDynamicObject(16501, 1330.4, 2173.3999, 7.8260002, 0, 0, 90);
  94. white[38] = CreateDynamicObject(16501, 1337.5, 2173.3999, 7.8260002, 0, 0, 90);
  95. white[39] = CreateDynamicObject(16501, 1344.6, 2173.3999, 7.8260002, 0, 0, 90);
  96. white[40] = CreateDynamicObject(16501, 1351.7, 2173.3999, 7.8260002, 0, 0, 90);
  97. white[41] = CreateDynamicObject(16501, 1358.8, 2173.3999, 7.8260002, 0, 0, 90);
  98. white[42] = CreateDynamicObject(16501, 1369.3, 2183.8, 7.8260002, 0, 0, 0);
  99. white[43] = CreateDynamicObject(16501, 1369.3, 2176.8701, 7.8260002, 0, 0, 0);
  100. white[44] = CreateDynamicObject(16501, 1365.8, 2173.3999, 7.8260002, 0, 0, 90);
  101. white[45] = CreateDynamicObject(18808, 1348.5, 2149.7, -14.96, 0, 0, 0);
  102. white[46] = CreateDynamicObject(18808, 1348.1, 2124.6001, -15, 1, 0, 0);
  103. white[47] = CreateDynamicObject(18808, 1349.1, 2175, -15, 359, 0, 0);
  104. for(new i = 0; i < sizeof(white); i++) { SetDynamicObjectMaterial(white[i], 0, 3924, "rc_warhoose", "white", 0xFFFFFFFF); }
  105. SetDynamicObjectMaterial(white[46], 1, 3924, "rc_warhoose", "white", 0xFFFFFFFF);
  106. SetDynamicObjectMaterial(white[47], 1, 3924, "rc_warhoose", "white", 0xFFFFFFFF);
  107. grass[0] = CreateDynamicObject(4708, 1373.4, 2120.8999, -7.8629999, 0, 0, 0);
  108. grass[1] = CreateDynamicObject(4708, 1322.3, 2126.2998, -7.8639998, 0, 0, 0);
  109. grass[2] = CreateDynamicObject(4708, 1322.3, 2120.8999, -7.8610001, 0, 0, 0);
  110. grass[3] = CreateDynamicObject(4708, 1373.4, 2149.7, -7.8629999, 0, 0, 0);
  111. grass[4] = CreateDynamicObject(4708, 1339, 2148.3999, -7.8639998, 0, 0, 0);
  112. grass[5] = CreateDynamicObject(4708, 1322.3, 2149.7, -7.8610001, 0, 0, 0);
  113. grass[6] = CreateDynamicObject(4708, 1339, 2177.2, -7.8639998, 0, 0, 0);
  114. grass[7] = CreateDynamicObject(4708, 1373.4, 2177.2, -7.8610001, 0, 0, 0);
  115. grass[8] = CreateDynamicObject(4708, 1339, 2120.8999, -7.862, 0, 0, 0);
  116. grass[9] = CreateDynamicObject(4708, 1322.3, 2177.2, -7.862, 0, 0, 0);
  117. for(new i = 0; i < sizeof(grass); i++)
  118. {
  119. SetDynamicObjectMaterial(grass[i], 5, 10931, "traingen_sfse", "desgreengrass", 0xFFFFFFFF);
  120. SetDynamicObjectMaterial(grass[i], 9, 10931, "traingen_sfse", "desgreengrass", 0xFFFFFFFF);
  121. }
  122. pillar[0] = CreateDynamicObject(1251, 1350.1, 2187.3999, 13.302, 0, 0, 90);
  123. pillar[1] = CreateDynamicObject(1251, 1347.4, 2187.3999, 13.3, 0, 0, 90);
  124. pillar[2] = CreateDynamicObject(1251, 1344, 2187.3999, 9.8999996, 90, 0, 0);
  125. pillar[3] = CreateDynamicObject(1251, 1353.5, 2187.3, 9.8999996, 90, 0, 0);
  126. pillar[4] = CreateDynamicObject(1251, 1344, 2112.3, 9.8999996, 90, 0, 0);
  127. pillar[5] = CreateDynamicObject(1251, 1353.7, 2112.3999, 9.8999996, 90, 0, 0);
  128. pillar[6] = CreateDynamicObject(1251, 1347.4, 2112.3, 13.302, 0, 0, 90);
  129. pillar[7] = CreateDynamicObject(1251, 1350.3, 2112.3101, 13.302, 0, 0, 90);
  130. for(new i = 0; i < sizeof(pillar); i++) { SetDynamicObjectMaterial(pillar[i], 0, 3924, "rc_warhoose", "white", 0xFFFFFFFF); }
  131. CreateDynamicObject(2945, 1344, 2189.5, 11.4, 0, 0, 90);
  132. CreateDynamicObject(2945, 1353.5, 2189.5, 11.4, 0, 0, 90);
  133. CreateDynamicObject(2945, 1351.8, 2191.1001, 11.4, 0, 0, 0);
  134. CreateDynamicObject(2945, 1349.6, 2191.1001, 11.4, 0, 0, 0);
  135. CreateDynamicObject(2945, 1346.0996, 2191.1006, 11.4, 0, 0, 0);
  136. CreateDynamicObject(2945, 1345.3, 2189.5, 13.3, 90, 0, 90);
  137. CreateDynamicObject(2945, 1348.6, 2189.5, 13.3, 90, 0, 90);
  138. CreateDynamicObject(2945, 1351.5996, 2189.5, 13.3, 90, 0, 90);
  139. CreateDynamicObject(2945, 1353.7, 2110.7, 11.4, 0, 0, 90);
  140. CreateDynamicObject(2945, 1344, 2110.7, 11.4, 0, 0, 90);
  141. CreateDynamicObject(2945, 1352, 2108.6001, 11.4, 0, 0, 0);
  142. CreateDynamicObject(2945, 1349.8, 2108.6001, 11.4, 0, 0, 0);
  143. CreateDynamicObject(2945, 1346.1, 2108.6001, 11.4, 0, 0, 0);
  144. CreateDynamicObject(2945, 1351.8, 2110.7, 13.3, 90, 0, 90);
  145. CreateDynamicObject(2945, 1345.3, 2110.7, 13.3, 90, 0, 90);
  146. CreateDynamicObject(2945, 1348.54, 2110.7, 13.3, 90, 0, 90);
  147. return 1;
  148. }
  149.  
  150. public OnFilterScriptExit()
  151. {
  152. return 1;
  153. }
  154.  
  155. public OnPlayerConnect(playerid)
  156. {
  157. footballTeam[playerid] = 0;
  158. isAnimating[playerid] = 0;
  159. gPlayerUsingLoopingAnim[playerid] = 0;
  160. return 1;
  161. }
  162.  
  163. public OnPlayerSpawn(playerid)
  164. {
  165. isAnimating[playerid] = 0;
  166. if(gPlayerUsingLoopingAnim[playerid])
  167. {
  168. gPlayerUsingLoopingAnim[playerid] = 0;
  169. }
  170. return 1;
  171. }
  172.  
  173. public OnPlayerDeath(playerid, killerid, reason)
  174. {
  175. isAnimating[playerid] = 0;
  176. return 1;
  177. }
  178.  
  179. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  180. {
  181. if(footballTeam[playerid] == 2 || footballTeam[playerid] == 1)
  182. {
  183. new Float:x, Float:y, Float:z;
  184. GetDynamicObjectPos(ball, x, y, z);
  185. if(newkeys & KEY_FIRE)
  186. {
  187. if(IsPlayerInRangeOfPoint(playerid, 2.5, x, y, z))
  188. {
  189. GetPlayerPos(playerid, x, y, z);
  190. GetXYInFrontOfPlayer(playerid, x, y, 8.0);
  191. MoveDynamicObject(ball,x,y,10.2,8.0,0,0,0);
  192. shooter = playerid;
  193. LoopingAnim(playerid,"FIGHT_D","FightD_1",4.1,0,1,1,0,0);
  194. SetTimerEx("FootballAnimation", 1000, false, "d", playerid);
  195. }
  196. }
  197. }
  198. return 1;
  199. }
  200.  
  201. forward FootballAnimation(playerid);
  202. public FootballAnimation(playerid)
  203. {
  204. if(isAnimating[playerid] == 1) return ERROR(playerid, "You can't stop animation!");
  205. StopLoopingAnim(playerid);
  206. return 1;
  207. }
  208.  
  209. forward GoalCount();
  210. public GoalCount()
  211. {
  212. foreach(Player, i)
  213. {
  214. if(footballTeam[i] == 1 || footballTeam[i] == 2)
  215. {
  216. SetPlayerHealth(i, 99.0);
  217. }
  218. }
  219. if(IsObjectInTheArea(ball,1343.9974,2108.0566,1353.3119,2112.6431))
  220. {
  221. new name[MAX_PLAYER_NAME];
  222. GetPlayerName(shooter, name, MAX_PLAYER_NAME);
  223. new str[128];
  224. goals1++;
  225. if(footballTeam[shooter] == 1)
  226. {
  227. format(str, 128, "Football | AUTOGOL! |{FFFFFF} Player %s (team 1) scored an autogoal! |{FF0000} Team 1: %d, Team 2: %d", name, goals2, goals1);
  228. FootballPoruka(0xF81414FF, str);
  229. }
  230. else
  231. {
  232. format(str, 128, "Football | GOOOOOL! |{FFFFFF} Player %s (tim 2) scored a goal! |{FFFF00} Team 1: %d, Team 2: %d", name, goals2, goals1);
  233. FootballPoruka(0xFFFF33FF, str);
  234. }
  235. foreach(Player, i)
  236. {
  237. if(footballTeam[i] == 1)
  238. {
  239. SetPlayerPos(i, 1348.9005,2115.8665,11.0364);
  240. SetPlayerInterior(i, 0);
  241. }
  242. else if(footballTeam[i] == 2)
  243. {
  244. SetPlayerPos(i, 1348.7242,2184.3674,11.0344);
  245. SetPlayerFacingAngle(i, 180);
  246. SetPlayerInterior(i, 0);
  247. }
  248. }
  249. DestroyDynamicObject(ball);
  250. ball = CreateDynamicObject(2114, 1348.4065,2149.4966,10.2, 0, 0, 0);
  251. SetDynamicObjectMaterial(ball, 0, 5033, "union_las", "ws_carparkwall2", 0);
  252. }
  253. else if(IsObjectInTheArea(ball,1343.9312,2186.9382,1353.5435,2191.6492))
  254. {
  255. new name[MAX_PLAYER_NAME];
  256. GetPlayerName(shooter, name, MAX_PLAYER_NAME);
  257. new str[128];
  258. goals2++;
  259. if(footballTeam[shooter] == 2)
  260. {
  261. format(str, 128, "Football | AUTOGOAL! |{FFFFFF} Player %s (tim 2) scored and autogoal! |{FF0000} Team 1: %d, Team 2: %d", name, goals2, goals1);
  262. FootballPoruka(0xF81414FF, str);
  263. }
  264. else
  265. {
  266. format(str, 128, "Football | GOOOOAL! |{FFFFFF} Player %s (tim 1) scored a goal! |{FFFF00} Team 1: %d, Team 2: %d", name, goals2, goals1);
  267. FootballPoruka(0xFFFF33FF, str);
  268. }
  269. foreach(Player, i)
  270. {
  271. if(footballTeam[i] == 1)
  272. {
  273. SetPlayerPos(i, 1348.9005,2115.8665,11.0364);
  274. SetPlayerInterior(i, 0);
  275. }
  276. else if(footballTeam[i] == 2)
  277. {
  278. SetPlayerPos(i, 1348.7242,2184.3674,11.0344);
  279. SetPlayerFacingAngle(i, 180);
  280. SetPlayerInterior(i, 0);
  281. }
  282. }
  283. DestroyDynamicObject(ball);
  284. ball = CreateDynamicObject(2114, 1348.4065,2149.4966,10.2, 0, 0, 0);
  285. SetDynamicObjectMaterial(ball, 0, 5033, "union_las", "ws_carparkwall2", 0);
  286. }
  287. else if(!IsObjectInTheArea(ball,1311.3945,2112.2881,1384.5884,2187.2483))
  288. {
  289. DestroyDynamicObject(ball);
  290. ball = CreateDynamicObject(2114, 1348.4065,2149.4966,10.2, 0, 0, 0);
  291. SetDynamicObjectMaterial(ball, 0, 5033, "union_las", "ws_carparkwall2", 0);
  292. }
  293. return 1;
  294. }
  295.  
  296. forward FootbalTime();
  297. public FootbalTime()
  298. {
  299. new str[128];
  300. foreach(Player, i)
  301. {
  302. if(footballTeam[i] == 1)
  303. {
  304. format(str, 128, "| End of the game |{FFFFFF} You: %d | Them: %d", goals2, goals1);
  305. SendClientMessage(i, 0x00A2D7FF, str);
  306. footballTeam[i] = 0;
  307. SpawnPlayer(i);
  308. }
  309. else if(footballTeam[i] == 2)
  310. {
  311. format(str, 128, "| End of the game |{FFFFFF} You: %d | Them: %d", goals1, goals2);
  312. SendClientMessage(i, 0x00A2D7FF, str);
  313. footballTeam[i] = 0;
  314. SpawnPlayer(i);
  315. }
  316. }
  317. DestroyDynamicObject(ball);
  318. footbalOn = false;
  319. goals1 = 0;
  320. goals2 = 0;
  321. KillTimer(gol);
  322. return 1;
  323. }
  324. ////////////////////////////////////////////////////////////////////////////
  325. CMD:footballcall(playerid,params[])
  326. {
  327. if(IsPlayerAdmin(playerid))
  328. {
  329. new str[128], id, team;
  330. if(sscanf(params,"ui", id, team)) return USAGE(playerid, "/footballcall [ ID/name ] [Team 1 - 2, 0 - kick)]");
  331. if(!IsPlayerConnected(id)) return ERROR(playerid,"That player is offline!");
  332. if(team > 2 || team < 0) return ERROR(playerid,"Team can only be 1 or 2. 0 - kick from game!");
  333. new name[MAX_PLAYER_NAME], player[MAX_PLAYER_NAME];
  334. GetPlayerName(playerid, name, sizeof(name));
  335. GetPlayerName(id, player, sizeof(player));
  336. format(str,128,""LIGHT_BLUE"Football | You have been called on game by {ffffff}%s. | team %d", name, team);
  337. SendClientMessage(id, -1, str);
  338. format(str,128,""LIGHT_BLUE"Football | You've called {ffffff}%s"LIGHT_BLUE" on football game. | Team {ffffff}%d", player, team);
  339. SendClientMessage(playerid, -1, str);
  340. footballTeam[id] = team;
  341. ResetPlayerWeapons(id);
  342. if(footbalOn == true)
  343. {
  344. if(footballTeam[id] == 1)
  345. {
  346. SetPlayerPos(id, 1348.9005,2115.8665,11.0364);
  347. SetPlayerInterior(id, 0);
  348. SetPlayerSkin(id, 170);
  349. }
  350. else if(footballTeam[id] == 2)
  351. {
  352. SetPlayerPos(id, 1348.7242,2184.3674,11.0344);
  353. SetPlayerFacingAngle(id, 85);
  354. SetPlayerInterior(id, 0);
  355. SetPlayerSkin(id, 250);
  356. }
  357. }
  358. }
  359. else return ERROR(playerid,"You are not authorised to use this command!");
  360. return 1;
  361. }
  362.  
  363. CMD:footballstart(playerid,params[])
  364. {
  365. if(footbalOn == true) return ERROR(playerid,"Football game is not running!");
  366. if(IsPlayerAdmin(playerid))
  367. {
  368. new TimeF;
  369. if(sscanf(params,"i",TimeF)) return USAGE(playerid, "/footballstart [TIME(minutes)]");
  370. else if(TimeF < 1 || TimeF > 20) return ERROR(playerid,"Time has to be between 1 and 20!");
  371. gameTimer = SetTimer("FootbalTime", TimeF*59999, false);
  372. gol = SetTimer("GoalCount", 499, true);
  373. foreach(Player, i)
  374. {
  375. if(footballTeam[i] == 1)
  376. {
  377. SetPlayerPos(i, 1348.9005,2115.8665,11.0364);
  378. SetPlayerInterior(i, 0);
  379. SetPlayerSkin(i, 170);
  380. }
  381. else if(footballTeam[i] == 2)
  382. {
  383. SetPlayerPos(i, 1348.7242,2184.3674,11.0344);
  384. SetPlayerFacingAngle(i, 180);
  385. SetPlayerInterior(i, 0);
  386. SetPlayerSkin(i, 250);
  387. }
  388. }
  389. new str[128], name[MAX_PLAYER_NAME];
  390. GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  391. new string[90];
  392. format(string, sizeof(string), "[WARNING]: Admin %s has started football game for %d min", GetName(playerid),TimeF);
  393. AdminPregled(COLOR_YELLOW, string);
  394. format(str,128,""LIGHT_BLUE"Football |{ffffff} Football game has started! | "LIGHT_BLUE" Admin: {ffffff}%s"LIGHT_BLUE" | Time: {ffffff}%d min", name, TimeF);
  395. FootballPoruka(-1, str);
  396. ball = CreateDynamicObject(2114, 1348.4065,2149.4966,10.2, 0, 0, 0);
  397. SetDynamicObjectMaterial(ball, 0, 5033, "union_las", "ws_carparkwall2", 0);
  398. footbalOn = true;
  399. }
  400. else return ERROR(playerid,"You are not authorised to use this command!");
  401. return 1;
  402. }
  403.  
  404. CMD:footballstop(playerid,params[])
  405. {
  406. if(footbalOn == false) return ERROR(playerid,"Football game is not running!");
  407. if(IsPlayerAdmin(playerid))
  408. {
  409. new name[MAX_PLAYER_NAME];
  410. GetPlayerName(playerid, name, sizeof(name));
  411. new str[80];
  412. format(str, 80, ""LIGHT_BLUE"Football | Admin {ffffff}%s"LIGHT_BLUE" has stopped the game!", name);
  413. FootballPoruka(-1, str);
  414. KillTimer(gameTimer);
  415. FootbalTime();
  416. }
  417. else return ERROR(playerid,"You are not authorised to use this command!");
  418. return 1;
  419. }
  420. ///////////////////////////////////////////////////////////
  421. stock FootballPoruka(boja, string[])
  422. {
  423. foreach(Player, i)
  424. {
  425. if(footballTeam[i] == 1 || footballTeam[i] == 2)
  426. {
  427. SendClientMessage(i, boja, string);
  428. }
  429. }
  430. return 1;
  431. }
  432.  
  433. stock IsObjectInTheArea(objectid, Float:minx, Float:miny, Float:maxx, Float:maxy)
  434. {
  435. new Float:x, Float:y, Float:z;
  436. GetDynamicObjectPos(objectid, x, y, z);
  437. if(x >= minx && x <= maxx && y >= miny && y <= maxy) return true;
  438. else return false;
  439. }
  440.  
  441. stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
  442. {
  443. new Float:a;
  444. GetPlayerPos(playerid, x, y, a);
  445. GetPlayerFacingAngle(playerid, a);
  446. if (GetPlayerVehicleID(playerid))
  447. {
  448. GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  449. }
  450. x += (distance * floatsin(-a, degrees));
  451. y += (distance * floatcos(-a, degrees));
  452. }
  453.  
  454. stock GetName(playerid)
  455. {
  456. new name[MAX_PLAYER_NAME];
  457. GetPlayerName(playerid, name, sizeof(name));
  458. return name;
  459. }
  460.  
  461. stock AdminPregled(color, string[])
  462. {
  463. foreach(Player, i)
  464. {
  465. if(IsPlayerAdmin(i))
  466. {
  467. SendClientMessage(i, color, string);
  468. }
  469. }
  470. return 1;
  471. }
  472.  
  473. LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
  474. {
  475. gPlayerUsingLoopingAnim[playerid] = 1;
  476. ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
  477. animation[playerid]++;
  478. }
  479.  
  480. StopLoopingAnim(playerid)
  481. {
  482. gPlayerUsingLoopingAnim[playerid] = 0;
  483. ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
  484. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement