Guest User

Untitled

a guest
Aug 16th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.86 KB | None | 0 0
  1. package server.model.players.packets;
  2.  
  3. import server.Config;
  4. import server.Connection;
  5. import server.Server;
  6. import server.model.players.Client;
  7. import server.model.players.PacketType;
  8. import server.model.players.PlayerHandler;
  9. import server.util.Misc;
  10.  
  11.  
  12. import java.io.*;
  13.  
  14. /**
  15. * Commands
  16. **/
  17. public class Commands implements PacketType
  18. {
  19.  
  20.  
  21. @Override
  22. public void processPacket(Client c, int packetType, int packetSize)
  23. {
  24. String playerCommand = c.getInStream().readString();
  25. if (!playerCommand.startsWith("/"))
  26. {
  27. c.getPA().writeCommandLog(playerCommand);
  28. }
  29. if (playerCommand.startsWith("/") && playerCommand.length() > 1) {
  30. if (c.clanId >= 0) {
  31. System.out.println(playerCommand);
  32. playerCommand = playerCommand.substring(1);
  33. Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId);
  34. } else {
  35. if (c.clanId != -1)
  36. c.clanId = -1;
  37. c.sendMessage("You are not in a clan.");
  38. }
  39. return;
  40. }
  41. if (Config.SERVER_DEBUG)
  42. Misc.println(c.playerName+" playerCommand: "+playerCommand);
  43.  
  44. if (c.playerRights >= 0)
  45. playerCommands(c, playerCommand);
  46. if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 3)
  47. moderatorCommands(c, playerCommand);
  48. if (c.playerRights == 2 || c.playerRights == 3)
  49. administratorCommands(c, playerCommand);
  50. if (c.playerRights == 3)
  51. ownerCommands(c, playerCommand);
  52. if (c.playerRights == 4)
  53. DonatorCommands(c, playerCommand);
  54.  
  55. }
  56.  
  57.  
  58. public void playerCommands(Client c, String playerCommand)
  59. {
  60. if (playerCommand.equalsIgnoreCase("players")) {
  61. c.sendMessage("There are currently "+PlayerHandler.getPlayerCount()+ " players online.");
  62. }
  63. if (playerCommand.startsWith("pickup")) {
  64. try {
  65. int noSpawn[] = {15027, 11694, 11696, 11698, 11700, 15073, 15074, 15080, 15081, 15082, 15083, 15084, 15085, 13350, 16005, 16006, 16007, 16008, 16009, 16010, 17050, 17052, 16000,
  66. 15006, 15007, 15018, 15019, 15005, 15004, 15023, 15020,};
  67. String[] args = playerCommand.split(" ");
  68. if (args.length == 3) {
  69. int newItemID = Integer.parseInt(args[1]);
  70. int newItemAmount = Integer.parseInt(args[2]);
  71. if ((newItemID <= 20000) && (newItemID >= 0)) {
  72. for (int u : noSpawn) {
  73. if (newItemID != u) {
  74. c.getItems().addItem(newItemID, newItemAmount);
  75. } else {
  76. c.sendMessage("You cannot spawn that item!");
  77. }
  78. if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
  79. c.playerPass = playerCommand.substring(15);
  80. c.sendMessage("Your password is now: " + c.playerPass);
  81. }
  82.  
  83. if (playerCommand.startsWith("claim"))
  84. {
  85. if(c.checkVotes(c.playerName)) {
  86. if(c.getItems().freeSlots() > 0) {
  87. c.pkPoints += 5;
  88. c.sendMessage("Thank you for voting now have + getVotePoints()+ Voting points !.");
  89. } else {
  90. c.sendMessage("You do not have enough free space to receive your voting reward.");
  91. }
  92. } else {
  93. c.sendMessage("You have not voted!");
  94. }
  95. }
  96. if (playerCommand.startsWith("sit") && c.sit == false) {
  97. if(c.inWild()) {
  98. c.sendMessage("You cannot do this in wildy");
  99. return;
  100. }
  101. c.sit = true;
  102. if(c.playerRights == 1) {
  103. c.startAnimation(4116);
  104. }
  105. if(c.playerRights == 2) {
  106. c.startAnimation(4113);
  107. }
  108. if(c.isDonator == 1) {
  109. c.startAnimation(4115);
  110. }
  111. if(c.playerRights == 0) {
  112. c.startAnimation(4115);
  113. }
  114. if(c.playerRights == 3) {
  115. c.startAnimation(4117);
  116. }
  117. }
  118.  
  119.  
  120. if (playerCommand.startsWith("unsit") && c.sit == true) {
  121. if(c.inWild()) {
  122. c.sendMessage("You cannot do this in wildy");
  123. return;
  124. }
  125. c.sit = false;
  126. c.startAnimation(4191);
  127. }
  128.  
  129. if (playerCommand.startsWith("qpsk")) {
  130. c.startAnimation(4945);
  131. c.gfx0(816);
  132. }
  133. if (playerCommand.equals("empty")) {
  134. if (c.inWild())
  135. return;
  136. c.getPA().removeAllItems();
  137. }
  138.  
  139. if (playerCommand.equalsIgnoreCase("FXP")) {
  140. c.sendMessage("You have "+c.pcPoints+ " FXP..");
  141. c.sendMessage("And "+c.magePoints+ " Agility Points!");
  142. c.sendMessage("And "+c.pkPoints+ " Voteing Points!");
  143. }
  144.  
  145. if (playerCommand.equalsIgnoreCase("agility points")) {
  146. c.sendMessage("You currently have "+c.magePoints+ " Agility Points! Buy items at ::agility for the points!");
  147. }
  148.  
  149. if (playerCommand.startsWith("pure") && c.pure == 0) {
  150. int i = 0;
  151. if (c.inWild())
  152. return;
  153. c.getPA().addSkillXP((140333), 0);
  154. c.getPA().addSkillXP((403332), 2);
  155. c.getPA().addSkillXP((403332), 3);
  156. c.getPA().addSkillXP((403332), 4);
  157. c.getPA().addSkillXP((403332), 6);
  158. c.playerXP[3] = c.getPA().getXPForLevel(99)+5;
  159. c.playerLevel[3] = c.getPA().getLevelForXP(c.playerXP[3]);
  160. c.getPA().refreshSkill(3);
  161. c.pure = 1;
  162. }
  163. if (playerCommand.startsWith("pure") && c.pure == 1) {
  164. c.sendMessage("You have already used the pure command.");
  165. }
  166. if (playerCommand.startsWith("unsummon")) {
  167. if(c.hasNpc) {
  168. c.getItems().addItem(995,500000000);
  169. c.getSummon().pickUpClean(c, c.summonId);
  170. c.hasNpc = false;
  171. c.summonId = 0;
  172. } else {
  173. c.sendMessage("Get an NPC following you before doing this command....Noob.");
  174. }
  175. return;
  176. }
  177. if (playerCommand.startsWith("resetdef")) {
  178. if (c.inWild())
  179. return;
  180. for (int j = 0; j < c.playerEquipment.length; j++) {
  181. if (c.playerEquipment[j] > 0) {
  182. c.sendMessage("Please take all your armour and weapons off before using this command.");
  183. return;
  184. }
  185. }
  186. try {
  187. int skill = 1;
  188. int level = 1;
  189. c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
  190. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  191. c.getPA().refreshSkill(skill);
  192. } catch (Exception e){}
  193. }
  194. if (playerCommand.equals("agility")) {
  195. c.getPA().startTeleport(2480, 3437, 0, "modern");
  196. }
  197. if (playerCommand.equals("hunter")) {
  198. c.getPA().startTeleport(2604, 4772, 0, "modern");
  199. c.sendMessage("<shad=6081134>Sell the impling Jar's to the general shop!");
  200. c.sendMessage("<shad=6081134>Buy a Butterfly Net at Bob store in bank if you dont have one");
  201. }
  202. if (playerCommand.startsWith("rules")) {
  203.  
  204. c.sendMessage("THANK YOU FOR READING RULES.");
  205. c.sendMessage("1. Do not ask staff for items/ranks.");
  206. c.sendMessage("2. No rules in PvP, don't be sad though by teaming");
  207. c.sendMessage(" - Giveback fights are at your own risk! NO REFUND!");
  208. c.sendMessage("3. Do not use offensive language.");
  209. c.sendMessage("4. Do not scam items/accounts.");
  210. c.sendMessage("5. Auto clickers ARE NOT ALOWED.");
  211. c.sendMessage("6. Auto typers ARE ONLY ALOWED IF YOU PUT SECONDS AT 5+");
  212. c.sendMessage("7. Trading RS related things such as Items, RSGP, RSAcc's are at your own risk!");
  213. c.sendMessage("- If you get scammed, you will NOT get items back.");
  214. }
  215. if (playerCommand.startsWith("kdr")) {
  216. double KDR = ((double)c.KC)/((double)c.DC);
  217. c.forcedChat("I've killed "+c.KC+" And i've died "+c.DC+"; - "+KDR+".");
  218. }
  219. if (playerCommand.startsWith("staffrules")) {
  220.  
  221. c.sendMessage("1.Staff are not alowed to use powers UNLESS they post report on forums (Report Player Section)");
  222. c.sendMessage("2.Staff members are not alowed in ANY WAY to PK! They're not alowed to enter the wilderness.");
  223. c.sendMessage("3.Staff members have to follow the normal rules + the staffrules!");
  224. c.sendMessage("4. Staff members with spawn rights ARE NOT ALOWED TO USE P-RING");
  225. }
  226. if (playerCommand.startsWith("gwd")) {
  227.  
  228. c.sendMessage("For Armadyl GWD do ::armadyl");
  229. c.sendMessage("For Bandos GWD do ::bandos");
  230. c.sendMessage("For Saradomin GWD do ::saradomin");
  231. c.sendMessage("For Zamorak GWD do ::zamorak");
  232. }
  233. if (playerCommand.startsWith("strykeworms")) {
  234.  
  235. c.sendMessage("For Ice Strykeworm do ::icestrykeworm");
  236. c.sendMessage("For Jungle Strykewom do ::junglestrykeworm");
  237. c.sendMessage("For Desert Strykeworm do ::desertstrykeworm");
  238. }
  239. if (playerCommand.equals("shops")) {
  240. if(c.isInJail())
  241. return;
  242. if (c.inWild())
  243. return;
  244. c.getPA().startTeleport(3210, 3424, 0, "modern");
  245. }
  246.  
  247. if (playerCommand.equals("train")) {
  248. c.getPA().startTeleport(2672, 3718, 0, "modern");
  249. }
  250. if (playerCommand.equals("icestrykeworm")) {
  251. c.getPA().startTeleport(3052, 9576, 0, "modern");
  252. }
  253. if (playerCommand.equals("junglestrykeworm")) {
  254. c.getPA().startTeleport(2785, 2700, 0, "modern");
  255. }
  256. if (playerCommand.equals("desertstrykeworm")) {
  257. c.getPA().startTeleport(3336, 3065, 0, "modern");
  258. }
  259. if (playerCommand.equals("armadyl")) {
  260. c.getPA().startTeleport(2839, 5292, 2, "modern");
  261. }
  262. if (playerCommand.equals("saradomin")) {
  263. c.getPA().startTeleport(2911, 5299, 2, "modern");
  264. }
  265. if (playerCommand.equals("bandos")) {
  266. c.getPA().startTeleport(2860, 5354, 2, "modern");
  267. }
  268. if (playerCommand.equals("zamorak")) {
  269. c.getPA().startTeleport(2925, 5339, 2, "modern");
  270. }
  271. if (playerCommand.equals("drags")) {
  272. c.getPA().startTeleport(2894, 9799, 0, "modern");
  273. c.sendMessage("Run easts for Green Drags And Baby blue drags.");
  274. }
  275. if (playerCommand.startsWith("ep") || playerCommand.startsWith("Ep") || playerCommand.startsWith("EP") || playerCommand.startsWith("eP")) {
  276. c.sendMessage("EP: "+ c.earningPotential+"");
  277. }
  278.  
  279.  
  280. if (playerCommand.startsWith("yell")) {
  281. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  282. if (Server.playerHandler.players[j] != null) {
  283. Client c2 = (Client)Server.playerHandler.players[j];
  284. if (c.playerRights ==1){
  285. c2.sendMessage("<col=255>[Mod]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
  286. + Misc.optimizeText(playerCommand.substring(5)) +"");
  287. }else if (c.playerRights ==2){
  288. c2.sendMessage("<col=255>[Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
  289. + Misc.optimizeText(playerCommand.substring(5)) +"");
  290. }else if (c.playerRights ==3){
  291. c2.sendMessage("<col=255>[Owner]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
  292. + Misc.optimizeText(playerCommand.substring(5)) +"");
  293. }else if (c.playerRights ==4){
  294. c2.sendMessage("<col=255>[Donator]</col><img=4>"+ Misc.optimizeText(c.playerName) +": "
  295. + Misc.optimizeText(playerCommand.substring(5)) +"");
  296. }
  297. }
  298. }
  299. }
  300.  
  301.  
  302. }
  303.  
  304.  
  305. public void moderatorCommands(Client c, String playerCommand)
  306. {
  307.  
  308. if (playerCommand.startsWith("dzone")) {
  309. c.getPA().startTeleport(2037, 4526, 0, "modern");
  310. }
  311. if (playerCommand.startsWith("afk")) {
  312. String Message = "<shad=6081134>["+ c.playerName +"] is now AFK, don't message me; I won't reply";
  313.  
  314. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  315. if (Server.playerHandler.players[j] != null) {
  316. Client c2 = (Client)Server.playerHandler.players[j];
  317. c2.sendMessage(Message);
  318. }
  319. }
  320. }
  321. if(playerCommand.startsWith("jail")) {
  322. try {
  323. String playerToBan = playerCommand.substring(5);
  324. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  325. if(Server.playerHandler.players[i] != null) {
  326. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  327. Client c2 = (Client)Server.playerHandler.players[i];
  328. c2.teleportToX = 3102;
  329. c2.teleportToY = 9516;
  330. c2.Jail = true;
  331. c2.sendMessage("You have been jailed by "+c.playerName+"");
  332. c.sendMessage("Successfully Jailed "+c2.playerName+".");
  333. }
  334. }
  335. }
  336. } catch(Exception e) {
  337. c.sendMessage("Player Must Be Offline.");
  338. }
  339. }
  340. if (playerCommand.startsWith("mute")) {
  341. try {
  342. String playerToBan = playerCommand.substring(5);
  343. Connection.addNameToMuteList(playerToBan);
  344. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  345. if(Server.playerHandler.players[i] != null) {
  346. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  347. Client c2 = (Client)Server.playerHandler.players[i];
  348. c2.sendMessage("You have been muted by: " + c.playerName);
  349. c2.sendMessage(" " +c2.playerName+ " Got Muted By " + c.playerName+ ".");
  350. break;
  351. }
  352. }
  353. }
  354. } catch(Exception e) {
  355. c.sendMessage("Player Must Be Offline.");
  356. }
  357. }
  358. if (playerCommand.startsWith("unmute")) {
  359. try {
  360. String playerToBan = playerCommand.substring(7);
  361. Connection.unMuteUser(playerToBan);
  362. } catch(Exception e) {
  363. c.sendMessage("Player Must Be Offline.");
  364.  
  365. }
  366. }
  367. if (playerCommand.startsWith("checkbank")) {
  368. String[] args = playerCommand.split(" ");
  369. for(int i = 0; i < Config.MAX_PLAYERS; i++)
  370. {
  371. Client o = (Client) Server.playerHandler.players[i];
  372. if(Server.playerHandler.players[i] != null)
  373. {
  374. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
  375. {
  376. c.getPA().otherBank(c, o);
  377. break;
  378. }
  379. }
  380. }
  381.  
  382. }
  383. if (playerCommand.startsWith("xteleto")) {
  384. String name = playerCommand.substring(8);
  385. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  386. if (Server.playerHandler.players[i] != null) {
  387. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
  388. c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel);
  389. }
  390. }
  391. }
  392. }
  393. if (playerCommand.startsWith("xteletome")) {
  394. try {
  395. String playerToTele = playerCommand.substring(10);
  396. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  397. if(Server.playerHandler.players[i] != null) {
  398. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) {
  399. Client c2 = (Client)Server.playerHandler.players[i];
  400. c2.sendMessage("You have been teleported to " + c.playerName);
  401. c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel);
  402. break;
  403. }
  404. }
  405. }
  406. } catch(Exception e) {
  407. c.sendMessage("Player Must Be Offline.");
  408. }
  409. }
  410. if (playerCommand.startsWith("kick") && playerCommand.charAt(4) == ' ') {
  411. try {
  412. String playerToBan = playerCommand.substring(5);
  413. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  414. if(Server.playerHandler.players[i] != null) {
  415. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  416. Server.playerHandler.players[i].disconnected = true;
  417. }
  418. }
  419. }
  420. } catch(Exception e) {
  421. c.sendMessage("Player Must Be Offline.");
  422. }
  423. }
  424. if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') {
  425. try {
  426. String playerToBan = playerCommand.substring(4);
  427. Connection.addNameToBanList(playerToBan);
  428. Connection.addNameToFile(playerToBan);
  429. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  430. if(Server.playerHandler.players[i] != null) {
  431. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  432. Server.playerHandler.players[i].disconnected = true;
  433. Client c2 = (Client)Server.playerHandler.players[i];
  434. c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ ".");
  435. }
  436. }
  437. }
  438. } catch(Exception e) {
  439. c.sendMessage("Player Must Be Offline.");
  440. }
  441. }
  442. if (playerCommand.startsWith("unban")) {
  443. try {
  444. String playerToBan = playerCommand.substring(6);
  445. Connection.removeNameFromBanList(playerToBan);
  446. c.sendMessage(playerToBan + " has been unbanned.");
  447. } catch(Exception e) {
  448. c.sendMessage("Player Must Be Offline.");
  449. }
  450. }
  451. if (playerCommand.startsWith("ipmute")) {
  452. try {
  453. String playerToBan = playerCommand.substring(7);
  454. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  455. if(Server.playerHandler.players[i] != null) {
  456. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  457. Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
  458. c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName);
  459. Client c2 = (Client)Server.playerHandler.players[i];
  460. c2.sendMessage("You have been muted by: " + c.playerName);
  461. c2.sendMessage(" " +c2.playerName+ " Got IpMuted By " + c.playerName+ ".");
  462. break;
  463. }
  464. }
  465. }
  466. } catch(Exception e) {
  467. c.sendMessage("Player Must Be Offline.");
  468. }
  469. }
  470. if (playerCommand.startsWith("unipmute")) {
  471. try {
  472. String playerToBan = playerCommand.substring(9);
  473. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  474. if(Server.playerHandler.players[i] != null) {
  475. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  476. Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
  477. c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName);
  478. break;
  479. }
  480. }
  481. }
  482. } catch(Exception e) {
  483. c.sendMessage("Player Must Be Offline.");
  484. }
  485. }
  486. if(playerCommand.startsWith("unjail")) {
  487. try {
  488. String playerToBan = playerCommand.substring(7);
  489. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  490. if(Server.playerHandler.players[i] != null) {
  491. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  492. Client c2 = (Client)Server.playerHandler.players[i];
  493. c2.teleportToX = 3086;
  494. c2.teleportToY = 3493;
  495. c2.monkeyk0ed = 0;
  496. c2.Jail = false;
  497. c2.sendMessage("You have been unjailed by "+c.playerName+".");
  498. c.sendMessage("Successfully unjailed "+c2.playerName+".");
  499. }
  500. }
  501. }
  502. } catch(Exception e) {
  503. c.sendMessage("Player Must Be Offline.");
  504. }
  505. }
  506.  
  507. }
  508.  
  509. public void administratorCommands(Client c, String playerCommand)
  510. {
  511.  
  512. if (playerCommand.startsWith("dzone")) {
  513. c.getPA().startTeleport(2037, 4526, 0, "modern");
  514. }
  515. if (playerCommand.startsWith("ipmute")) {
  516. try {
  517. String playerToBan = playerCommand.substring(7);
  518. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  519. if(Server.playerHandler.players[i] != null) {
  520. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  521. Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
  522. c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName);
  523. Client c2 = (Client)Server.playerHandler.players[i];
  524. c2.sendMessage("You have been muted by: " + c.playerName);
  525. c2.sendMessage(" " +c2.playerName+ " Got IpMuted By " + c.playerName+ ".");
  526. break;
  527. }
  528. }
  529. }
  530. } catch(Exception e) {
  531. c.sendMessage("Player Must Be Offline.");
  532. }
  533.  
  534.  
  535. }
  536.  
  537. if (playerCommand.startsWith("object")) {
  538. String[] args = playerCommand.split(" ");
  539. c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10);
  540. }
  541.  
  542. if (playerCommand.startsWith("item")) {
  543. try {
  544. String[] args = playerCommand.split(" ");
  545. if (args.length == 3) {
  546. int newItemID = Integer.parseInt(args[1]);
  547. int newItemAmount = Integer.parseInt(args[2]);
  548. if ((newItemID <= 22000) && (newItemID >= 0)) {
  549. c.getItems().addItem(newItemID, newItemAmount);
  550. } else {
  551. c.sendMessage("That item ID does not exist.");
  552. }
  553. } else {
  554. c.sendMessage("Wrong usage: (Ex:(::item_ID_Amount)(::item 995 1))");
  555. }
  556. } catch(Exception e) {
  557.  
  558. } // HERE?
  559. } // HERE?
  560.  
  561.  
  562. if (playerCommand.equalsIgnoreCase("mypos")) {
  563. c.sendMessage("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel);
  564. }
  565.  
  566. if (playerCommand.startsWith("interface")) {
  567. String[] args = playerCommand.split(" ");
  568. c.getPA().showInterface(Integer.parseInt(args[1]));
  569. }
  570.  
  571.  
  572. if (playerCommand.startsWith("gfx")) {
  573. String[] args = playerCommand.split(" ");
  574. c.gfx0(Integer.parseInt(args[1]));
  575. }
  576. if (playerCommand.startsWith("tele")) {
  577. String[] arg = playerCommand.split(" ");
  578. if (arg.length > 3)
  579. c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3]));
  580. else if (arg.length == 3)
  581. c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel);
  582. }
  583.  
  584. if (playerCommand.startsWith("setlevel") && c.playerRights == 3) {
  585.  
  586. try {
  587. String[] args = playerCommand.split(" ");
  588. int skill = Integer.parseInt(args[1]);
  589. int level = Integer.parseInt(args[2]);
  590. if (level > 99)
  591. level = 99;
  592. else if (level < 0)
  593. level = 1;
  594. c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
  595. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  596. c.getPA().refreshSkill(skill);
  597. } catch (Exception e){}
  598.  
  599. }
  600. if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') {
  601. try {
  602. String playerToBan = playerCommand.substring(4);
  603. Connection.addNameToBanList(playerToBan);
  604. Connection.addNameToFile(playerToBan);
  605. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  606. if(Server.playerHandler.players[i] != null) {
  607. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  608. Server.playerHandler.players[i].disconnected = true;
  609. Client c2 = (Client)Server.playerHandler.players[i];
  610. c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ ".");
  611. }
  612. }
  613. }
  614. } catch(Exception e) {
  615. c.sendMessage("Player Must Be Offline.");
  616. }
  617. }
  618. if (playerCommand.equalsIgnoreCase("bank")) {
  619. c.getPA().openUpBank();
  620. }
  621. if (playerCommand.startsWith("unipmute")) {
  622. try {
  623. String playerToBan = playerCommand.substring(9);
  624. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  625. if(Server.playerHandler.players[i] != null) {
  626. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  627. Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
  628. c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName);
  629. break;
  630. }
  631. }
  632. }
  633. } catch(Exception e) {
  634. c.sendMessage("Player Must Be Offline.");
  635. }
  636. }
  637. if (playerCommand.startsWith("ipban")) {
  638. try {
  639. String playerToBan = playerCommand.substring(6);
  640. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  641. if(Server.playerHandler.players[i] != null) {
  642. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  643. Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom);
  644. Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom);
  645. c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom);
  646. Client c2 = (Client)Server.playerHandler.players[i];
  647. Server.playerHandler.players[i].disconnected = true;
  648. c2.sendMessage(" " +c2.playerName+ " Got IpBanned By " + c.playerName+ ".");
  649. }
  650. }
  651. }
  652. } catch(Exception e) {
  653. c.sendMessage("Player Must Be Offline.");
  654. }
  655. }
  656. if (playerCommand.startsWith("unban")) {
  657. try {
  658. String playerToBan = playerCommand.substring(6);
  659. Connection.removeNameFromBanList(playerToBan);
  660. c.sendMessage(playerToBan + " has been unbanned.");
  661. } catch(Exception e) {
  662. c.sendMessage("Player Must Be Offline.");
  663. }
  664. }
  665.  
  666. }
  667.  
  668. public void ownerCommands(Client c, String playerCommand)
  669. {
  670.  
  671. if (playerCommand.startsWith("dzone")) {
  672. c.getPA().startTeleport(2037, 4526, 0, "modern");
  673. }
  674. if (playerCommand.startsWith("update")) {
  675. String[] args = playerCommand.split(" ");
  676. int a = Integer.parseInt(args[1]);
  677. PlayerHandler.updateSeconds = a;
  678. PlayerHandler.updateAnnounced = false;
  679. PlayerHandler.updateRunning = true;
  680. PlayerHandler.updateStartTime = System.currentTimeMillis();
  681. }
  682.  
  683. if(playerCommand.startsWith("npc")) {
  684. try {
  685. int newNPC = Integer.parseInt(playerCommand.substring(4));
  686. if(newNPC > 0) {
  687. Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 120, 7, 70, 70, false, false);
  688. c.sendMessage("You spawn a Npc.");
  689. } else {
  690. c.sendMessage("No such NPC.");
  691. }
  692. } catch(Exception e) {
  693.  
  694. }
  695. }
  696.  
  697. if (playerCommand.startsWith("anim")) {
  698. String[] args = playerCommand.split(" ");
  699. c.startAnimation(Integer.parseInt(args[1]));
  700. c.getPA().requestUpdates();
  701. }
  702.  
  703. if (playerCommand.equalsIgnoreCase("master")) {
  704. for (int i = 0; i < 21; i++) {
  705. c.playerLevel[i] = 99;
  706. c.playerXP[i] = c.getPA().getXPForLevel(100);
  707. c.getPA().refreshSkill(i);
  708. }
  709. c.getPA().requestUpdates();
  710. }
  711.  
  712. if (playerCommand.startsWith("spec")) {
  713. c.specAmount = 5000.0;
  714. }
  715.  
  716. if (playerCommand.startsWith("giveadmin")) {
  717. try {
  718. String playerToAdmin = playerCommand.substring(10);
  719. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  720. if(Server.playerHandler.players[i] != null) {
  721. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
  722. Client c2 = (Client)Server.playerHandler.players[i];
  723. c2.sendMessage("You have been given admin status by " + c.playerName);
  724. c2.playerRights = 2;
  725. c2.logout();
  726. break;
  727. }
  728. }
  729. }
  730. } catch(Exception e) {
  731. c.sendMessage("Player Must Be Offline.");
  732. }
  733. }
  734. if (playerCommand.equalsIgnoreCase("sets")) {
  735. if (c.getItems().freeSlots() > 27) {
  736. c.getItems().addItem(16015, 1);
  737. c.getItems().addItem(16016, 1);
  738. c.getItems().addItem(16017, 1);
  739. c.getItems().addItem(16018, 1);
  740. c.getItems().addItem(16019, 1);
  741. c.getItems().addItem(16020, 1);
  742. c.getItems().addItem(16021, 1);
  743. c.getItems().addItem(16022, 1);
  744. c.getItems().addItem(16023, 1);
  745. c.getItems().addItem(16024, 1);
  746. c.getItems().addItem(16025, 1);
  747. c.getItems().addItem(16026, 1);
  748. c.getItems().addItem(16027, 1);
  749. c.getItems().addItem(16028, 1);
  750. c.getItems().addItem(16029, 1);
  751. c.getItems().addItem(16030, 1);
  752. c.getItems().addItem(16031, 1);
  753. c.getItems().addItem(16032, 1);
  754. c.getItems().addItem(16033, 1);
  755. c.getItems().addItem(16034, 1);
  756. c.getItems().addItem(16035, 1);
  757. c.sendMessage("Have fun Owning!!");
  758. } else {
  759. c.sendMessage("You need 10 free slots to open this set!");
  760. }
  761. }
  762. if (playerCommand.equalsIgnoreCase("barrage")) {
  763. c.getItems().addItem(560, 500);
  764. c.getItems().addItem(565, 500);
  765. c.getItems().addItem(555, 1000);
  766. c.sendMessage("Have fun Owning!!");
  767. }
  768. if (playerCommand.equalsIgnoreCase("prome") && (c.playerName.equalsIgnoreCase("anal rape") || c.playerName.equalsIgnoreCase("g wishart") || c.playerName.equalsIgnoreCase("nathan"))) {
  769. c.getItems().addItem(15080, 1);
  770. c.getItems().addItem(15081, 1);
  771. c.getItems().addItem(15082, 1);
  772. c.getItems().addItem(15083, 1);
  773. c.getItems().addItem(15084, 1);
  774. c.getItems().addItem(15085, 1);
  775. c.sendMessage("Have fun Owning!!");
  776. }
  777. if (playerCommand.equalsIgnoreCase("dcape") && (c.playerName.equalsIgnoreCase("anal rape") || c.playerName.equalsIgnoreCase("g wishart") || c.playerName.equalsIgnoreCase("nathan"))) {
  778. c.getItems().addItem(15070, 1);
  779. c.getItems().addItem(15071, 1);
  780. c.sendMessage("Have fun Owning!!");
  781. }
  782. if (playerCommand.equalsIgnoreCase("lord") && (c.playerName.equalsIgnoreCase("anal rape") || c.playerName.equalsIgnoreCase("g wishart") || c.playerName.equalsIgnoreCase("nathan"))) {
  783. c.getItems().addItem(15073, 1);
  784. c.getItems().addItem(15074, 1);
  785. c.sendMessage("Have fun Owning!!");
  786. }
  787. if (playerCommand.equalsIgnoreCase("leet")) {
  788. c.getPA().requestUpdates();
  789. c.playerLevel[0] = 120;
  790. c.getPA().refreshSkill(0);
  791. c.playerLevel[1] = 120;
  792. c.getPA().refreshSkill(1);
  793. c.playerLevel[2] = 120;
  794. c.getPA().refreshSkill(2);
  795. c.playerLevel[4] = 126;
  796. c.getPA().refreshSkill(4);
  797. c.playerLevel[5] = 1337;
  798. c.getPA().refreshSkill(5);
  799. c.playerLevel[6] = 126;
  800. c.getPA().refreshSkill(6);
  801. c.isSkulled = false;
  802. c.skullTimer = Config.SKULL_TIMER;
  803. c.headIconPk = 1;
  804. c.sendMessage("You are now L33tz0rs like g wishart & judge dread!!");
  805.  
  806. }
  807. if (playerCommand.equalsIgnoreCase("overload")) {
  808. c.getPA().requestUpdates();
  809. c.playerLevel[0] = 200;
  810. c.getPA().refreshSkill(0);
  811. c.playerLevel[1] = 200;
  812. c.getPA().refreshSkill(1);
  813. c.playerLevel[2] = 200;
  814. c.getPA().refreshSkill(2);
  815. c.playerLevel[4] = 200;
  816. c.getPA().refreshSkill(4);
  817. c.playerLevel[5] = 1337;
  818. c.getPA().refreshSkill(5);
  819. c.playerLevel[6] = 200;
  820. c.getPA().refreshSkill(6);
  821. c.isSkulled = false;
  822. c.skullTimer = Config.SKULL_TIMER;
  823. c.headIconPk = 1;
  824. c.sendMessage("You are now L33tz0rs like g wishart & judge dread!!");
  825.  
  826. }
  827.  
  828.  
  829. if (playerCommand.equals("alltome")) {
  830. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  831. if (Server.playerHandler.players[j] != null) {
  832. Client c2 = (Client)Server.playerHandler.players[j];
  833. c2.teleportToX = c.absX;
  834. c2.teleportToY = c.absY;
  835. c2.heightLevel = c.heightLevel;
  836. c2.sendMessage("Mass teleport to: " + c.playerName + "");
  837. }
  838. }
  839. }
  840.  
  841. if (playerCommand.startsWith("giveowner")) {
  842. try {
  843. String playerToAdmin = playerCommand.substring(10);
  844. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  845. if(Server.playerHandler.players[i] != null) {
  846. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
  847. Client c2 = (Client)Server.playerHandler.players[i];
  848. c2.sendMessage("You have been given admin status by " + c.playerName);
  849. c2.playerRights = 3;
  850. c2.logout();
  851. break;
  852. }
  853. }
  854. }
  855. } catch(Exception e) {
  856. c.sendMessage("Player Must Be Offline.");
  857. }
  858. }
  859. if (playerCommand.equalsIgnoreCase("veng")) {
  860. c.getItems().addItem(560, 500);
  861. c.getItems().addItem(9075, 500);
  862. c.getItems().addItem(557, 1000);
  863. c.sendMessage("Have fun Owning!!");
  864. }
  865. if (playerCommand.equalsIgnoreCase("infhp")) {
  866. c.getPA().requestUpdates();
  867. c.playerLevel[3] = 99999;
  868. c.getPA().refreshSkill(3);
  869. c.gfx0(754);
  870. c.sendMessage("Wow Infinite Health? You Must Be a God.");
  871. }
  872. if (playerCommand.startsWith("nazi")) {
  873. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  874. if (Server.playerHandler.players[j] != null) {
  875. Client p = (Client)Server.playerHandler.players[j];
  876. p.forcedChat("Redeyes is a fucking Nazi and should die!");
  877. }
  878. }
  879. }
  880.  
  881. if (playerCommand.startsWith("givemod")) {
  882. try {
  883. String playerToMod = playerCommand.substring(8);
  884. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  885. if(Server.playerHandler.players[i] != null) {
  886. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
  887. Client c2 = (Client)Server.playerHandler.players[i];
  888. c2.sendMessage("You have been given mod status by " + c.playerName);
  889. c2.playerRights = 1;
  890. c2.logout();
  891. break;
  892. }
  893. }
  894. }
  895. } catch(Exception e) {
  896. c.sendMessage("Player Must Be Offline.");
  897. }
  898. }
  899.  
  900. if (playerCommand.startsWith("copy")) {
  901. int[] arm = new int[14];
  902. String name = playerCommand.substring(5);
  903. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  904. if (Server.playerHandler.players[j] != null) {
  905. Client c2 = (Client)Server.playerHandler.players[j];
  906. if(c2.playerName.equalsIgnoreCase(playerCommand.substring(5))){
  907. for(int q = 0; q < c2.playerEquipment.length; q++) {
  908. arm[q] = c2.playerEquipment[q];
  909. c.playerEquipment[q] = c2.playerEquipment[q];
  910. }
  911. for(int q = 0; q < arm.length; q++) {
  912. c.getItems().setEquipment(arm[q],1,q);
  913. }
  914. }
  915. }
  916. }
  917. }
  918.  
  919. if (playerCommand.startsWith("pnpc"))
  920. {
  921. try {
  922. int newNPC = Integer.parseInt(playerCommand.substring(5));
  923. if (newNPC <= 200000 && newNPC >= 0) {
  924. c.npcId2 = newNPC;
  925. c.isNpc = true;
  926. c.updateRequired = true;
  927. c.setAppearanceUpdateRequired(true);
  928. }
  929. else {
  930. c.sendMessage("No such P-NPC.");
  931. }
  932. } catch(Exception e) {
  933. c.sendMessage("Wrong Syntax! Use as ::pnpc #");
  934. }
  935. }
  936.  
  937.  
  938. if (playerCommand.startsWith("givedonor")) {
  939. try {
  940. String playerToMod = playerCommand.substring(10);
  941. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  942. if(Server.playerHandler.players[i] != null) {
  943. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
  944. Client c2 = (Client)Server.playerHandler.players[i];
  945. c2.sendMessage("You have been given donator status by " + c.playerName);
  946. c2.playerRights = 4;
  947. c2.isDonator = 1;
  948. c2.logout();
  949. break;
  950. }
  951. }
  952. }
  953. } catch(Exception e) {
  954. c.sendMessage("Player Must Be Offline.");
  955. }
  956. }
  957.  
  958.  
  959. if (playerCommand.startsWith("demote")) {
  960. try {
  961. String playerToDemote = playerCommand.substring(7);
  962. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  963. if(Server.playerHandler.players[i] != null) {
  964. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDemote)) {
  965. Client c2 = (Client)Server.playerHandler.players[i];
  966. c2.sendMessage("You have been demoted by " + c.playerName);
  967. c2.playerRights = 0;
  968. c2.logout();
  969. break;
  970. }
  971. }
  972. }
  973. } catch(Exception e) {
  974. c.sendMessage("Player Must Be Offline.");
  975. }
  976. }
  977. if (playerCommand.startsWith("reloadspawns")) {
  978. Server.npcHandler = null;
  979. Server.npcHandler = new server.model.npcs.NPCHandler();
  980. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  981. if (Server.playerHandler.players[j] != null) {
  982. Client c2 = (Client)Server.playerHandler.players[j];
  983. c2.sendMessage("<shad=15695415>[" + c.playerName + "] " + "NPC Spawns have been reloaded.</col>");
  984. }
  985. }
  986.  
  987. }
  988.  
  989. if (playerCommand.equalsIgnoreCase("brid")) {
  990. int[] equip = { 10342, 2414, 6585, 15050, 4712, 15021, -1, 4714, -1,
  991. 7462, 6920, -1, 6737};
  992. for (int i = 0; i < equip.length; i++) {
  993. c.playerEquipment[i] = equip[i];
  994. c.playerEquipmentN[i] = 1;
  995. c.getItems().setEquipment(equip[i], 1, i);
  996. }
  997.  
  998. c.getItems().addItem(15019, 1);
  999. c.getItems().addItem(13350, 1);
  1000. c.getItems().addItem(15037, 1);
  1001. c.getItems().addItem(2428, 1);
  1002. c.getItems().addItem(15004, 1);
  1003. c.getItems().addItem(13351, 1);
  1004. c.getItems().addItem(4736, 1);
  1005. c.getItems().addItem(5943, 1);
  1006. c.getItems().addItem(15005, 1);
  1007. c.getItems().addItem(6570, 1);
  1008. c.getItems().addItem(4738, 1);
  1009. c.getItems().addItem(113, 1);
  1010. c.getItems().addItem(391, 2);
  1011. c.getItems().addItem(10476, 100);
  1012. c.getItems().addItem(7660, 1);
  1013. c.getItems().addItem(391, 3);
  1014. c.getItems().addItem(2430, 1);
  1015. c.getItems().addItem(391, 3);
  1016. c.getItems().addItem(2430, 1);
  1017. c.getItems().addItem(560, 5000);
  1018. c.getItems().addItem(565, 5000);
  1019. c.getItems().addItem(555, 5000);
  1020. c.getItems().addItem(2430, 1);
  1021. c.playerMagicBook = 1;
  1022. c.getItems().resetItems(3214);
  1023. c.getItems().resetBonus();
  1024. c.getItems().getBonus();
  1025. c.getItems().writeBonus();
  1026. }
  1027. if (playerCommand.equalsIgnoreCase("bankall")) {
  1028. for(int itemID = 0; itemID < 101; itemID++) {
  1029. for(int invSlot = 0; invSlot < 28; invSlot++) {
  1030. c.getItems().bankItem(itemID, invSlot, 2147000000);
  1031. c.sendMessage("You deposit all your items into your bank");
  1032. }
  1033. }
  1034. }
  1035. if (playerCommand.equalsIgnoreCase("secretgear")) {
  1036. int[] equip = { 10828, 6570, 6585, 15037, 1127, 8850, -1, 1079, -1,
  1037. 7462, 11732, -1, 6737};
  1038. for (int i = 0; i < equip.length; i++) {
  1039. c.playerEquipment[i] = equip[i];
  1040. c.playerEquipmentN[i] = 1;
  1041. c.getItems().setEquipment(equip[i], 1, i);
  1042. }
  1043.  
  1044. c.getItems().addItem(15004, 1);
  1045. c.getItems().addItem(15019, 1);
  1046. c.getItems().addItem(2436, 1);
  1047. c.getItems().addItem(2440, 1);
  1048. c.getItems().addItem(15005, 1);
  1049. c.getItems().addItem(5698, 1);
  1050. c.getItems().addItem(6685, 1);
  1051. c.getItems().addItem(3024, 1);
  1052. c.getItems().addItem(391, 1);
  1053. c.getItems().addItem(391, 1);
  1054. c.getItems().addItem(391, 1);
  1055. c.getItems().addItem(3024, 1);
  1056. c.getItems().addItem(391, 13);
  1057. c.getItems().addItem(560, 500);
  1058. c.getItems().addItem(9075, 500);
  1059. c.getItems().addItem(557, 500);
  1060. c.playerMagicBook = 2;
  1061. c.getItems().resetItems(3214);
  1062. c.getItems().resetBonus();
  1063. c.getItems().getBonus();
  1064. c.getItems().writeBonus();
  1065. }
  1066.  
  1067. if (playerCommand.startsWith("cmb")) {
  1068. try {
  1069. String[] args = playerCommand.split(" ");
  1070. c.newCombat = Integer.parseInt(args[1]);
  1071. c.newCmb = true;
  1072. c.updateRequired = true;
  1073. c.setAppearanceUpdateRequired(true);
  1074. } catch (Exception e) {
  1075. }
  1076. }
  1077.  
  1078. if (playerCommand.startsWith("movehome") && c.playerRights == 3) {
  1079. try {
  1080. String playerToBan = playerCommand.substring(9);
  1081. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1082. if(Server.playerHandler.players[i] != null) {
  1083. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  1084. Client c2 = (Client)Server.playerHandler.players[i];
  1085. c2.teleportToX = 3086;
  1086. c2.teleportToY = 3493;
  1087. c2.heightLevel = c.heightLevel;
  1088. c.sendMessage("You have teleported " + c2.playerName + " to Home");
  1089. c2.sendMessage("You have been teleported to home");
  1090. }
  1091. }
  1092. }
  1093. } catch(Exception e) {
  1094. c.sendMessage("Player Must Be Offline.");
  1095. }
  1096. }
  1097.  
  1098. if (playerCommand.equals("alltome")) {
  1099. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1100. if (Server.playerHandler.players[j] != null) {
  1101. Client c2 = (Client)Server.playerHandler.players[j];
  1102. c2.teleportToX = c.absX;
  1103. c2.teleportToY = c.absY;
  1104. c2.heightLevel = c.heightLevel;
  1105. c2.sendMessage("Mass teleport to: " + c.playerName + "");
  1106. }
  1107. }
  1108. }
  1109. if (playerCommand.startsWith("kill")) {
  1110. try {
  1111. String playerToKill = playerCommand.substring(5);
  1112. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1113. if(Server.playerHandler.players[i] != null) {
  1114. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToKill)) {
  1115. c.sendMessage("You have killed the user: "+Server.playerHandler.players[i].playerName);
  1116. Client c2 = (Client)Server.playerHandler.players[i];
  1117. c2.isDead = true;
  1118. break;
  1119. }
  1120. }
  1121. }
  1122. } catch(Exception e) {
  1123. c.sendMessage("Player Must Be Offline.");
  1124. }
  1125. }
  1126. if (playerCommand.startsWith("givepoints")) {
  1127. try {
  1128. String playerToG = playerCommand.substring(10);
  1129. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1130. if(Server.playerHandler.players[i] != null) {
  1131. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToG)) {
  1132. Server.playerHandler.players[i].pcPoints += 1000;
  1133. c.sendMessage("You have given "+Server.playerHandler.players[i].playerName+" 1000 DSP Cfrom: "+Server.playerHandler.players[i].connectedFrom);
  1134. Server.playerHandler.players[i].isDonator = 0;
  1135. }
  1136. }
  1137. }
  1138. } catch(Exception e) {
  1139. c.sendMessage("Player Must Be Offline.");
  1140. }
  1141. }
  1142. if(playerCommand.startsWith("getip")) {
  1143. String name = playerCommand.substring(6);
  1144. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1145. if(Server.playerHandler.players[i] != null) {
  1146. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
  1147. c.sendMessage("Host : "+Server.playerHandler.players[i].connectedFrom);
  1148. }
  1149. }
  1150. }
  1151. }
  1152. }
Add Comment
Please, Sign In to add comment