Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2010
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.35 KB | None | 0 0
  1. // Noob Vs Mafias Updated By Kitten
  2.  
  3. #include <a_samp>
  4.  
  5.  
  6. // check teams
  7. static gTeam[MAX_PLAYERS];
  8.  
  9. // teams
  10. #define TEAM_NOOB 0
  11.  
  12. #define TEAM_MAFIA 1
  13.  
  14. // Varaibles
  15. new Noobscore;
  16.  
  17. new Mafiascore;
  18.  
  19. new GameMinutes =9;
  20.  
  21. new GameSeconds =59;
  22.  
  23. new GameTimer;
  24.  
  25. new Text:Textdraw0;
  26.  
  27. new Text:scores;
  28.  
  29. // GM Time
  30. #define MAX_GM_TIME 480000
  31.  
  32. // TEAM COLORS
  33.  
  34. #define TEAM_MAFIA_COLOR 0x77CC77FF
  35.  
  36. #define TEAM_NOOB_COLOR 0x7777DDFF
  37.  
  38. // FORWARDS
  39.  
  40. forward ScoreUpdate();
  41.  
  42. forward ScoreCheck(playerid);
  43.  
  44. forward SetupPlayerForClassSelection(playerid);
  45.  
  46. forward KillUpdate(playerid);
  47.  
  48. forward GameTime();
  49.  
  50.  
  51. stock Noob(playerid)
  52. {
  53. SetPlayerColor(playerid,TEAM_NOOB_COLOR);
  54. }
  55. stock Mafia(playerid)
  56. {
  57. SetPlayerColor(playerid,TEAM_MAFIA_COLOR);
  58. }
  59.  
  60.  
  61.  
  62.  
  63. #if defined FILTERSCRIPT
  64.  
  65. public OnFilterScriptInit()
  66. {
  67. print("\n--------------------------------------");
  68. print(" Blank Filterscript by your name here");
  69. print("--------------------------------------\n");
  70. return 1;
  71. }
  72.  
  73. public OnFilterScriptExit()
  74. {
  75. return 1;
  76. }
  77.  
  78. #else
  79.  
  80. main()
  81. {
  82. print("\n----------------------------------");
  83. print(" Noob VS Mafia Team Deathmatch By KITTEN");
  84. print("----------------------------------\n");
  85. }
  86.  
  87. #endif
  88.  
  89. public OnGameModeInit()
  90. {
  91. // Don't use these lines if it's a filterscript
  92. SetGameModeText("Noob Vs Mafia 1 by Kiten");
  93. AddPlayerClass(153,-783.6561,496.1938,1376.1953,88.7245,24,100,32,1000,35,1); // noobs
  94. AddPlayerClass(120,-831.9264,506.3343,1358.2749,255.1027,24,100,32,1000,35,1); // mafia
  95.  
  96. ShowNameTags(1);
  97. SetWorldTime(0);
  98. UsePlayerPedAnims();
  99. ShowPlayerMarkers(0);
  100. SetTimer("Finsh",600000,true);
  101.  
  102. GameTimer = SetTimer("GameTime",1000,1);
  103.  
  104. SetTimer("KillUpdate", 1000, true);
  105. SetTimer("ScoreUpdate", 1000, true);
  106. SetTimer("ScoreCheck", 1000, true);
  107.  
  108. Textdraw0 = TextDrawCreate(86.000000,427.000000,"9:00");
  109. TextDrawAlignment(Textdraw0,2);
  110. TextDrawBackgroundColor(Textdraw0,0x000000ff);
  111. TextDrawFont(Textdraw0,3);
  112. TextDrawLetterSize(Textdraw0,0.499999,2.000000);
  113. TextDrawColor(Textdraw0,0xffffffff);
  114. TextDrawSetOutline(Textdraw0,1);
  115. TextDrawSetProportional(Textdraw0,1);
  116. TextDrawSetShadow(Textdraw0,1);
  117. return 1;
  118. }
  119.  
  120. public OnGameModeExit()
  121. {
  122. return 1;
  123. }
  124.  
  125. public OnPlayerRequestClass(playerid, classid)
  126. {
  127.  
  128. SetupPlayerForClassSelection(playerid);
  129.  
  130. switch (classid) {
  131.  
  132. case 0:
  133.  
  134. {
  135.  
  136. GameTextForPlayer(playerid, "~r~Noobs", 1200, 3);
  137.  
  138. }
  139.  
  140.  
  141.  
  142. case 1:
  143.  
  144. {
  145.  
  146. GameTextForPlayer(playerid, "~g~ Mafias", 1200, 3);
  147.  
  148. }
  149. }
  150. return 1;
  151. }
  152.  
  153.  
  154. public OnPlayerConnect(playerid)
  155. {
  156. new string[64], pName[MAX_PLAYER_NAME];
  157. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  158. format(string,sizeof string,"%s has joined the [Test Server]!",pName);
  159. SendClientMessageToAll(0xFFFFFFAA,string);
  160. GameTextForPlayer(playerid,"~r~ Weclome choose a team",6000,5);
  161. return 1;
  162. }
  163.  
  164. public SetupPlayerForClassSelection(playerid)
  165. {
  166. SetPlayerInterior(playerid,11);
  167. SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
  168. SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
  169. SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
  170. SetPlayerFacingAngle(playerid,0.0);
  171. }
  172. public OnPlayerSpawn(playerid)
  173. {
  174. if(gTeam[playerid] == TEAM_NOOB)
  175. {
  176. SendClientMessage(playerid,0xFFFFFFAA,"TEAM:Noob: You objective to beat the Mafias to 20 kills first team to win");
  177. GivePlayerWeapon(playerid,29,600);
  178. SetPlayerTeam(playerid,0);
  179. Noob(playerid);
  180. SetPlayerInterior(playerid,1);
  181. TextDrawShowForPlayer(playerid, Textdraw0);
  182. }
  183. else if(gTeam[playerid] == TEAM_MAFIA)
  184. {
  185. SendClientMessage(playerid,0xFFFFFFAA,"TEAM:Mafia: You objective to beat the Noob to 20 kills first team to win");
  186. GivePlayerWeapon(playerid,29,600);
  187. SetPlayerTeam(playerid,0);
  188. SetPlayerInterior(playerid,1);
  189. Mafia(playerid);
  190. TextDrawShowForPlayer(playerid, Textdraw0);
  191. }
  192.  
  193. return 1;
  194. }
  195.  
  196. public OnPlayerDeath(playerid, killerid, reason)
  197. {
  198. if(killerid == TEAM_MAFIA)
  199. {
  200. Mafiascore += 1;
  201. }
  202.  
  203.  
  204. if(killerid == TEAM_NOOB)
  205. {
  206. Noobscore += 1;
  207. }
  208.  
  209. SendDeathMessage(killerid,playerid,reason);
  210. SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
  211. return 1;
  212. }
  213.  
  214. public OnVehicleSpawn(vehicleid)
  215. {
  216. return 1;
  217. }
  218.  
  219.  
  220.  
  221. public ScoreUpdate()
  222. {
  223. new string[100];
  224. TextDrawHideForAll(Text:scores);
  225. format(string,sizeof(string),"~w~Mafia:%d ~w~Noobs:%d", Mafiascore,Noobscore);
  226. scores = TextDrawCreate(271.000000,400.000000,string);
  227. TextDrawTextSize(scores,200.000000,0.000000);
  228. TextDrawSetOutline(scores,1);
  229. TextDrawSetShadow(scores,1);
  230. TextDrawShowForAll(Text:scores);
  231. }
  232.  
  233. public ScoreCheck(playerid)
  234. {
  235. if (Noobscore >= 20) {
  236. Noobscore = 0;
  237. Mafiascore = 0;
  238. GameTextForAll("~g~Noobs has won",6000,5);
  239. SetPlayerHealth(playerid, 0);
  240. SetTimer("Finsh",MAX_GM_TIME,true);
  241. }
  242.  
  243. if (Mafiascore >= 25) {
  244. Noobscore = 0;
  245. Mafiascore = 0;
  246. GameTextForAll("~r~Mafias has won",6000,5);
  247. SetPlayerHealth(playerid, 0);
  248. }
  249. }
  250. forward Finsh();
  251. public Finsh()
  252. {
  253. SendRconCommand("gmx");
  254. return 1;
  255. }
  256. public GameTime()
  257. {
  258. if(GameSeconds || GameMinutes)
  259. {
  260. GameSeconds--;
  261. if(GameSeconds <= -1)
  262. {
  263. GameMinutes--;
  264. GameSeconds=59;
  265. }
  266. new TimeString[14];
  267. format(TimeString,sizeof(TimeString),"%02d:%02d",GameMinutes,GameSeconds);
  268. TextDrawSetString(Textdraw0,TimeString);
  269. }
  270.  
  271. return 1;
  272. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement