Advertisement
Guest User

Infection V4 by Blunt

a guest
Oct 16th, 2014
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.75 KB | None | 0 0
  1. /*
  2. NAME: Infection
  3. DATE: 03/02/2014
  4. AUTHOR: Blunt
  5. DESCRIPTION: Infect a player by hitting them once, once you've hit them they also turn infected.
  6. Once all players have been infected it'll restart.
  7. */
  8.  
  9. #include <a_samp>
  10. #include <zcmd>
  11. #include <streamer>
  12. #include <sscanf2>
  13. #include <foreach>
  14. main(){}
  15.  
  16. #define COLOR_WHITE 0xFFFFFFAA
  17. #define COLOR_FADE 0xC8C8C8C8
  18. #define COLOR_GREY 0xAFAFAFAA
  19. #define COLOR_PURPLE 0xC2A2DAAA
  20. #define COLOR_YELLOW 0xDABB3E00
  21. #define COLOR_BLACK 0x000000AA
  22. #define COLOR_BLUE 0x1E90FFAA
  23. #define COLOR_PINK 0xFF1493AA
  24. #define COLOR_GREEN 0x006400AA
  25. #define COLOR_ORANGE 0xFF4500AA
  26. #define COLOR_RED 0xFF0000AA
  27. #define COLOR_LIGHTRED 0xFF6347AA
  28. #define COLOR_SILVER 0xFF7BDDA5
  29. #define COL_GREY "{AFAFAF}"
  30. #define COL_SILVER "{7BDDA5}"
  31.  
  32. #define TEAM_UNINFECTED 0
  33. #define TEAM_INFECTED 1
  34.  
  35. #define DIALOG_SKINCHANGE 1
  36. #define DIALOG_SKINCHANGE1 2
  37. #define DIALOG_SKINCHANGE2 3
  38. #define DIALOG_SKINCHANGE3 4
  39. #define DIALOG_SKINCHANGE4 5
  40. #define DIALOG_SKINCHANGE5 6
  41. #define DIALOG_SKINCHANGE6 7
  42. #define DIALOG_SKINCHANGE7 8
  43. #define DIALOG_SKINCHANGE8 9
  44. #define DIALOG_SKINCHANGE9 10
  45. #define DIALOG_SKINCHANGE10 11
  46.  
  47. #define ROUND_TIME_LIMIT 20 // DEFAULT IS 20 MINUTES - CHANGE THIS TO YOUR DESIRED TIME LIMIT
  48. #define access_check if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_GREY,"No access.");
  49. #define round_end SetTimer("RoundEndTimer",10000,0), SendClientMessage(playerid,COLOR_WHITE,#Round is restarting in 10 seconds.);
  50. #define restart_round SendClientMessageToAll(COLOR_WHITE,#Round restarting),GameModeExit();
  51. #define check_round_in_progress if(Spawning == false) { spectating[playerid] = true,TogglePlayerSpectating(playerid,getrandomplayer(playerid)),PlayerSpectatePlayer(playerid, 0),SendClientMessage(playerid,COLOR_GREY,#Round is already in progress. Use /nextplayer to change the player your looking at.); return 1;}
  52. #define random_spawninfo new Random = random(sizeof(spawns)); SetSpawnInfo(playerid,TEAM_UNINFECTED,20,spawns[Random][0],spawns[Random][1],spawns[Random][2], spawns[Random][3],0,0,0,0,0,0);
  53. #define is_connected if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREY,"Player not connected");
  54.  
  55. new bool:Spawning,bool:infected[MAX_PLAYERS],bool:Alive[MAX_PLAYERS],bool:spectating[MAX_PLAYERS];
  56. new RandomMSG[][] =
  57. {
  58. "Hacking is not tolerated here! Anyone with s0beit or any hacking software will be detected and automatically banned!",
  59. "The infected have more health than the un-infected! Shoot them in the head to kill them faster!",
  60. "Did you know there are 3 different types of players here? Type /playertypes for more information",
  61. "If you see a player hacking or breaking a rule, use the /report function and report their behaviour!",
  62. "Weapon unlocks are available! The more kills you get the more weapons your able to gain, get killing!"
  63. };
  64. new Float:spawns[][] =
  65. {
  66. {-1131.6823,1094.9792,1345.7899,267.9492},
  67. {-1133.4675,1021.3997,1345.7313,274.5059},
  68. {-1110.4272,1098.9160,1341.8438,182.6493},
  69. {-1108.2216,1021.4601,1343.8809,358.9619},
  70. {-1083.8477,1043.5542,1343.3939,243.7265},
  71. {-1083.8477,1043.5542,1343.3939,243.7265},
  72. {-1066.0980,1070.8135,1341.7379,43.9864},
  73. {-1070.0604,1091.5350,1343.2098,91.5176},
  74. {-1061.9183,1067.0292,1343.5461,292.3194},
  75. {-1050.9037,1052.6886,1341.3516,24.4402},
  76. {-1032.3600,1024.0449,1342.7958,341.1998},
  77. {-1019.3343,1048.4727,1342.8477,221.1195},
  78. {-1027.7264,1064.6705,1343.8444,82.0941},
  79. {-1010.2310,1076.9373,1341.3264,173.3965},
  80. {-974.6269,1089.6309,1344.9760,94.2674},
  81. {-973.0340,1096.1401,1344.9869,91.1106},
  82. {-974.2792,1023.8605,1345.0443,87.3740}
  83. };
  84. stock GetName(playerid)
  85. {
  86. new Name[MAX_PLAYER_NAME];
  87. if(IsPlayerConnected(playerid))
  88. {
  89. GetPlayerName(playerid, Name, sizeof(Name));
  90. }
  91. return Name;
  92. }
  93. stock ClearChat(playerid, lines)
  94. {
  95. for(new i=0; i<lines; i++)
  96. {
  97. SendClientMessage(playerid,COLOR_GREY, " ");
  98. }
  99. return true;
  100. }
  101. stock SendAdminMessage(color,string[])
  102. {
  103. foreach (Player,i)
  104. {
  105. if(IsPlayerAdmin(i))
  106. {
  107. SendClientMessage(i,color,string);
  108. }
  109. }
  110. }
  111. stock CallSkinChange(playerid)
  112. {
  113. SetPlayerInterior(playerid,14);
  114. SetPlayerCameraPos(playerid,254.8034,-41.6176,1002.0234);
  115. SetPlayerCameraLookAt(playerid,259.3129,-41.7034,1002.0234);
  116. SetPlayerPos(playerid,259.3129,-41.7034,1002.0234);
  117. SetPlayerFacingAngle(playerid,91.1132);
  118. SetPlayerSkin(playerid,102);
  119. ShowPlayerDialog(playerid,DIALOG_SKINCHANGE,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}Balla","Confirm","Next");
  120. return 1;
  121. }
  122.  
  123. stock getrandomplayer(playerid)
  124. {
  125. new randomplayer[MAX_PLAYERS+1];
  126. for (new i = 0; i != MAX_PLAYERS; i ++)
  127. {
  128. if (IsPlayerConnected(i))
  129. {
  130. if (i == playerid) continue;
  131. randomplayer[0] ++;
  132. randomplayer[randomplayer[0]] = i;
  133. }
  134. }
  135. if (randomplayer[0] == 0) return -1;
  136. return randomplayer[random(randomplayer[0])+1];
  137. }
  138.  
  139. stock SetWeaponSkillLevel(playerid)
  140. {
  141. SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,200);
  142. SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,200);
  143. SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,200);
  144. }
  145.  
  146. stock GiveWeaponOnScore(playerid)
  147. {
  148. if(GetPlayerTeam(playerid) == TEAM_UNINFECTED)
  149. {
  150. if(GetPlayerScore(playerid) == 5) {GivePlayerWeapon(playerid,24,100);}
  151. if(GetPlayerScore(playerid) == 10) {GivePlayerWeapon(playerid,29,150);}
  152. if(GetPlayerScore(playerid) == 15) {GivePlayerWeapon(playerid,30,100);}
  153. if(GetPlayerScore(playerid) == 30) {GivePlayerWeapon(playerid,34,50);}
  154. if(GetPlayerScore(playerid) == 40) {GivePlayerWeapon(playerid,25,50);}
  155. if(GetPlayerScore(playerid) == 50) {GivePlayerWeapon(playerid,31,200);}
  156. SendClientMessage(playerid,COLOR_WHITE,"NEW WEAPON UNLOCKED");
  157. }
  158. return 1;
  159. }
  160.  
  161. forward public RoundEndTimer(playerid); public RoundEndTimer(playerid){PlayAudioStreamForPlayer(playerid,"http://halo.bungie.org/misc/h3dialogue/multiplayer/game_over.mp3"),restart_round}
  162. forward public SpawnTimer(); public SpawnTimer(){Spawning = false,SendClientMessageToAll(COLOR_WHITE,"All players locked, spawning disabled.");}
  163. forward public RoundTimer(playerid); public RoundTimer(playerid){round_end}
  164. forward SendMSG();
  165. forward public SkinChangeTimer(playerid);
  166.  
  167. public SendMSG()
  168. {
  169. new randMSG = random(sizeof(RandomMSG));
  170. SendClientMessageToAll(COLOR_LIGHTRED, RandomMSG[randMSG]);
  171. }
  172.  
  173. public SkinChangeTimer(playerid)
  174. {
  175. new Random = random(sizeof(spawns));
  176. SetPlayerTeam(playerid,TEAM_UNINFECTED);
  177. SendClientMessage(playerid,COLOR_WHITE, #Survive from the deadly infection.);
  178. SetPlayerPos(playerid, spawns[Random][0],spawns[Random][1],spawns[Random][2]);
  179. SetPlayerFacingAngle(playerid,spawns[Random][3]);
  180. SetPlayerInterior(playerid,10);
  181. SetCameraBehindPlayer(playerid);
  182. GivePlayerWeapon(playerid,22,200);
  183. GivePlayerWeapon(playerid,4,1);
  184. if(IsPlayerAdmin(playerid))
  185. {
  186. SetPlayerAttachedObject(playerid, 0, 18643, 6, 0.237990, 0.017257, 0.061072, 7.122863, 359.407897, 358.406188, 1.000000, 1.000000, 1.000000);
  187. }
  188. }
  189.  
  190. public OnGameModeInit()
  191. {
  192. // 1 SEC = 1000 | 10 SEC = 10000 | 60 SEC = 60000
  193. print("Infection loaded");
  194. SetTimer("SpawnTimer",60000*5,0); // 5 mins
  195. SetTimer("SendMSG", 60000*4, true); // 4 mins
  196. Spawning = true;
  197. return 1;
  198. }
  199.  
  200. public OnGameModeExit()
  201. {
  202. return 1;
  203. }
  204.  
  205. public OnPlayerConnect(playerid)
  206. {
  207. new connectmsg[50];
  208. format(connectmsg,sizeof(connectmsg),#%s has just connected to the server.,GetName(playerid));
  209. SendClientMessageToAll(COLOR_SILVER,connectmsg);
  210. Alive[playerid] = true;
  211. SetWeaponSkillLevel(playerid);
  212. random_spawninfo
  213. return 1;
  214. }
  215.  
  216. public OnPlayerDisconnect(playerid, reason)
  217. {
  218. new disconnectmsg[50];
  219. format(disconnectmsg,sizeof(disconnectmsg),#%s has just disconnected from the server.,GetName(playerid));
  220. SendClientMessageToAll(COLOR_SILVER,disconnectmsg);
  221. return 1;
  222. }
  223.  
  224. public OnPlayerRequestClass(playerid)
  225. {
  226. SpawnPlayer(playerid);
  227. return 1;
  228. }
  229.  
  230. public OnPlayerSpawn(playerid)
  231. {
  232. check_round_in_progress
  233. new nooneinfectedfound = 0;
  234. foreach (Player,i)
  235. {
  236. if(GetPlayerTeam(i) == TEAM_INFECTED)
  237. {
  238. nooneinfectedfound++;
  239. }
  240. }
  241. if(nooneinfectedfound == 0)
  242. {
  243. SetPlayerTeam(getrandomplayer(playerid),TEAM_INFECTED),infected[playerid] = true;
  244. PlayAudioStreamForPlayer(playerid,"http://halo.bungie.org/misc/h3dialogue/multiplayer/infected.mp3");
  245. }
  246. SetPlayerInterior(playerid,10);
  247. if(infected[playerid] == false)
  248. {
  249. SetPlayerInterior(playerid,10);
  250. CallSkinChange(playerid);
  251. }
  252. if(infected[playerid] == true)
  253. {
  254. SetPlayerInterior(playerid,10);
  255. new Random = random(sizeof(spawns));
  256. SetPlayerSkin(playerid, 162);
  257. SetPlayerTeam(playerid,TEAM_INFECTED);
  258. SendClientMessage(playerid,COLOR_WHITE, #Spread the infection!);
  259. SetPlayerPos(playerid, spawns[Random][0],spawns[Random][1],spawns[Random][2]);
  260. SetPlayerFacingAngle(playerid,spawns[Random][3]);
  261. SetPlayerHealth(playerid,120);
  262. }
  263. return 1;
  264. }
  265.  
  266. public OnPlayerDeath(playerid, killerid, reason)
  267. {
  268. Alive[playerid] = false;
  269. SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
  270. GiveWeaponOnScore(killerid);
  271. new alives = 0, string[100];
  272. for (new i = 0 , j = GetMaxPlayers(); i < j ; ++ i)
  273. {
  274. if(!IsPlayerConnected(i)) continue;
  275. if(Alive[i] == false) continue;
  276. alives ++;
  277. }
  278. if (alives == 1)
  279. {
  280. format(string,sizeof(string),"Last man standing %s!",GetName(playerid));
  281. SendClientMessageToAll(COLOR_WHITE,string);
  282. }
  283. new found = 0;
  284. foreach (Player,i)
  285. {
  286. if(GetPlayerTeam(i) == TEAM_UNINFECTED)
  287. {
  288. found++;
  289. }
  290. }
  291. if(found == 0){restart_round}
  292. return 1;
  293. }
  294.  
  295. public OnPlayerUpdate(playerid)
  296. {
  297. if(GetPlayerWeapon(playerid) >= 1 && GetPlayerTeam(playerid) == TEAM_INFECTED) SetPlayerArmedWeapon(playerid, 0);
  298. if(infected[playerid] == true) return SetPlayerColor(playerid,COLOR_GREEN);
  299. if(infected[playerid] == false) return SetPlayerColor(playerid,COLOR_WHITE);
  300. if(spectating[playerid] == true) return SetPlayerColor(playerid,COLOR_GREY);
  301. return 1;
  302. }
  303.  
  304. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
  305. {
  306. if(GetPlayerTeam(playerid) == TEAM_INFECTED)
  307. {
  308. SetPlayerTeam(damagedid,TEAM_INFECTED),SpawnPlayer(damagedid),SendClientMessage(playerid,COLOR_RED,#Infected. Spread the infection to the living.),infected[playerid] = true;
  309. PlayAudioStreamForPlayer(damagedid, "http://halo.bungie.org/misc/h3dialogue/multiplayer/infected.mp3");
  310. }
  311. return 1;
  312. }
  313.  
  314. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
  315. {
  316. new Float:health;
  317. GetPlayerHealth(playerid,health);
  318. if(bodypart == 9) {SetPlayerHealth(playerid, health-40);} // If takes damage to the head region
  319. else{SetPlayerHealth(playerid, health-25);} // If anywhere other than the head region
  320. return 1;
  321. }
  322. //====================================================
  323.  
  324. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  325. {
  326. switch (dialogid)
  327. {
  328. case DIALOG_SKINCHANGE: // Balla
  329. {
  330. switch(response)
  331. {
  332. case 0: { SetPlayerSkin(playerid,103),ShowPlayerDialog(playerid,DIALOG_SKINCHANGE1,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}Balla","Confirm","Next"); }
  333. case 1:
  334. {
  335. SetPlayerSkin(playerid, 102);
  336. SetTimer("SkinChangeTimer",5000,0);
  337. SendClientMessage(playerid,COLOR_WHITE,"Skin selected, please wait");
  338. }
  339. }
  340. }
  341. case DIALOG_SKINCHANGE1: // Balla
  342. {
  343. switch(response)
  344. {
  345. case 0: { SetPlayerSkin(playerid,104),ShowPlayerDialog(playerid,DIALOG_SKINCHANGE2,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}Balla","Confirm","Next"); }
  346. case 1:
  347. {
  348. SetPlayerSkin(playerid, 103);
  349. SetTimer("SkinChangeTimer",5000,0);
  350. SendClientMessage(playerid,COLOR_WHITE,"Skin selected, please wait");
  351. }
  352. }
  353. }
  354. case DIALOG_SKINCHANGE2: // Balla
  355. {
  356. switch(response)
  357. {
  358. case 0: { SetPlayerSkin(playerid,105),ShowPlayerDialog(playerid,DIALOG_SKINCHANGE3,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}Grove","Confirm","Next"); }
  359. case 1:
  360. {
  361. SetPlayerSkin(playerid, 104);
  362. SetTimer("SkinChangeTimer",5000,0);
  363. SendClientMessage(playerid,COLOR_WHITE,"Skin selected, please wait");
  364. }
  365. }
  366. }
  367. case DIALOG_SKINCHANGE3: // Grove
  368. {
  369. switch(response)
  370. {
  371. case 0: { SetPlayerSkin(playerid,106),ShowPlayerDialog(playerid,DIALOG_SKINCHANGE4,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}Grove","Confirm","Next"); }
  372. case 1:
  373. {
  374. SetPlayerSkin(playerid, 105);
  375. SetTimer("SkinChangeTimer",5000,0);
  376. SendClientMessage(playerid,COLOR_WHITE,"Skin selected, please wait");
  377. }
  378. }
  379. }
  380. case DIALOG_SKINCHANGE4: // Grove
  381. {
  382. switch(response)
  383. {
  384. case 0: { SetPlayerSkin(playerid,107),ShowPlayerDialog(playerid,DIALOG_SKINCHANGE5,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}Grove","Confirm","Next"); }
  385. case 1:
  386. {
  387. SetPlayerSkin(playerid, 106);
  388. SetTimer("SkinChangeTimer",5000,0);
  389. SendClientMessage(playerid,COLOR_WHITE,"Skin selected, please wait");
  390. }
  391. }
  392. }
  393. case DIALOG_SKINCHANGE5: // Jethro
  394. {
  395. switch(response)
  396. {
  397. case 0: { SetPlayerSkin(playerid,42),ShowPlayerDialog(playerid,DIALOG_SKINCHANGE6,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}Jethro","Confirm","Next"); }
  398. case 1:
  399. {
  400. SetPlayerSkin(playerid, 107);
  401. SetTimer("SkinChangeTimer",5000,0);
  402. SendClientMessage(playerid,COLOR_WHITE,"Skin selected, please wait");
  403. }
  404. }
  405. }
  406. case DIALOG_SKINCHANGE6: //Mechanic
  407. {
  408. switch(response)
  409. {
  410. case 0: { SetPlayerSkin(playerid,50),ShowPlayerDialog(playerid,DIALOG_SKINCHANGE7,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}Mechanic","Confirm","Next"); }
  411. case 1:
  412. {
  413. SetPlayerSkin(playerid, 42);
  414. SetTimer("SkinChangeTimer",5000,0);
  415. SendClientMessage(playerid,COLOR_WHITE,"Skin selected, please wait");
  416. }
  417. }
  418. }
  419. case DIALOG_SKINCHANGE7: //Civillian
  420. {
  421. switch(response)
  422. {
  423. case 0: { SetPlayerSkin(playerid,14),ShowPlayerDialog(playerid,DIALOG_SKINCHANGE8,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}Civillian","Confirm","Next"); }
  424. case 1:
  425. {
  426. SetPlayerSkin(playerid, 50);
  427. SetTimer("SkinChangeTimer",5000,0);
  428. SendClientMessage(playerid,COLOR_WHITE,"Skin selected, please wait");
  429. }
  430. }
  431. }
  432. case DIALOG_SKINCHANGE8: //San tan Sam
  433. {
  434. switch(response)
  435. {
  436. case 0: { SetPlayerSkin(playerid,18),ShowPlayerDialog(playerid,DIALOG_SKINCHANGE9,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}Sun Tan Sam","Confirm","Next"); }
  437. case 1:
  438. {
  439. SetPlayerSkin(playerid, 14);
  440. SetTimer("SkinChangeTimer",5000,0);
  441. SendClientMessage(playerid,COLOR_WHITE,"Skin selected, please wait");
  442. }
  443. }
  444. }
  445. case DIALOG_SKINCHANGE9: //FBI
  446. {
  447. switch(response)
  448. {
  449. case 0: { SetPlayerSkin(playerid,286),ShowPlayerDialog(playerid,DIALOG_SKINCHANGE10,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}F.B.I Agent","Confirm","Next"); }
  450. case 1:
  451. {
  452. SetPlayerSkin(playerid, 18);
  453. SetTimer("SkinChangeTimer",5000,0);
  454. SendClientMessage(playerid,COLOR_WHITE,"Skin selected, please wait");
  455. }
  456. }
  457. }
  458. case DIALOG_SKINCHANGE10: //RESET
  459. {
  460. switch(response)
  461. {
  462. case 0: { SetPlayerSkin(playerid,102),ShowPlayerDialog(playerid,DIALOG_SKINCHANGE,DIALOG_STYLE_MSGBOX,"CHARACTER SELECTION","Selecting skin; \n{FFFFFF}Balla","Confirm","Next"); }
  463. case 1:
  464. {
  465. SetPlayerSkin(playerid, 286);
  466. SetTimer("SkinChangeTimer",5000,0);
  467. SendClientMessage(playerid,COLOR_WHITE,"Skin selected, please wait");
  468. }
  469. }
  470. }
  471. }
  472. return 1;
  473. }
  474.  
  475. COMMAND:nextplayer(playerid)
  476. {
  477. new string[50];
  478. if(spectating[playerid] == false) return SendClientMessage(playerid,COLOR_GREY,"You are spawned and cannot do this.");
  479. PlayerSpectatePlayer(playerid, getrandomplayer(playerid));
  480. format(string,sizeof(string),"Spectating player: %s", GetName(getrandomplayer(playerid)));
  481. SendClientMessage(playerid,COLOR_GREY,string);
  482. return 1;
  483. }
  484.  
  485. COMMAND:restartround(playerid)
  486. {
  487. access_check
  488. SendClientMessageToAll(COLOR_WHITE,#Round restarting.);
  489. foreach(Player, i)
  490. {
  491. PlayAudioStreamForPlayer(i,"http://halo.bungie.org/misc/h3dialogue/multiplayer/game_over.mp3");
  492. TogglePlayerControllable(i,false);
  493. }
  494. round_end
  495. return 1;
  496. }
  497.  
  498. COMMAND:givemescore(playerid)
  499. {
  500. access_check
  501. SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
  502. return 1;
  503. }
  504.  
  505. COMMAND:infect(playerid,params[])
  506. {
  507. new id;
  508. access_check
  509. if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /infect [playerid/name]");
  510. else
  511. {
  512. is_connected
  513. SendClientMessage(id,COLOR_WHITE,"An Admin has forced infection upon you");
  514. SetPlayerTeam(id,TEAM_INFECTED),SpawnPlayer(id),SendClientMessage(id,COLOR_RED,#Infected. Spread the infection to the living.),infected[playerid] = true,SetPlayerInterior(playerid,10);
  515. }
  516. return 1;
  517. }
  518.  
  519. COMMAND:uninfect(playerid,params[])
  520. {
  521. new id;
  522. access_check
  523. if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /uninfect [playerid/name]");
  524. else
  525. {
  526. is_connected
  527. SendClientMessage(id,COLOR_WHITE,"An Admin has forced you to be un-infected");
  528. SetPlayerTeam(id,TEAM_UNINFECTED),SpawnPlayer(id),SendClientMessage(id,COLOR_RED,#Un-infected.),infected[playerid] = false,SetPlayerInterior(playerid,10);
  529. }
  530. return 1;
  531. }
  532.  
  533. COMMAND:respawn(playerid,params[])
  534. {
  535. new id;
  536. access_check
  537. if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /respawn [playerid/name]");
  538. else
  539. {
  540. is_connected
  541. SendClientMessage(id,COLOR_WHITE,"An Admin has forced respawned you");
  542. SpawnPlayer(id);
  543. }
  544. return 1;
  545. }
  546.  
  547. COMMAND:kill(playerid,params[])
  548. {
  549. new id;
  550. access_check
  551. if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /kill [playerid/name]");
  552. else
  553. {
  554. is_connected
  555. SetPlayerHealth(id,0);
  556. SetPlayerInterior(id,10);
  557. SendClientMessage(id,COLOR_WHITE,"An Admin has force killed you. Transferring you to spectation mode");
  558. }
  559. return 1;
  560. }
  561.  
  562. COMMAND:clearchat(playerid,params[])
  563. {
  564. new amount;
  565. access_check
  566. if(sscanf(params,"i",amount)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /clearchat [amount of lines]");
  567. else
  568. {
  569. foreach (Player,i)
  570. {
  571. ClearChat(i,amount);
  572. }
  573. SendClientMessageToAll(COLOR_WHITE,"Chatbox cleared!");
  574. }
  575. return 1;
  576. }
  577.  
  578. COMMAND:disablespawning(playerid)
  579. {
  580. access_check
  581. Spawning = false;
  582. SendClientMessageToAll(COLOR_WHITE,#Spawning disabled.);
  583. return 1;
  584. }
  585.  
  586. COMMAND:randommsg(playerid)
  587. {
  588. access_check
  589. new randommsg = random(sizeof(RandomMSG));
  590. SendClientMessageToAll(COLOR_LIGHTRED, RandomMSG[randommsg]);
  591. return 1;
  592. }
  593.  
  594. COMMAND:ahelp(playerid)
  595. {
  596. access_check
  597. SendClientMessage(playerid,COLOR_WHITE,"ADMIN COMMAND HELP");
  598. SendClientMessage(playerid,COLOR_GREY,"/restartround /infect /kill /uninfect");
  599. SendClientMessage(playerid,COLOR_GREY,"/disablespawning /clearchat /respawn");
  600. SendClientMessage(playerid,COLOR_GREY,"/randommsg");
  601. return 1;
  602. }
  603.  
  604. COMMAND:help(playerid)
  605. {
  606. SendClientMessage(playerid,COLOR_WHITE,"COMMAND HELP");
  607. SendClientMessage(playerid,COLOR_GREY,"/playertypes /admins /infected");
  608. SendClientMessage(playerid,COLOR_GREY,"/spectators /uninfected /report");
  609. return 1;
  610. }
  611.  
  612. COMMAND:playertypes(playerid)
  613. {
  614. SendClientMessage(playerid,COLOR_WHITE,"PLAYER TYPES KEY");
  615. SendClientMessage(playerid,COLOR_WHITE,"GREEN STANDS FOR {006400}INFECTED");
  616. SendClientMessage(playerid,COLOR_WHITE,"WHITE STANDS FOR {FFFFFF}UN-INFECTED");
  617. SendClientMessage(playerid,COLOR_WHITE,"GREY STANDS FOR {AFAFAF}SPECTATOR(WAITING FOR NEXT ROUND)");
  618. return 1;
  619. }
  620.  
  621. COMMAND:admins(playerid)
  622. {
  623. new string[128];
  624. SendClientMessage(playerid, COLOR_WHITE, "Admins Online:");
  625. new found = 0;
  626. foreach (Player,i)
  627. {
  628. if(IsPlayerAdmin(playerid))
  629. {
  630. format(string,sizeof(string),"%s [ID:%d]",GetName(i),i);
  631. SendClientMessage(playerid,COLOR_GREY,string);
  632. found++;
  633. }
  634. }
  635. if(found == 0)
  636. {
  637. SendClientMessage(playerid, COLOR_FADE, "No admins online.");
  638. }
  639. return 1;
  640. }
  641.  
  642. COMMAND:infected(playerid)
  643. {
  644. new string[128];
  645. SendClientMessage(playerid, COLOR_WHITE, "All Infected:");
  646. new found = 0;
  647. foreach (Player,i)
  648. {
  649. if(infected[playerid] == true)
  650. {
  651. format(string,sizeof(string),"%s",GetName(i));
  652. SendClientMessage(playerid,COLOR_GREEN,string);
  653. found++;
  654. }
  655. }
  656. if(found == 0)
  657. {
  658. SendClientMessage(playerid, COLOR_FADE, "No-one is infected.");
  659. }
  660. return 1;
  661. }
  662.  
  663. COMMAND:uninfected(playerid, params[])
  664. {
  665. new string[128];
  666. SendClientMessage(playerid, COLOR_WHITE, "All Un-Infected:");
  667. new found = 0;
  668. foreach (Player,i)
  669. {
  670. if(infected[playerid] == false)
  671. {
  672. format(string,sizeof(string),"%s",GetName(i));
  673. SendClientMessage(playerid,COLOR_WHITE,string);
  674. found++;
  675. }
  676. }
  677. if(found == 0)
  678. {
  679. SendClientMessage(playerid, COLOR_FADE, "No-one is un-infected.");
  680. }
  681. return 1;
  682. }
  683.  
  684. COMMAND:spectators(playerid)
  685. {
  686. new string[128];
  687. SendClientMessage(playerid, COLOR_WHITE, "Spectators(Waiting for next round):");
  688. new found = 0;
  689. foreach (Player,i)
  690. {
  691. if(spectating[playerid] == true)
  692. {
  693. format(string,sizeof(string),"%s",GetName(i));
  694. SendClientMessage(playerid,COLOR_WHITE,string);
  695. found++;
  696. }
  697. }
  698. if(found == 0)
  699. {
  700. SendClientMessage(playerid, COLOR_FADE, "No-one is waiting for the next round.");
  701. }
  702. return 1;
  703. }
  704.  
  705. COMMAND:report(playerid,params[])
  706. {
  707. new id,reason[100],string[128];
  708. if(sscanf(params,"us[100]",id,reason)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /report [playerid/name] [reason]");
  709. else
  710. {
  711. is_connected
  712. format(string,sizeof(string),"REPORT:{FFFFFF}%s[ID:%d] has reported %s[ID:%d] for %s",GetName(playerid),playerid,GetName(id),id,reason);
  713. SendAdminMessage(COLOR_ORANGE,string);
  714. }
  715. return 1;
  716. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement