detective.pwn 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Detective System
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. CMD:find(playerid, params[]) {
  34. SendClientMessage(playerid, COLOR_YELLOW, "This command has been deprecated. Use /trace [player's phone number] to trace someone.");
  35. cmd_trace(playerid, "");
  36. /*
  37. if(PlayerInfo[playerid][pJob] != 1 && PlayerInfo[playerid][pJob2] != 1 && PlayerInfo[playerid][pJob3] != 1) {
  38. SendClientMessageEx(playerid, COLOR_GREY, "You're not a detective.");
  39. }
  40. else if(gettime() < UsedFind[playerid]) {
  41. SendClientMessageEx(playerid, COLOR_GREY, "You've already searched for someone - wait a little.");
  42. }
  43. else {
  44. new
  45. iTargetID;
  46. if(sscanf(params, "u", iTargetID)) {
  47. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /find [player]");
  48. }
  49. else if(iTargetID == playerid) {
  50. SendClientMessageEx(playerid, COLOR_GREY, "You can't use this command on yourself.");
  51. }
  52. else if(!IsPlayerConnected(iTargetID)) {
  53. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  54. }
  55. else if(GetPlayerInterior(iTargetID) != 0) {
  56. SendClientMessageEx(playerid, COLOR_GREY, "That person is inside an interior.");
  57. }
  58. else if((PlayerInfo[iTargetID][pAdmin] >= 2 || PlayerInfo[iTargetID][pWatchdog] >= 2) && PlayerInfo[iTargetID][pTogReports] != 1) {
  59. SendClientMessageEx(playerid, COLOR_GREY, "You are unable to find this person.");
  60. }
  61. else if (GetPVarInt(playerid, "_SwimmingActivity") >= 1) {
  62. SendClientMessageEx(playerid, COLOR_GRAD2, "You are unable to find people while swimming.");
  63. }
  64. else if (PlayerInfo[iTargetID][pPnumber] == 0)
  65. {
  66. SendClientMessageEx(playerid, COLOR_GREY, "This person does not have a phone.");
  67. }
  68. else if(PhoneOnline[iTargetID] == 0)
  69. {
  70. switch(PlayerInfo[playerid][pDetSkill]) {
  71. case 0 .. 50: {
  72. FindTimePoints[playerid] = 4;
  73. UsedFind[playerid] = gettime()+120;
  74. }
  75. case 51 .. 100: {
  76. FindTimePoints[playerid] = 6;
  77. UsedFind[playerid] = gettime()+90;
  78. }
  79. case 101 .. 200: {
  80. FindTimePoints[playerid] = 8;
  81. UsedFind[playerid] = gettime()+60;
  82. }
  83. case 201 .. 400: {
  84. FindTimePoints[playerid] = 10;
  85. UsedFind[playerid] = gettime()+30;
  86. }
  87. default: {
  88. FindTimePoints[playerid] = 12;
  89. UsedFind[playerid] = gettime()+15;
  90. }
  91. }
  92. new
  93. szZone[MAX_ZONE_NAME],
  94. szMessage[108];
  95. SetPlayerMarkerForPlayer(playerid, iTargetID, FIND_COLOR);
  96. GetPlayer3DZone(iTargetID, szZone, sizeof(szZone));
  97. format(szMessage, sizeof(szMessage), "%s has been last seen at %s.", GetPlayerNameEx(iTargetID), szZone);
  98. SendClientMessageEx(playerid, COLOR_GRAD2, szMessage);
  99. FindingPlayer[playerid]=iTargetID;
  100. FindTime[playerid] = 1;
  101. if(PlayerInfo[playerid][pDoubleEXP] > 0) {
  102. format(szMessage, sizeof(szMessage), "You have gained 2 detective skill points instead of 1. You have %d hours left on the Double EXP token.", PlayerInfo[playerid][pDoubleEXP]);
  103. SendClientMessageEx(playerid, COLOR_YELLOW, szMessage);
  104. PlayerInfo[playerid][pDetSkill] += 2;
  105. }
  106. else ++PlayerInfo[playerid][pDetSkill];
  107. switch(PlayerInfo[playerid][pDetSkill]) {
  108. case 50: SendClientMessageEx(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 2, you can find a little faster.");
  109. case 100: SendClientMessageEx(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 3, you can find a little faster.");
  110. case 200: SendClientMessageEx(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 4, you can find a little faster.");
  111. case 400: SendClientMessageEx(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 5, you can find a little faster.");
  112. }
  113. }
  114. else
  115. {
  116. SendClientMessageEx(playerid, COLOR_GRAD2, "You are unable to get a trace on this person.");
  117. return 1;
  118. }
  119. }
  120. */
  121. return 1;
  122. }