This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/beta5/player/library/getProtectionLevel.inc

26 lines
472 B
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
class beta5_player_getProtectionLevel {
function beta5_player_getProtectionLevel($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
// Returns a player's protection level
function run($pid) {
$q = $this->db->query(
"SELECT s.prot FROM system s "
. "WHERE s.id IN (SELECT DISTINCT p.system FROM planet p WHERE p.owner = $pid)"
);
if (dbCount($q) != 1) {
return 0;
}
list($prot) = dbFetchArray($q);
return $prot;
}
}
?>