<?php
defined('PROTECTOR') or die('Error: restricted access');
$sett = mysql_query("SELECT * FROM `set` WHERE `usr` = '$log' LIMIT 1");
$set = mysql_fetch_assoc($sett);
$time = time();
if($set[vip]==on and $time >= $set[viptime]){
mysql_query("UPDATE `set` SET `vip` = 'off' WHERE `usr` = '$log' LIMIT 1");
$time = date("H:i d.m.y");
$text = "Закончилось время vip-статуса";
mysql_query("INSERT INTO `msg_r` SET `user_from` = 'VIP', `user_to` = '$log', `time` = '$time', `read` = 1, `mail_msg` = '$text'");
}
//////////////функция инвайтов арены..
$sta=$set[razb]*18;
if($sta>=300){$sta=299;}
$vrem=300-$sta;
if($time>=$set[artime]+$vrem and $set[arenainv]<$set[invmax]){mysql_query("UPDATE `set` SET `artime` = '$set[artime]'+'$vrem', `arenainv`='$set[arenainv]'+'1' WHERE `usr` = '$log' LIMIT 1");}
//////////////функция эжедневных подарков..


?>