Guest User

/sus

a guest
Mar 18th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. if(OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1) { }
  6. else
  7. {
  8. SendClientMessage(playerid, COLOR_GREY, " You are not on Duty!");
  9. return 1;
  10. }
  11. tmp = strtok(cmdtext, idx);
  12. if(!strlen(tmp))
  13. {
  14. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/su)spect [playerid/PartOfName] [crime discription]");
  15. return 1;
  16. }
  17. giveplayerid = ReturnUser(tmp);
  18. if (gTeam[playerid] == 2 || IsACop(playerid))
  19. {
  20. if(IsPlayerConnected(giveplayerid))
  21. {
  22. if(giveplayerid != INVALID_PLAYER_ID)
  23. {
  24. if (gTeam[giveplayerid] != 2)
  25. {
  26. GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  27. GetPlayerName(playerid, sendername, sizeof(sendername));
  28. new length = strlen(cmdtext);
  29. while ((idx < length) && (cmdtext[idx] <= ' '))
  30. {
  31. idx++;
  32. }
  33. new offset = idx;
  34. new result[64];
  35. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  36. {
  37. result[idx - offset] = cmdtext[idx];
  38. idx++;
  39. }
  40. result[idx - offset] = EOS;
  41. if(!strlen(result))
  42. {
  43. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/su)spect [playerid/PartOfName] [crime text]");
  44. return 1;
  45. }
  46. if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
  47. else { WantedPoints[giveplayerid]+= 2; }
  48. SetPlayerCriminalEx(giveplayerid,playerid, result);
  49. return 1;
  50. }
  51. else
  52. {
  53. SendClientMessage(playerid, COLOR_GRAD2, " You can't suspect a Cop !");
  54. }
  55. }
  56. }
  57. else
  58. {
  59. format(string, sizeof(string), " %d is not an active player.", giveplayerid);
  60. SendClientMessage(playerid, COLOR_GRAD1, string);
  61. return 1;
  62. }
  63. }
  64. else
  65. {
  66. SendClientMessage(playerid, COLOR_GRAD2, " You are not a Cop / FBI / National Guard !");
  67. }
  68. }
  69. return 1;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment