35 lines
1.2 KiB
PHP
35 lines
1.2 KiB
PHP
<?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;"));
|
||
|
||
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;
|
||
}
|
||
|
||
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;
|
||
}
|