You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.5 KiB
52 lines
1.5 KiB
<?php
|
|
/*
|
|
*
|
|
* @copyright (c) 2009 animegame.eu
|
|
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
|
|
*
|
|
*/
|
|
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/char.inc.php');
|
|
|
|
defineIfNotDefined('STATUS_FREI', 'Frei');
|
|
|
|
//Dadurch kriege ich detailierte infos, sollte ein mysql query mal inkorrekt sein!
|
|
function safe_query($query="") {
|
|
if(empty($query)) return false;
|
|
if(DEBUG == "OFF") $result = mysql_query($query) or die('Query failed!');
|
|
else {
|
|
$result = mysql_query($query) or die('Query failed: '
|
|
.'<li>errorno='.mysql_errno()
|
|
.'<li>error='.mysql_error()
|
|
.'<li>query='.$query);
|
|
}
|
|
return $result;
|
|
}
|
|
|
|
|
|
//komplette row des chars auslesen und in einem array speichern
|
|
function chardaten($char_id,$name,&$char_1,&$hp1,&$mp1,&$exp,&$fehler) {
|
|
|
|
$char_1 = getChar($char_id);
|
|
$hp1 = explode(',', $char_1['hp']);
|
|
$mp1 = explode(',', $char_1['mp']);
|
|
$exp = explode(',', $char_1['exp']);
|
|
$user = mysql_Fetch_array(mysql_query("SELECT id FROM user WHERE nickname='$name' LIMIT 1"));
|
|
if($char_1['besitzer'] != $user[0]) {
|
|
$fehler= 'Dieser Char gehört nicht dir!';
|
|
}
|
|
return array($char_1,$hp1,$mp1,$exp,$fehler);
|
|
}
|
|
|
|
/**
|
|
*
|
|
* Überprüft den Status des Charakters
|
|
*
|
|
* @param Int $char_id: Die ID des zu überprüfenden Charakters
|
|
* @param String $status: Der Status auf den geprüft wird
|
|
*/
|
|
function checkCharStatus($char_id, $status) {
|
|
$char = getChar($char_id, false);
|
|
return $char['status'] == $status;
|
|
}
|
|
|
|
?>
|