battles/magic/rom.php

35 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2018-01-28 16:40:49 +00:00
<?php
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
$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
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
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;
}