SHARE
TWEET

Test

DoctorX13 Sep 22nd, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rpCalls = array();
  2.  
  3. command pcall(reason) {
  4.     permission = "police.call";
  5.     execute(){
  6.         if(isSet(reason)){
  7.             reasoning = reason;
  8.         }else{
  9.             reasoning = "None";
  10.         }
  11.         foreach(player in server.players){
  12.             if(player.hasPermission("police")) {
  13.                 pl.message(player.name + " has called 911. Reason: " + reasoning + ". Respond by doing /respond!");
  14.             }
  15.         }
  16.         rpCalls.add(player.id);
  17.     }
  18. }    
  19.  
  20. command respond(){
  21.     permission = "police.respond";
  22.     execute(){
  23.         if(player.hasPermission("police")){
  24.             if(rpCalls[0] != null){
  25.                 targetPlayer = toPlayer(rpCalls[0]);
  26.                 if(isPlayer(targetPlayer){
  27.                     targetName = targetPlayer.name;
  28.                     location = targetPlayer.position;
  29.                     player.setMarker(location);
  30.                     rpCalls.remove(targetPlayer.id);
  31.                     foreach(player in server.players){
  32.                         if(player.hasPermission("police")){
  33.                         player.message(player.name + " has responded to " + targetName + " call!");
  34.                         }
  35.                     }
  36.                     player.message("Placed a marker on " + targetName + " location!");
  37.                 }else{
  38.                     player.message("Target player not a player");
  39.                 }
  40.             }else{
  41.                 player.message("There is nobody to respond to!");
  42.             }
  43.         }else{
  44.             player.message("You are not a police!");
  45.         }
  46.     }
  47. }
  48.  
  49. event onPlayerQuit(player){
  50.     if(rpCalls.contains(player.id)){
  51.         rpCalls.remove(player.id);
  52.     }
  53. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top