Guest User

Untitled

a guest
Aug 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. if(strcmp(cmd, "/jail", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5.  
  6. tmp = strtok(cmdtext, idx);
  7. if(!strlen(tmp))
  8. {
  9. SendClientMessage(playerid, COLOR_GRAD2, "Utiliza: /Jail [ID/Nombre] [Tiempo] [Razón]");
  10. return 1;
  11. }
  12.  
  13. new playa;
  14. new length = strlen(cmdtext);
  15. new money;
  16. playa = ReturnUser(tmp);
  17. tmp = strtok(cmdtext, idx);
  18. money = strval(tmp);
  19. new offset = idx;
  20. new result[64];
  21. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  22. {
  23. result[idx - offset] = cmdtext[idx];
  24. idx++;
  25. }
  26. result[idx - offset] = EOS;
  27. if(!strlen(result))
  28. {
  29. SendClientMessage(playerid, COLOR_GRAD2, "Utiliza: /Jail [ID/Nombre] [Tiempo] [Razón]");
  30. return 1;
  31. }
  32. if (PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 2012)
  33. {
  34. if(IsPlayerConnected(playa))
  35. {
  36. if(playa != INVALID_PLAYER_ID)
  37. {
  38. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  39. GetPlayerName(playerid, sendername, sizeof(sendername));
  40. format(string, sizeof(string), "* Jaileaste a: %s. Razón: %s", giveplayer, (result));
  41. SendClientMessage(playerid, COLOR_LIGHTRED, string);
  42. format(string, sizeof(string), "* Fuiste Jaileado por el STAFF %s, Razón: %s", sendername, (result));
  43. SendClientMessage(playa, COLOR_LIGHTRED, string);
  44. format(string, sizeof(string), "Administración: %s ha Jaileado a %s, %d minutos, Razón: %s.", sendername,giveplayer,money,(result));
  45. SendClientMessageToAll(COLOR_LIGHTRED,string);
  46. ResetPlayerWeapons(playa);
  47. WantedPoints[playa] = 0;
  48. PlayerInfo[playa][pJailed] = 1;
  49. PlayerInfo[playa][pJailTime] = money*60;
  50. SetPlayerVirtualWorld(playerid, 0);
  51. SetPlayerInterior(playerid,0);
  52. PlayerInfo[playerid][pInt] = 0;
  53. SetPlayerPos(playa, -571.6538,-3528.4221,-0.3773);
  54. format(string, sizeof(string), "Estás Jaileado por %d minutos.", money);
  55. SendClientMessage(playa, COLOR_LIGHTBLUE, string);
  56. }
  57. }
  58. }
  59. else
  60. {
  61. SendClientMessage(playerid, COLOR_GRAD1, "No estás autorizado para usar este comando.");
  62. }
  63. }
  64. return 1;
  65. }
Add Comment
Please, Sign In to add comment