mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-05-02 12:19:20 +02:00
Fix #70 TFS 1.0 Set position
This commit is contained in:
parent
1c557585a0
commit
6e9cfef9ff
@ -123,27 +123,40 @@ function bomberman_highscores() {
|
|||||||
|
|
||||||
// Support list
|
// Support list
|
||||||
function support_list() {
|
function support_list() {
|
||||||
$TFS = Config('ServerEngine');
|
$TFS = Config('ServerEngine');
|
||||||
if ($TFS == 'TFS_10') $staffs = mysql_select_multi("SELECT `id`, `group_id`, `name`, `account_id` FROM `players` WHERE `group_id` > 1 ORDER BY `group_id` ASC;");
|
|
||||||
else $staffs = mysql_select_multi("SELECT `group_id`, `name`, `online`, `account_id` FROM `players` WHERE `group_id` > 1 ORDER BY `group_id` ASC;");
|
|
||||||
|
|
||||||
if ($staffs !== false) {
|
if ($TFS == 'TFS_10') $staffs = mysql_select_multi("SELECT `p`.`id`, `a`.`type` as `group_id`, `p`.`name`, `p`.`account_id` FROM `players` AS `p` INNER JOIN `accounts` AS `a` ON `p`.`account_id` = `a`.`id` WHERE `a`.`type` > 1 ORDER BY `p`.`account_id` DESC, `p`.`group_id` ASC, `p`.`level` ASC;");
|
||||||
for ($i = 0; $i < count($staffs); $i++) {
|
else $staffs = mysql_select_multi("SELECT `a`.`type` as `group_id`, `p`.`name`, `p`.`online`, `p`.`account_id` FROM `players` AS `p` INNER JOIN `accounts` AS `a` ON `a`.`id` = `p`.`account_id` WHERE `a`.`type` > 1 ORDER BY `p`.`account_id` DESC, `p`.`group_id` ASC, `p`.`level` ASC;");
|
||||||
// $staffs[$i]['']
|
|
||||||
if ($TFS == 'TFS_02' || $TFS == 'TFS_10') {
|
foreach($staffs as $k => $v) {
|
||||||
$account = mysql_select_single("SELECT `type` FROM `accounts` WHERE `id` ='". $staffs[$i]['account_id'] ."';");
|
foreach($staffs as $key => $value) {
|
||||||
$staffs[$i]['group_id'] = $account['type'];
|
if($k != $key && $v['account_id'] == $value['account_id']) {
|
||||||
if ($TFS == 'TFS_10') {
|
unset($staffs[$k]);
|
||||||
// Fix online status on TFS 1.0
|
}
|
||||||
if (user_is_online_10($staffs[$i]['id'])) $staffs[$i]['online'] = 1;
|
}
|
||||||
else $staffs[$i]['online'] = 0;
|
}
|
||||||
unset($staffs[$i]['id']);
|
|
||||||
}
|
if ($staffs !== false && $TFS == 'TFS_10') {
|
||||||
}
|
for ($i = 0; $i < count($staffs); $i++) {
|
||||||
unset($staffs[$i]['account_id']);
|
// Fix online status on TFS 1.0
|
||||||
}
|
if (user_is_online_10($staffs[$i]['id'])) $staffs[$i]['online'] = 1;
|
||||||
}
|
else $staffs[$i]['online'] = 0;
|
||||||
return $staffs;
|
unset($staffs[$i]['id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $staffs;
|
||||||
|
}
|
||||||
|
|
||||||
|
function support_list03() {
|
||||||
|
$staffs = mysql_select_multi("SELECT `group_id`, `name`, `online`, `account_id` FROM `players` WHERE `group_id` > 1 ORDER BY `group_id` ASC;");
|
||||||
|
|
||||||
|
if ($staffs !== false) {
|
||||||
|
for ($i = 0; $i < count($staffs); $i++) {
|
||||||
|
// $staffs[$i]['']
|
||||||
|
unset($staffs[$i]['account_id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $staffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NEWS
|
// NEWS
|
||||||
@ -665,20 +678,20 @@ function gesior_sql_killer($did) {
|
|||||||
|
|
||||||
// ADMIN FUNCTIONS
|
// ADMIN FUNCTIONS
|
||||||
function set_ingame_position($name, $acctype) {
|
function set_ingame_position($name, $acctype) {
|
||||||
$acctype = (int)$acctype;
|
$acctype = (int)$acctype;
|
||||||
$name = sanitize($name);
|
$name = sanitize($name);
|
||||||
|
|
||||||
$acc_id = user_character_account_id($name);
|
$acc_id = user_character_account_id($name);
|
||||||
$char_id = user_character_id($name);
|
$char_id = user_character_id($name);
|
||||||
|
|
||||||
$group_id = 2;
|
$group_id = 1;
|
||||||
if ($acctype == 1) {
|
if ($acctype == 4) {
|
||||||
$group_id = 1;
|
$group_id = 2;
|
||||||
} elseif ($acctype == 6) {
|
} elseif ($acctype >= 5) {
|
||||||
$group_id = 3;
|
$group_id = 3;
|
||||||
}
|
}
|
||||||
mysql_update("UPDATE `accounts` SET `type` = '$acctype' WHERE `id` =$acc_id;");
|
mysql_update("UPDATE `accounts` SET `type` = '$acctype' WHERE `id` =$acc_id;");
|
||||||
mysql_update("UPDATE `players` SET `group_id` = '$group_id' WHERE `id` =$char_id;");
|
mysql_update("UPDATE `players` SET `group_id` = '$group_id' WHERE `id` =$char_id;");
|
||||||
}
|
}
|
||||||
|
|
||||||
// .3
|
// .3
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
$cache = new Cache('engine/cache/support');
|
$cache = new Cache('engine/cache/support');
|
||||||
if ($cache->hasExpired()) {
|
if ($cache->hasExpired()) {
|
||||||
// Fetch all staffs in-game.
|
// Fetch all staffs in-game.
|
||||||
$staffs = support_list();
|
if ($TFS == 'TFS_03') {
|
||||||
|
$staffs = support_list03();
|
||||||
|
} else $staffs = support_list();
|
||||||
// Fetch group ids and names from config.php
|
// Fetch group ids and names from config.php
|
||||||
$groups = $config['ingame_positions'];
|
$groups = $config['ingame_positions'];
|
||||||
// Loops through groups, separating each group element into an ID variable and name variable
|
// Loops through groups, separating each group element into an ID variable and name variable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user