Guest User

Untitled

a guest
Jul 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. if(strcmp(cmd, "/jail", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. tmp = strtok(cmdtext, idx);
  6. if(!strlen(tmp))
  7. {
  8. SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /jail [ID/DioImena] [minuta] [razlog]");
  9. return 1;
  10. }
  11. new playa;
  12. new money;
  13. playa = ReturnUser(tmp);
  14. tmp = strtok(cmdtext, idx);
  15. money = strval(tmp);
  16. if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameSage] >= 4)
  17. {
  18. if(IsPlayerConnected(playa))
  19. {
  20. if(playa != INVALID_PLAYER_ID)
  21. {
  22. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  23. GetPlayerName(playerid, sendername, sizeof(sendername));
  24. new length = strlen(cmdtext);
  25. while ((idx < length) && (cmdtext[idx] <= ' '))
  26. {
  27. idx++;
  28. }
  29. new offset = idx;
  30. new result[128];
  31. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  32. {
  33. result[idx - offset] = cmdtext[idx];
  34. idx++;
  35. }
  36. result[idx - offset] = EOS;
  37. if(!strlen(result))
  38. {
  39. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /jail [playerid/PartOfName] [time(minutes)] [reason]");
  40. return 1;
  41. }
  42. format(string, sizeof(string), " Zatvorio si igraca %s na %d minuta", giveplayer, money);
  43. SendClientMessage(playerid, WHITE, string);
  44. format(string, sizeof(string), "* Admin %s vas je zatvorio u zatvor | Razlog: %s", sendername, (result));
  45. SendClientMessage(playa, COLOR_YELLOW, string);
  46. SafeResetPlayerWeapons(playa);
  47. WantedPoints[playa] = 0;
  48. PlayerInfo[playa][pJailed] = 1;
  49. PlayerInfo[playa][pJailTime] = money*60;
  50. SetPlayerInterior(playa, 0);
  51. PlayerInfo[playa][pInt] = 0;
  52. new rand = random(sizeof(gRandomJailSpawns));
  53. SetPlayerPos(playa, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
  54. format(string, sizeof(string), "* {DB1414}Zatvoren si na %d minuta | Jamcevina: Nedostupna", money);
  55. SendClientMessage(playa, COLOR_YELLOW, string);
  56. format(string, 256, "|JAIL| %s(%d) je zatvoren od Admina %s | Vrijeme: %d | Razlog: %s ", giveplayer, giveplayerid, sendername, money, (result));
  57. PorukaAdminima(COLOR_RED,string,1);
  58. printf("%s",string);
  59. }
  60. }
  61. }
  62. else
  63. {
  64. SendClientMessage(playerid, COLOR_GRAD1, "Odbijeno: Nisi ovlasten!!");
  65. }
  66. }
  67. return 1;
  68. }
Add Comment
Please, Sign In to add comment