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/library/getPlayerStatus.inc

31 lines
536 B
PHP
Raw Permalink Normal View History

2016-01-10 11:01:49 +01:00
<?php
class beta5_getPlayerStatus {
function beta5_getPlayerStatus($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
function run($pid) {
$q = $this->db->query("SELECT cash FROM player WHERE id=$pid");
if ($q && dbCount($q)) {
list($cash) = dbFetchArray($q);
} else {
$cash = 0;
}
$q = $this->db->query("SELECT COUNT(*) FROM planet WHERE owner=$pid");
if ($q && dbCount($q)) {
list($planets) = dbFetchArray($q);
} else {
$planets = 0;
}
return array($planets, $cash, 0);
}
}
?>