Skip to content

Instantly share code, notes, and snippets.

@PEMapModder
Last active September 27, 2015 11:57
Show Gist options
  • Select an option

  • Save PEMapModder/0beef083b83b73c754c7 to your computer and use it in GitHub Desktop.

Select an option

Save PEMapModder/0beef083b83b73c754c7 to your computer and use it in GitHub Desktop.
<?php
if(!$this->testPermission($sender)){
return true;
}
if(!isset($args[0])){
$this->sendUsage($sender);
return true;
}
$player = array_shift($args);
$ses = $this->getSession($player);
if(!($ses instanceof Session)){
$this->notOnline($sender);
return true;
}
$points = $this->points;
$msg = self::$IDS_TO_MESSAGES[$this->id];
if($sender instanceof Player){
$ses = $this->getSession($sender); // WTF
if($ses instanceof Session){
if(!$ses->isAdmin()){
$notAdmin = true;
}
}
}
if(!isset($notAdmin) and isset($args[0])){
$points = (int) array_shift($args);
if(isset($args[0])){
$msg = implode(" ", $args);
}
}
$ses->warn($this->id, $points, $sender, $msg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment