Advertisement
Guest User

Untitled

a guest
May 28th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 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_WHITE, "{FF8306}KORISTETE:{FFFFFF}/jail [ID/Ime na Igrac] [minuti] [pricina].");
  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)
  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_WHITE, "{FF8306}KORISTETE:{FFFFFF}/jail [ID/Ime na Igrac] [minuti] [pricina]");
  40. return 1;
  41. }
  42. new rand;
  43. rand = random(sizeof(gRandomJailSpawns));
  44. format(string, sizeof(string), "{37F906}INFO:{FFFFFF}Go zatvorivte %s.", giveplayer);
  45. SendClientMessage(playerid, WHITE, string);
  46. //format(string, sizeof(string), "{37F906}INFO:{FFFFFF}Administrator %s ve zatvori vo zatvor, Pricina: %s.", sendername, (result));
  47. //SendClientMessage(playa, WHITE, string);
  48. SafeResetPlayerWeapons(playa);
  49. WantedPoints[playa] = 0;
  50. PlayerInfo[playa][pJailed] = 1;
  51. //PlayerInfo[playa][pJailed] = 2;
  52. PlayerInfo[playa][pJailTime] = money*60;
  53. SetPlayerInterior(playa, 0);
  54. PlayerInfo[playa][pInt] = 0;
  55. //SetPlayerPos(playa, 107.2300,1920.6311,18.5208);
  56. SetPlayerPos(playa, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
  57. SetPlayerWorldBounds(playa, 337.5694,101.5826,1940.9759,1798.7453);
  58. SetPlayerSkin(playa, 72);
  59. TogglePlayerControllable(playa, 0);
  60. SetTimerEx("UlazuInt",2000, false, "i", playa);
  61. format(string, sizeof(string), "{37F906}INFO:{FFFFFF}Zatvoreni ste na %d minuti.", money);
  62. SendClientMessage(playa, COLOR_WHITE, string);
  63. //format(string, 256, "%s e zatvoren od Administrator %s, Pricina: %s.", giveplayer, sendername, (result));
  64. //ABroadCast(COLOR_UBAVACRVENA,string,1);
  65. format(string, sizeof(string), "%s e zatvoren %d minuti vo zatvor od Administrator %s, Pricina: %s.", giveplayer, money, sendername, (result));
  66. SendClientMessageToAll(COLOR_LIGHTRED,string);
  67. printf("%s",string);
  68. OnPlayerUpdate(playa);
  69. }
  70. }
  71. }
  72. else
  73. {
  74. SendClientMessage(playerid, WHITE, "{FF0000}GRESKA:{FFFFFF}Nemozete da ja koristite ovaa komanda.");
  75. }
  76. }
  77. return 1;
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement