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

23 lines
516 B
PHP

<?php
class beta5_player_addEnemyAlliance {
function beta5_player_addEnemyAlliance($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
// Adds an alliance to the enemy list
function run($pid, $eid) {
$this->db->query("INSERT INTO enemy_alliance VALUES($pid,$eid)");
$q = $this->db->query("SELECT id FROM player WHERE alliance=$eid AND a_status='IN'");
$al = array();
while ($r = dbFetchArray($q)) {
array_push($al, $r[0]);
}
$this->lib->call('makeEnemies', $pid, $al);
}
}
?>