$pitxp - $mobyr; // это из 8 - 1 - вот что это.
И в итоге хоть ты смог хоть не смог результат всегда один, еще exit на die поменять и всё как в жизни будет.
$reply_author2 = $data->object->fwd_messages->0->from_id;
$reply_author2 = $data['object']['fwd_messages'][0]['from_id'];
$data = json_decode($data);
$reply_author2 = $data['object']['fwd_messages'][0]['from_id'];
<?php
header('Content-Type: text/html; charset=utf-8');
require 'init.php';
require 'needfunc.php';
if(!isset($_POST['viewer_id']) || !isset($_POST['auth_key'])) exit('not parameters');
if(!isset($_POST['type'])) exit('not parameters');
$viewer_id = $_POST['viewer_id'];
$viewer_id = addslashes($viewer_id);
$viewer_id = htmlspecialchars($viewer_id);
$viewer_id = mysql_escape_string($viewer_id);
$auth_key = $_POST['auth_key'];
$auth_key = addslashes($auth_key);
$auth_key = htmlspecialchars($auth_key);
$auth_key = mysql_escape_string($auth_key);
$ip = $_SERVER['REMOTE_ADDR'];
$ip = addslashes($ip);
$ip = htmlspecialchars($ip);
$ip = mysql_escape_string($ip);
$id = $_POST['type'];
if(!is_numeric($id)) exit('fail id');
if($id > 4 || $id < 1) exit('fail id');
$real_auth_key = md5($app_id.'_'.$viewer_id.'_'.$app_key);
if($real_auth_key != $auth_key) exit('you a not you');
if(!mysql_connect($db_host,$db_user,$db_pass)) exit('not_connect');
mysql_select_db($db_name);
$q = 'SELECT * FROM `users` WHERE `uid` = '.$viewer_id;
$res = mysql_query($q);
if(mysql_num_rows($res) == 0) exit('no_user');
$f = mysql_fetch_array($res);
if(time() - $f['addheight_last'] < 4) exit();
if($ip != $f['ip'] && (time() - $f['last_get_inf'] > 20)) {
$q = "UPDATE `users` SET `errors` = errors + 1 WHERE `uid` = ".$viewer_id;
mysql_query($q);
exit();
}
$is = false;
$q = '';
switch($id) {
case 1:
if($f['addheight1']-(time()-900)<=0) {
$now_level = level_detect($f['exp']);
$new_level = level_detect($f['exp']+1);
if($now_level != $new_level) {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`addheight1`= 0,`addheight2`= 0,`addheight3`= 0,`addheight4`= 0,`exp`=exp+1,`drops`=drops+21,`tree_height`=tree_height+1,`new_level` = 1, `sheets` = sheets + 1 WHERE `uid` =".$viewer_id;
}
else {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`addheight1`=".time().",`exp`=exp+1,`drops`=drops+1,`tree_height`=tree_height+1 WHERE `uid` =".$viewer_id;
}
$is = true;
break;
}
else {
if($f['drops']<8) break;
$now_level = level_detect($f['exp']);
$new_level = level_detect($f['exp']+1);
if($now_level != $new_level) {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`addheight1`= 0,`addheight2`= 0,`addheight3`= 0,`addheight4`= 0,`exp`=exp+1,`drops`=drops+12,`tree_height`=tree_height+1,`new_level` = 1, `sheets` = sheets + 1 WHERE `uid` =".$viewer_id;
}
else {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`exp`=exp+1,`tree_height`=tree_height+1,`drops`=drops-8 WHERE `uid` =".$viewer_id;
}
$is = true;
break;
}
case 2:
if($f['addheight2']-(time()-2700)<=0) {
$now_level = level_detect($f['exp']);
$new_level = level_detect($f['exp']+2);
if($now_level != $new_level) {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`addheight1`= 0,`addheight2`= 0,`addheight3`= 0,`addheight4`= 0,`exp`=exp+2,`drops`=drops+22,`tree_height`=tree_height+2,`new_level` = 1, `sheets` = sheets + 1 WHERE `uid` =".$viewer_id;
}
else {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`addheight2`=".time().",`exp`=exp+2,`drops`=drops+2,`tree_height`=tree_height+2 WHERE `uid` =".$viewer_id;
}
$is = true;
break;
}
else {
if($f['drops']<14) break;
$now_level = level_detect($f['exp']);
$new_level = level_detect($f['exp']+2);
if($now_level != $new_level) {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`addheight1`= 0,`addheight2`= 0,`addheight3`= 0,`addheight4`= 0,`exp`=exp+2,`drops`=drops+8,`tree_height`=tree_height+2,`new_level` = 1, `sheets` = sheets + 1 WHERE `uid` =".$viewer_id;
}
else {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`exp`=exp+2,`tree_height`=tree_height+2,`drops`=drops-14 WHERE `uid` =".$viewer_id;
}
$is = true;
break;
}
case 3:
if($f['addheight3']-(time()-5400)<=0) {
$now_level = level_detect($f['exp']);
$new_level = level_detect($f['exp']+3);
if($now_level != $new_level) {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`addheight1`= 0,`addheight2`= 0,`addheight3`= 0,`addheight4`= 0,`exp`=exp+3,`drops`=drops+23,`tree_height`=tree_height+3,`new_level` = 1, `sheets` = sheets + 1 WHERE `uid` =".$viewer_id;
}
else {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`drops` = drops + 3,`addheight3`=".time().",`exp`=exp+3,`tree_height`=tree_height+3 WHERE `uid` =".$viewer_id;
}
$is = true;
break;
}
else {
if($f['drops']<20) break;
$now_level = level_detect($f['exp']);
$new_level = level_detect($f['exp']+3);
if($now_level != $new_level) {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`addheight1`= 0,`addheight2`= 0,`addheight3`= 0,`addheight4`= 0,`exp`=exp+3,`tree_height`=tree_height+3,`new_level` = 1, `sheets` = sheets + 1 WHERE `uid` =".$viewer_id;
}
else {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`exp`=exp+3,`tree_height`=tree_height+3,`drops`=drops-20 WHERE `uid` =".$viewer_id;
}
$is = true;
break;
}
case 4:
if($f['addheight4']-(time()-10800)<=0) {
$now_level = level_detect($f['exp']);
$new_level = level_detect($f['exp']+4);
if($now_level != $new_level) {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`addheight1`= 0,`addheight2`= 0,`addheight3`= 0,`addheight4`= 0,`exp`=exp+4,`drops`=drops+24,`tree_height`=tree_height+4,`new_level` = 1, `sheets` = sheets + 1 WHERE `uid` =".$viewer_id;
}
else {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`addheight4`=".time().",`exp`=exp+4,`drops`=drops+4,`tree_height`=tree_height+4 WHERE `uid` =".$viewer_id;
}
$is = true;
break;
}
else {
if($f['drops']<24) break;
$now_level = level_detect($f['exp']);
$new_level = level_detect($f['exp']+4);
if($now_level != $new_level) {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`addheight1`= 0,`addheight2`= 0,`addheight3`= 0,`addheight4`= 0,`exp`=exp+4,`tree_height`=tree_height+4,`drops`=drops-4,`new_level` = 1, `sheets` = sheets + 1 WHERE `uid` =".$viewer_id;
}
else {
$q = "UPDATE `users` SET `addheight_last` = ".time().",`exp`=exp+4,`tree_height`=tree_height+4,`drops`=drops-24 WHERE `uid` =".$viewer_id;
}
$is = true;
break;
}
}
if($is) {
mysql_query($q);
echo json_encode(array('ok' => 'true'));
}
else {
echo json_encode(array('ok' => 'false'));
}
mysql_close();
?>
$viewer_id = mysql_escape_string($viewer_id);
"Возможность и работа с VK API — chat_kick_user через Callback API?
В смысле бота кикнули?
Проверяй через FOR и прочее, есть или нет.
А касаемо действий, то...
if($chat_act->member_id == '-187956757')