php function status_game user_life bot_life avto if user_life AND bot_

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
function status_game($user_life, $bot_life, $avto) {
if ($user_life == 0 AND $bot_life == 0 AND $avto == 0) $status = 0; // Бой с ботом: руками
if ($user_life == 0 AND $bot_life == 0 AND $avto == 1) $status = 1; // Бой с ботом: автобой
if ($user_life == 1 OR $bot_life == 1) $status = 2; // Результат боя
return $status;
}
function mission_user_location($user) {
$user_mission = mysql_fetch_array(mysql_query("SELECT * FROM `element_mission_user` WHERE `lost_user` = '$user' LIMIT 1"));
if (!$user_mission) {
mysql_query("INSERT INTO `element_mission_user` SET `lost_user` = '$user'");
$user_mission = mysql_fetch_array("SELECT * FROM `element_mission_user` WHERE `lost_user` = '$user' LIMIT 1");
}
return $user_mission;
}
$user_mission = mission_user_location($user['lost_id']);
function mission_close_location($count_mission, $count_win) {
}
?>