Advertisement
Guest User

Untitled

a guest
Jul 28th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. CMD:jail(playerid, params[])
  2. {
  3. new string[128], giveplayerid, minutes, reason[64];
  4. if(sscanf(params, "uds[64]", giveplayerid, minutes, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /jail [playerid] [minutes] [reason]");
  5.  
  6. if(minutes < 0 || minutes > 30) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't jail for more than 30 minutes.");
  7. if (PlayerInfo[playerid][pAdmin] >= 2)
  8. {
  9. if(IsPlayerConnected(giveplayerid))
  10. {
  11.  
  12. if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
  13. {
  14. SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
  15. return 1;
  16. }
  17. if(GetPVarInt(giveplayerid, "IsInArena") >= 0)
  18. {
  19. LeavePaintballArena(giveplayerid, GetPVarInt(giveplayerid, "IsInArena"));
  20. }
  21.  
  22. ResetPlayerWeaponsEx(giveplayerid);
  23. new year, month,day;
  24. getdate(year, month, day);
  25. format(string, sizeof(string), "AdmCmd: %s has been jailed by %s, reason: %s(%d-%d-%d)", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason, month, day, year);
  26. Log("logs/admin.log", string);
  27. format(string, sizeof(string), "AdmCmd: %s has been jailed by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
  28. SendClientMessageToAllEx(COLOR_LIGHTRED, string);
  29. ResetPlayerWeaponsEx(giveplayerid);
  30. WantedPoints[giveplayerid] = 0;
  31. PlayerInfo[giveplayerid][pJailed] = 1000;
  32. PhoneOnline[giveplayerid] = 1;
  33. PlayerInfo[giveplayerid][pJailTime] = minutes*60;
  34. SetPlayerInterior(giveplayerid, 10);
  35. new rand = random(sizeof(LSPDJail));
  36. SetPlayerFacingAngle(giveplayerid, 0);
  37. TogglePlayerControllable(giveplayerid, 1);
  38. SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
  39. RemovePlayerAttachedObject(giveplayerid,0);
  40. SetPlayerPos(giveplayerid, LSPDJail[rand][0], LSPDJail[rand][1], LSPDJail[rand][2]);
  41. PlayerInfo[giveplayerid][pVW] = 133337;
  42. SetPlayerVirtualWorld(giveplayerid, 133337);
  43. format(string, sizeof(string), "You are jailed for %d minutes. Bail: Unable", minutes);
  44. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  45. format(PlayerInfo[giveplayerid][pPrisonedBy], 24, "%s", GetPlayerNameEx(playerid));
  46. format(PlayerInfo[giveplayerid][pPrisonReason], 128, "[OOC][JAIL] %s", reason);
  47. }
  48. }
  49. else
  50. {
  51. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  52. }
  53. return 1;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement