Advertisement
Guest User

GM Zumbie MOD

a guest
Sep 24th, 2011
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.88 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3.  
  4.  
  5. #define Round_MaxTime 360000
  6. #define TEAM_HUMAN 0
  7. #define TEAM_ZOMBIE 1
  8. #define COLOR_HUMAN 0x6495EDAA
  9. #define COLOR_ZOMBIE 0xFF0000AA
  10. #define WEAPON1_HUMAN 24
  11. #define WEAPON2_HUMAN 25
  12. #define WEAPON3_HUMAN 31
  13. #define WEAPON1_ZOMBIE 4
  14. #define WEAPON2_ZOMBIE 15
  15. #define WEAPON3_ZOMBIE 41
  16. #define COLOR_RED 0xFF0000AA
  17. #define COLOR_BLUE 0x0000FFAA
  18. #define COLOR_YELLOW 0xFFFF00AA
  19. #define COLOR_GREEN 0x66CC99AA
  20.  
  21.  
  22.  
  23. enum aInfo
  24. {
  25. HumansCount,
  26. ZombiesCount,
  27. HumansKills,
  28. ZombiesKills,
  29. ID
  30. };
  31. enum pInfo
  32. {
  33. TotalCount,
  34. Team
  35. };
  36.  
  37.  
  38.  
  39. new Arena[aInfo];
  40. new PlayerCount;
  41. new PlayerTeam[MAX_PLAYERS];
  42. new Text[256];
  43. new Float:OldHP[MAX_PLAYERS];
  44.  
  45.  
  46.  
  47. forward AnnounceWinner();
  48. forward ChangeRound();
  49. forward OnPlayerUpdate(playerid);
  50.  
  51.  
  52.  
  53. main()
  54. {
  55. print("|||||||||||||||||||||||||||||||||||||||||||||||||||||||");
  56. print("| ZOMBIEMOD - G0D4V1D & GhOsT |");
  57. print("| EDITOR - JUNIOR_FUSION |");
  58. print("| Provavelmeente você nunca viu um Gamemode como este |");
  59. print("| Aproveite esse ótimo gamemode de Zumbis |");
  60. print("|||||||||||||||||||||||||||||||||||||||||||||||||||||||");
  61. }
  62.  
  63.  
  64.  
  65. stock HumanTeam(playerid)
  66. {
  67. SendClientMessage(playerid,COLOR_HUMAN,"Salve a sociedade!");
  68. GivePlayerWeapon(playerid,WEAPON1_HUMAN,9999);
  69. GivePlayerWeapon(playerid,WEAPON2_HUMAN,9999);
  70. GivePlayerWeapon(playerid,WEAPON3_HUMAN,9999);
  71. SetPlayerColor(playerid,COLOR_HUMAN);
  72. SetPlayerTeam(playerid,0);
  73. SetPlayerArmour(playerid,100);
  74. SetPlayerSkin(playerid,288);
  75. }
  76.  
  77.  
  78.  
  79. stock ZombieTeam(playerid)
  80. {
  81. ResetPlayerWeapons(playerid);
  82. SetPlayerArmour(playerid,0);
  83. SetPlayerSkin(playerid,78);
  84. SendClientMessage(playerid,COLOR_ZOMBIE,"Coma alguns cérebros!");
  85. GivePlayerWeapon(playerid,WEAPON1_ZOMBIE,9999);
  86. GivePlayerWeapon(playerid,WEAPON2_ZOMBIE,9999);
  87. GivePlayerWeapon(playerid,WEAPON3_ZOMBIE,9999);
  88. SetPlayerColor(playerid,COLOR_ZOMBIE);
  89. SetPlayerTeam(playerid,1);
  90. SetPlayerHealth(playerid,450);
  91. TogglePlayerControllable(playerid,1);
  92. }
  93.  
  94.  
  95.  
  96. public OnGameModeInit()
  97. {
  98. AddPlayerClass(288,0.0,0.0,5.0,0.0,0,0,0,0,0,0);
  99. AddPlayerClass(78,0.0,0.0,5.0,0.0,0,0,0,0,0,0);
  100. SendRconCommand("hostname Brasil Mundo dos Zombies");
  101. SetGameModeText("BR ZOMBIE v1.0");
  102. SendRconCommand("mapname Mundo dos Zumbies");
  103. SetWorldTime(0);
  104. SetNameTagDrawDistance(5);
  105. SetTeamCount(2);
  106. ShowNameTags(0);
  107. ShowPlayerMarkers(0);
  108. UsePlayerPedAnims();
  109. AllowInteriorWeapons(1);
  110. DisableInteriorEnterExits();
  111. Arena[ID] = 0;
  112. SetTimer("AnnounceWinner",360000,1);
  113. return 1;
  114. }
  115.  
  116.  
  117.  
  118. public OnPlayerConnect(playerid)
  119. {
  120. SendClientMessage(playerid,COLOR_YELLOW,"Bem vindo ao: Brasil Mundo dos Zumbies!!");
  121. SendClientMessage(playerid,COLOR_YELLOW,"Digite /aprender para alguma ajuda.");
  122. SendClientMessage(playerid,COLOR_RED,"Criadores: Davidovich & GhOsT.");
  123. SendClientMessage(playerid,COLOR_HUMAN,"Editores da nova versão: Junior_FusioN");
  124. PlayerCount ++;
  125. return 1;
  126. }
  127.  
  128.  
  129.  
  130. public OnPlayerDisconnect(playerid)
  131. {
  132. PlayerCount --;
  133. return 1;
  134. }
  135.  
  136.  
  137.  
  138. public OnPlayerSpawn(playerid)
  139. {
  140. if(PlayerTeam[playerid] == 0)
  141. {
  142. HumanTeam(playerid);
  143. SetPlayerTeam(playerid,0);
  144. }
  145. else if(PlayerTeam[playerid] == 1)
  146. {
  147. ZombieTeam(playerid);
  148. SetPlayerTeam(playerid,1);
  149. }
  150. switch(Arena[ID])
  151. {
  152. case 0:
  153. {
  154. if(PlayerTeam[playerid] == 0)
  155. {
  156. SetPlayerPos(playerid,1300.0236,-790.1140,1084.0078);
  157. SetPlayerFacingAngle(playerid,0.3154);
  158. SetPlayerInterior(playerid,5);
  159. }
  160. if(PlayerTeam[playerid] == 1)
  161. {
  162. SetPlayerPos(playerid,1266.4395,-780.0988,1091.9063);
  163. SetPlayerFacingAngle(playerid,269.7846);
  164. SetPlayerInterior(playerid,5);
  165. }
  166. }
  167. case 1:
  168. {
  169. if(PlayerTeam[playerid] == 0)
  170. {
  171. SetPlayerPos(playerid,2220.3972,-1151.4685,1025.7969);
  172. SetPlayerFacingAngle(playerid,269.3734);
  173. SetPlayerInterior(playerid,15);
  174. }
  175. if(PlayerTeam[playerid] == 1)
  176. {
  177. SetPlayerPos(playerid,2193.5583,-1141.1141,1029.7969);
  178. SetPlayerFacingAngle(playerid,178.7957);
  179. SetPlayerInterior(playerid,15);
  180. }
  181. }
  182. case 2:
  183. {
  184. if(PlayerTeam[playerid] == 0)
  185. {
  186. SetPlayerPos(playerid,2346.9094,-1172.8066,1031.9766);
  187. SetPlayerFacingAngle(playerid,85.3327);
  188. SetPlayerInterior(playerid,5);
  189. }
  190. if(PlayerTeam[playerid] == 1)
  191. {
  192. SetPlayerPos(playerid,2349.6428,-1181.0731,1027.9766);
  193. SetPlayerFacingAngle(playerid,87.8066);
  194. SetPlayerInterior(playerid,5);
  195. }
  196. }
  197. case 3:
  198. {
  199. if(PlayerTeam[playerid] == 0)
  200. {
  201. SetPlayerPos(playerid,366.8517,215.5397,1008.3828);
  202. SetPlayerFacingAngle(playerid,178.3608);
  203. SetPlayerInterior(playerid,3);
  204. }
  205. if(PlayerTeam[playerid] == 1)
  206. {
  207. SetPlayerPos(playerid,348.3492,162.2359,1025.7891);
  208. SetPlayerFacingAngle(playerid,269.5417);
  209. SetPlayerInterior(playerid,3);
  210. }
  211. }
  212. }
  213. return 1;
  214. }
  215.  
  216.  
  217.  
  218. public OnPlayerDeath(playerid)
  219. {
  220. if(PlayerTeam[playerid] == 0)
  221. {
  222. Arena[ZombiesKills] ++;
  223. }
  224. else if(PlayerTeam[playerid] == 1)
  225. {
  226. Arena[HumansKills] ++;
  227. }
  228. switch(Arena[ZombiesKills])
  229. {
  230. case 5: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 5");
  231. case 10: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 10");
  232. case 15: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 15");
  233. case 20: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 20");
  234. case 25: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 25");
  235. case 30: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 30");
  236. case 35: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 35");
  237. case 40: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 40");
  238. case 45: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 45");
  239. case 50:
  240. {
  241. SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 50");
  242. AnnounceWinner();
  243. }
  244. }
  245. switch(Arena[HumansKills])
  246. {
  247. case 5: SendClientMessageToAll(COLOR_BLUE,"SCORE - TIME HUMANOS:: 5");
  248. case 10: SendClientMessageToAll(COLOR_BLUE,"SCORE - TIME HUMANOS:: 10");
  249. case 15: SendClientMessageToAll(COLOR_BLUE,"SCORE - TIME HUMANOS:: 15");
  250. case 20: SendClientMessageToAll(COLOR_BLUE,"SCORE - TIME HUMANOS:: 20");
  251. case 25: SendClientMessageToAll(COLOR_BLUE,"SCORE - TIME HUMANOS:: 25");
  252. case 30: SendClientMessageToAll(COLOR_BLUE,"SCORE - TIME HUMANOS:: 30");
  253. case 35: SendClientMessageToAll(COLOR_BLUE,"SCORE - TIME HUMANOS:: 35");
  254. case 40: SendClientMessageToAll(COLOR_BLUE,"SCORE - TIME HUMANOS:: 40");
  255. case 45: SendClientMessageToAll(COLOR_BLUE,"SCORE - TIME HUMANOS:: 45");
  256. case 50:
  257. {
  258. SendClientMessageToAll(COLOR_BLUE,"SCORE - TIME HUMANOS:: 50");
  259. AnnounceWinner();
  260. }
  261. }
  262. return 1;
  263. }
  264.  
  265.  
  266.  
  267. public OnPlayerRequestClass(playerid,classid)
  268. {
  269. SetPlayerPos(playerid,299.9177,2741.7598,42.9127);
  270. SetPlayerFacingAngle(playerid,198.9686);
  271. SetPlayerCameraPos(playerid,306.3498,2727.6697,37.0493);
  272. SetPlayerCameraLookAt(playerid,299.9177,2741.7598,42.9127);
  273. if(classid == 0)
  274. {
  275. PlayerTeam[playerid] = 0;
  276. SetPlayerTeam(playerid,0);
  277. }
  278. else if(classid == 1)
  279. {
  280. PlayerTeam[playerid] = 1;
  281. SetPlayerTeam(playerid,1);
  282. }
  283. return 1;
  284. }
  285.  
  286.  
  287.  
  288. public AnnounceWinner()
  289. {
  290. if(Arena[ZombiesKills] > Arena[HumansKills])
  291. {
  292. GameTextForAll("~r~ZOMBIES~w~ VENCERAM~y~ ]]",3000,5);
  293. format(Text,256,"Humanos infectados: %d | Zumbis mortos: %d",
  294. Arena[ZombiesKills],Arena[HumansKills]);
  295. SendClientMessageToAll(COLOR_YELLOW,Text);
  296. }
  297. if(Arena[ZombiesKills] < Arena[HumansKills])
  298. {
  299. GameTextForAll("~b~HUMANS~w~ VENCERAM~y~ ]]",3000,5);
  300. format(Text,256,"Zumbis mortos: %d | Humanos infeectados: %d",
  301. Arena[HumansKills],Arena[ZombiesKills]);
  302. SendClientMessageToAll(COLOR_YELLOW,Text);
  303. }
  304. if(Arena[ZombiesKills] == Arena[HumansKills])
  305. {
  306. GameTextForAll("~y~ EMPATE",3000,5);
  307. format(Text,256,"Os dois times tiveram %d perdas.",
  308. Arena[ZombiesKills]);
  309. SendClientMessageToAll(COLOR_YELLOW,Text);
  310. }
  311. Arena[ID] ++;
  312. SetTimer("ChangeRound",10000,0);
  313. SendClientMessageToAll(COLOR_RED,"Espere 10 segundos até o próximo round começar!");
  314. for(new i = 0; i < MAX_PLAYERS; i++)
  315. {
  316. SetPlayerCameraPos(i,-1438.0342,1751.5375,45.6543);
  317. SetPlayerCameraLookAt(i,-1736.0754,1132.5067,45.6543);
  318. SetPlayerInterior(i,0);
  319. }
  320. return 1;
  321. }
  322.  
  323.  
  324.  
  325. public ChangeRound()
  326. {
  327. Arena[ZombiesKills] = 0;
  328. Arena[HumansKills] = 0;
  329. for(new i = 0; i < MAX_PLAYERS; i++)
  330. {
  331. SpawnPlayer(i);
  332. switch(Arena[ID])
  333. {
  334. case 0:
  335. {
  336. SetPlayerInterior(i,5);
  337. }
  338. case 1:
  339. {
  340. SetPlayerInterior(i,15);
  341. }
  342. case 2:
  343. {
  344. SetPlayerInterior(i,5);
  345. }
  346. case 3:
  347. {
  348. SetPlayerInterior(i,3);
  349. Arena[ID] = 0;
  350. }
  351. }
  352. }
  353. return 1;
  354. }
  355.  
  356.  
  357.  
  358. public OnPlayerUpdate(playerid)
  359. {
  360. new Float:NewHP;
  361. GetPlayerArmour(playerid,NewHP);
  362. if(NewHP < OldHP[playerid])
  363. {
  364. new Skin = GetPlayerSkin(playerid);
  365. if(Skin == 285)
  366. {
  367. ZombieTeam(playerid);
  368. Arena[ZombiesKills] ++;
  369. switch(Arena[ZombiesKills])
  370. {
  371. case 5: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 5");
  372. case 10: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 10");
  373. case 15: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 15");
  374. case 20: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 20");
  375. case 25: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 25");
  376. case 30: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 30");
  377. case 35: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 35");
  378. case 40: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 40");
  379. case 45: SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 45");
  380. case 50:
  381. {
  382. SendClientMessageToAll(COLOR_RED,"SCORE - TIME ZUMBIS: 50");
  383. AnnounceWinner();
  384. }
  385. }
  386. }
  387. }
  388. OldHP[playerid] = NewHP;
  389. return 1;
  390. }
  391.  
  392.  
  393.  
  394. public OnPlayerCommandText(playerid,cmdtext[])
  395. {
  396. if(strcmp(cmdtext,"/aprender",true)==0)
  397. {
  398. SendClientMessage(playerid,COLOR_YELLOW,"Esse é um gamemode baseado em Humanos VS Zumbis.");
  399. SendClientMessage(playerid,COLOR_YELLOW,"Zumbis devem esfaquear humanos para infectá-los.");
  400. SendClientMessage(playerid,COLOR_YELLOW,"Humanos devem fugir e tentar matar os Zumbis.");
  401. SendClientMessage(playerid,COLOR_RED,"[AVISO]Zumbis tem 450 de HP, não 100!");
  402. SendClientMessage(playerid,COLOR_GREEN,"Gamemode trago até você por Junior_FusioN");
  403. return 1;
  404. }
  405. SendClientMessage(playerid,COLOR_RED,"[ERRO]: Comandos incorreto!");
  406. return 0;
  407. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement