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/moveAllyUp.inc

22 lines
588 B
PHP

<?php
class beta5_player_moveAllyUp {
function beta5_player_moveAllyUp($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
// Move an ally up the list
function run($pid, $it) {
$q = $this->db->query("SELECT COUNT(*) FROM trusted WHERE player=$pid");
list($all) = dbFetchArray($q);
$np = $it - 1;
$this->db->query("UPDATE trusted SET level=$all WHERE player=$pid AND level=$it");
$this->db->query("UPDATE trusted SET level=$it WHERE player=$pid AND level=$np");
$this->db->query("UPDATE trusted SET level=$np WHERE player=$pid AND level=$all");
}
}
?>