2018-01-28 16:40:49 +00:00
|
|
|
|
<?php
|
2020-10-29 23:30:05 +00:00
|
|
|
|
if (empty($_SESSION['uid'])) {
|
2020-09-30 12:01:33 +00:00
|
|
|
|
header("Location: index.php");
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2020-09-30 12:30:00 +00:00
|
|
|
|
|
2020-10-29 23:30:05 +00:00
|
|
|
|
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$_SESSION['uid']}' and `type` = '51' LIMIT 1;"));
|
2018-01-28 16:40:49 +00:00
|
|
|
|
|
2020-10-29 23:30:05 +00:00
|
|
|
|
if ($effect['time']) {
|
|
|
|
|
echo "Персонаж уже пьян";
|
|
|
|
|
} else {
|
|
|
|
|
$zz = mt_rand(1, 3);
|
|
|
|
|
$s = 0;
|
|
|
|
|
$l = 0;
|
|
|
|
|
$i = 0;
|
|
|
|
|
switch ($zz) {
|
|
|
|
|
case 1:
|
|
|
|
|
$s = $user['level'];
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
$l = $user['level'];
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
$i = $user['level'];
|
|
|
|
|
break;
|
|
|
|
|
}
|
2018-01-28 16:40:49 +00:00
|
|
|
|
|
2020-10-29 23:30:05 +00:00
|
|
|
|
mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`,`sila`,`lovk`,`inta`,`vinos`) values ('" . $_SESSION['uid'] . "','Опьянение'," . (time() + 3600) . ",51,'" . $s . "','" . $l . "','" . $i . "','0');");
|
|
|
|
|
mysql_query("UPDATE `users` SET `sila`=`sila`+'" . $s . "', `lovk`=`lovk`+'" . $l . "', `inta`=`inta`+'" . $i . "' WHERE `id` = '" . $_SESSION['uid'] . "' LIMIT 1;");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "<font color=red><b>С Вами что то произошло...<b></font>";
|
|
|
|
|
$bet = 1;
|
|
|
|
|
}
|